WAVEFORM GENERATOR

9.3.5.1Center-aligned Modes

In the center-aligned modes, the counter counts down from the WG_RELOAD value to 1, then counts back up from 1 to WG_RELOAD. When you write to the WG_RELOAD register, WG_COUNTER is loaded with the reload value. When you set the enable bit in the control reg- ister, the counter begins counting down and continues counting until it reaches 1, waits one state time, and starts counting up until it reaches WG_RELOAD. At this point, WG_RELOAD is up- dated and WG_COUNTER is reloaded with the updated value, so a new reload value takes effect for the next cycle. The counter resumes counting down from WG_RELOAD to 1. This produces a symmetrical ascending and descending count, illustrated by the triangular wave in Figure 9-4, with a period that is twice the WG_RELOAD value. Figure 9-5 shows the operation of outputs and interrupts in center-aligned modes.

 

 

WG_RELOAD

 

Counter

Changed

 

WG_COUNTER =

 

Enabled

 

WG_RELOAD

 

 

WG_COUNTER

 

Value

 

1

0

 

 

 

 

 

Carrier Period

 

Reset

Write to WG_RELOAD

 

 

A2636-01

Figure 9-4. Center-aligned Modes — Counter Operation

In mode 0, the WG_COMPx and WG_OUTPUT registers are updated only once during the car- rier period, when the counter reaches the reload value. In mode 1, these registers are updated twice during the carrier period: first when the counter is set to 1, then again when it reaches the reload value.

9-9

Page 208
Image 208
Intel 8XC196MH, 8XC196MD, 8XC196MC manual Center-aligned Modes Counter Operation