Rainbow-electronics ATmega8515L Manual do Utilizador Página 88

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 223
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 87
88
ATmega8515(L)
2512A–AVR–04/02
as a strobe. Thereforeitis thevalue present in the COM01:0 bits that determines the
effectof the forcedcompare.
A FOC0 strobe will not generate any interrupt, norwill it clear thetimer in CTC mode
using OCR0 as TOP.
The FOC0 bit is always read aszero.
Bit 6, 3 – WGM01:0: Waveform Generation Mode
These bitscontrol the counting sequenceof the counter, the source for themaximum
(TOP)counter value, andwhat typeofwaveform generation to beused. Modes of oper-
ation supportedbytheTimer/Counter unit are:Normal mode,Clear Timer on Compare
match (CTC) mode, and twotypes of Pulse WidthModulation (PWM) modes. See Table
44 and Modes ofOperation” on page 82.
Note: 1. The CTC0and PWM0 bit definition names arenow obsolete. Usethe WGM01:0 def-
initions. However, the functionality andlocation of these bits are compatible with
previous versions of thetimer.
Bit 5:4 – COM01:0: Compare Match Output Mode
These bitscontrol the Output Compare pin (OC0)behavior. If one orboth of the
COM01:0 bits are set, the OC0output overrides thenormalport functionality of the I/O
pin it isconnected to. However, note that the Data Direction Register(DDR)bit corre-
spondingtothe OC0 pin must be set in order to enablethe output driver.
When OC0isconnected to the pin, the function of the COM01:0 bitsdepends on the
WGM01:0 bit setting. Table45shows the COM01:0 bit functionalitywhen the WGM01:0
bits are settoanormal orCTC mode (non-PWM).
Table46shows the COM01:0 bit functionalitywhen the WGM01:0 bits are set to fast
PWM mode.
Table 44. Waveform Generation Mode Bit Description
(1)
Mode
WGM01
(CTC0)
WGM00
(PWM0)
Timer/Counter Mode
of Operation TOP
Update of
OCR0 at
TOV0 Flag
Set on
00 0Normal 0xFF Immediate MAX
10 1PWM, Phase Correct0xFF TOP BOTTOM
21 0CTCOCR0 Immediate MAX
3 11FastPWM 0xFF TOP MAX
Table 45. Compare Output Mode, non-PWM Mode
COM01 COM00 Description
00Normalportoperation,OC0 disconnected.
01Toggle OC0oncomparematch.
10ClearOC0oncomparematch.
11Set OC0oncomparematch.
Vista de página 87
1 2 ... 83 84 85 86 87 88 89 90 91 92 93 ... 222 223

Comentários a estes Manuais

Sem comentários