English
Language : 

MEGA128CAN Datasheet, PDF (160/413 Pages) ATMEL Corporation – Microcontroller WITH 128K BYTES OF ISP FLASH AND CAN CONTROLLER
Output Compare Modulator - OCM
Overview
Many register and bit references in this section are written in general form.
• A lower case “n” replaces the Timer/Counter number, in this case 0 and 1. However,
when using the register or bit defines in a program, the precise form must be used,
i.e., TCNT0 for accessing Timer/Counter0 counter value and so on.
• A lower case “x” replaces the Output Compare unit channel, in this case A or C.
However, when using the register or bit defines in a program, the precise form must
be used, i.e., OCR0A for accessing Timer/Counter0 output compare channel A
value and so on.
The Output Compare Modulator (OCM) allows generation of waveforms modulated with
a carrier frequency. The modulator uses the outputs from the Output Compare Unit C of
the 16-bit Timer/Counter1 and the Output Compare Unit of the 8-bit Timer/Counter0. For
more details about these Timer/Counters see “16-bit Timer/Counter (Timer/Counter1
and Timer/Counter3)” on page 108 and “8-bit Timer/Counter0 with PWM” on page 94.
Figure 76. Output Compare Modulator, Block Diagram
Timer/Counter 1
OC1C
Timer/Counter 0
OC0A
Pin
OC0A / OC1C / PB7
Description
When the modulator is enabled, the two output compare channels are modulated
together as shown in the block diagram (Figure 76).
The Output Compare unit 1C and Output Compare unit 0A shares the PB7 port pin for
output. The outputs of the Output Compare units (OC1C and OC0A) overrides the nor-
mal PORTB7 Register when one of them is enabled (i.e., when COMnx1:0 is not equal
to zero). When both OC1C and OC0A are enabled at the same time, the modulator is
automatically enabled.
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.
The functional equivalent schematic of the modulator is shown on Figure 77. The sche-
matic includes part of the Timer/Counter units and the port B pin 7 output driver circuit.
160 AT90CAN128
4250E–CAN–12/04