| Zakładka z wyszukiwarką danych komponentów |
|
AT89LP428 Arkusz danych(PDF) 67 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
AT89LP428 Arkusz danych(HTML) 67 Page - ATMEL Corporation |
|
67 / 149 page ![]() 67 3654A–MICRO–8/09 AT89LP428/828 13.3.1 Waveform Generation Each CCA channel has an associated external compare output pin: CCA (P2.0), CCB (P2.1), CCC (P2.2) and CCD (P2.3). The CxM 2-0 bits in CCCx determine what action is taken when a compare event occurs. The output pin may be set to 1, cleared to 0 or toggled. Output actions take place even if the interrupt is disabled; however, the associated I/O pin must be set to the desired output mode before the compare event occurs. The state of the compare outputs are ini- tialized to 1 by reset. Multiple compare events per channel can occur within a single time period, provided that the software has time to update the compare value before the timer reaches the next compare point. In this case other interrupts should be disabled or the CCA interrupt given a higher priority in order to ensure that the interrupt is serviced in time. A wide range of waveform generation configurations are possible using the various operating modes of Timer 2 and the CCA. Some example configurations are detailed below. Pulse width modulation is a special case of output compare. See “Pulse Width Modulation Mode” on page 68 for more details of PWM operation. 13.3.1.1 Normal Mode The simplest waveform mode is when CP/RL2 =0 and T2CM1-0 = 01B. In this mode the fre- quency of the output is determined by the TOP value stored in RCAP2L and RCAP2H and output edges occur at fractions of the timer period. Figure 13-4 shows an example of outputting two waveforms of the same frequency but different phase by using the toggle on match action. More complex waveforms are achieved by changing the TOP value and the compare values more frequently. Figure 13-4. Normal Mode Waveform Example 13.3.1.2 Clear-Timer-on-Compare Mode Clear-Timer-on-Compare (CTC) mode occurs when the CTCx bit of a compare channel is set to one. CTC mode works best when Timer 2 is in capture mode (CP/RL2 =1) to allow the full range of compare values. In CTC mode, the compare value defines the interval between output events because the timer is cleared after every compare match. Figure 13-5 shows an example wave- form using the toggle on match action in CTC mode. {RCAP2H,RCA2L} CP/RL2 = 0, T2CM1-0 = 01B, DCEN = 0 CCA {CCAH,CCAL} {CCBH,CCBL} CCB |
|
Link URL |
| Czy Alldatasheet okazała się pomocna? [ DONATE ] |
O Alldatasheet | Reklama | Kontakt | Polityka prywatności | Link do karty katalogowej | Linki | Lista producentów All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |