English
Language : 

AT90USB646-AU Datasheet, PDF (167/456 Pages) ATMEL Corporation – 8-bit Atmel Microcontroller with 64/128Kbytes of ISP Flash and USB Controller
AT90USB64/128
When the modulator is enabled the type of modulation (logical AND or OR) can be selected by
the PORTB7 Register. Note that the DDRB7 controls the direction of the port independent of the
COMnx1:0 bit setting.
17.2.1
Timing example
Figure 17-3 illustrates the modulator in action. In this example the Timer/Counter1 is set to oper-
ate in fast PWM mode (non-inverted) and Timer/Counter0 uses CTC waveform mode with toggle
Compare Output mode (COMnx1:0 = 1).
Figure 17-3. Output Compare Modulator, timing diagram.
clk I/O
OC1C
(FPWM mode)
OC0A
(CTC mode)
PB7
(PORTB7 = 0)
PB7
(PORTB7 = 1)
(Period)
1
2
3
In this example, Timer/Counter2 provides the carrier, while the modulating signal is generated
by the Output Compare unit C of the Timer/Counter1.
The resolution of the PWM signal (OC1C) is reduced by the modulation. The reduction factor is
equal to the number of system clock cycles of one period of the carrier (OC0A). In this example
the resolution is reduced by a factor of two. The reason for the reduction is illustrated in Figure
17-3 at the second and third period of the PB7 output when PORTB7 equals zero. The period 2
high time is one cycle longer than the period 3 high time, but the result on the PB7 output is
equal in both periods.
7593L–AVR–09/12
167