欢迎访问ic37.com |
会员登录 免费注册
发布采购

ATMEGA64A-AU 参数 Datasheet PDF下载

ATMEGA64A-AU图片预览
型号: ATMEGA64A-AU
PDF下载: 下载PDF文件 查看货源
内容描述: 8位微控制器,带有64K字节的系统内可编程闪存 [8-bit Microcontroller with 64K Bytes In-System Programmable Flash]
分类和应用: 闪存微控制器
文件页数/大小: 392 页 / 7964 K
品牌: ATMEL [ ATMEL ]
 浏览型号ATMEGA64A-AU的Datasheet PDF文件第148页浏览型号ATMEGA64A-AU的Datasheet PDF文件第149页浏览型号ATMEGA64A-AU的Datasheet PDF文件第150页浏览型号ATMEGA64A-AU的Datasheet PDF文件第151页浏览型号ATMEGA64A-AU的Datasheet PDF文件第153页浏览型号ATMEGA64A-AU的Datasheet PDF文件第154页浏览型号ATMEGA64A-AU的Datasheet PDF文件第155页浏览型号ATMEGA64A-AU的Datasheet PDF文件第156页  
ATmega64A  
The timing diagram for the CTC mode is shown in Figure 17-5. The counter value (TCNT2)  
increases until a Compare Match occurs between TCNT2 and OCR2, and then counter (TCNT2)  
is cleared.  
Figure 17-5. CTC Mode, Timing Diagram  
OCn Interrupt Flag Set  
TCNTn  
OCn  
(Toggle)  
(COMn1:0 = 1)  
1
2
3
4
Period  
An interrupt can be generated each time the counter value reaches the TOP value by using the  
OCF2 flag. If the interrupt is enabled, the interrupt handler routine can be used for updating the  
TOP value. However, changing the TOP to a value close to BOTTOM when the counter is run-  
ning with none or a low prescaler value must be done with care since the CTC mode does not  
have the double buffering feature. If the new value written to OCR2 is lower than the current  
value of TCNT2, the counter will miss the Compare Match. The counter will then have to count to  
its maximum value (0xFF) and wrap around starting at 0x00 before the Compare Match can  
occur.  
For generating a waveform output in CTC mode, the OC2 output can be set to toggle its logical  
level on each Compare Match by setting the Compare Output mode bits to toggle mode  
(COM21:0 = 1). The OC2 value will not be visible on the port pin unless the data direction for the  
pin is set to output. The waveform generated will have a maximum frequency of fOC2 = fclk_I/O/2  
when OCR2 is set to zero (0x00). The waveform frequency is defined by the following equation:  
f
clk_I/O  
f
= ----------------------------------------------  
OCn  
2 N ⋅ (1 + OCRn)  
The N variable represents the prescale factor (1, 8, 64, 256, or 1024).  
As for the Normal mode of operation, the TOV2 flag is set in the same timer clock cycle that the  
counter counts from MAX to 0x00.  
17.7.3  
Fast PWM Mode  
The fast Pulse Width Modulation or fast PWM mode (WGM21:0 = 3) provides a high frequency  
PWM waveform generation option. The fast PWM differs from the other PWM option by its sin-  
gle-slope operation. The counter counts from BOTTOM to MAX then restarts from BOTTOM. In  
non-inverting Compare Output mode, the Output Compare (OC2) is cleared on the Compare  
Match between TCNT2 and OCR2, and set at BOTTOM. In inverting Compare Output mode, the  
output is set on Compare Match and cleared at BOTTOM. Due to the single-slope operation, the  
operating frequency of the fast PWM mode can be twice as high as the phase correct PWM  
mode that use dual-slope operation. This high frequency makes the fast PWM mode well suited  
152  
8160C–AVR–07/09  
 复制成功!