ATmega16HVB Atmel Corporation, ATmega16HVB Datasheet - Page 85

no-image

ATmega16HVB

Manufacturer Part Number
ATmega16HVB
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of ATmega16HVB

Flash (kbytes)
16 Kbytes
Pin Count
44
Max. Operating Frequency
8 MHz
Cpu
8-bit AVR
# Of Touch Channels
8
Hardware Qtouch Acquisition
No
Max I/o Pins
17
Ext Interrupts
15
Usb Speed
No
Usb Interface
No
Spi
1
Twi (i2c)
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
8
Adc Resolution (bits)
12
Adc Speed (ksps)
1.9
Resistive Touch Screen
No
Temp. Sensor
Yes
Crypto Engine
No
Sram (kbytes)
1
Eeprom (bytes)
512
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 85
I/o Supply Class
4.0 to 25
Operating Voltage (vcc)
4.0 to 25
Fpu
No
Mpu / Mmu
no / no
Timers
2
Output Compare Channels
4
Input Capture Channels
2
32khz Rtc
No
Calibrated Rc Oscillator
Yes

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATmega16HVB-8X3
Manufacturer:
LT
Quantity:
51
Part Number:
ATmega16HVB-8X3
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
17.5.3
17.5.4
8042D–AVR–10/11
16-bit mode
Clear timer on Compare Match (CTC) 16-bit mode
the counter value (TCNTn) matches the OCRnA. The OCRnA defines the top value for the coun-
ter, hence also its resolution. This mode allows greater control of the Compare Match output
frequency. It also simplifies the operation of counting external events.
The timing diagram for the CTC mode is shown in
increases until a Compare Match occurs between TCNTn and OCRnA, and then counter
(TCNTn) is cleared.
Figure 17-3. CTC Mode, timing diagram.
An interrupt can be generated each time the counter value reaches the TOP value by using the
OCFnA Flag. If the interrupt is enabled, the interrupt handler routine can be used for updating
the TOP value. However, changing 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 OCRnA is lower than the current
value of TCNTn, 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. As for the Normal mode of operation, the TOVn Flag is set in the same timer clock cycle
that the counter counts from MAX to 0x00.
In 16-bit mode, the counter (TCNTnH/L) is a incrementing until it overruns when it passes its
maximum 16-bit value (MAX = 0xFFFF) and then restarts from the bottom (0x0000), see
17-2 on page 84
cycle as the TCNTnH/L becomes zero. The TOVn Flag in this case behaves like a 17th bit,
except that it is only set, not cleared. However, combined with the timer overflow interrupt that
automatically clears the TOVn Flag, the timer resolution can be increased by software. There
are no special cases to consider in the Normal mode, a new counter value can be written any-
time. The Output Compare Unit can be used to generate interrupts at some given time.
In Clear Timer on Compare 16-bit mode, OCRAnA/B Registers are used to manipulate the coun-
ter resolution, see
zero when the counter value (TCNTn) matches OCRnA/B, where OCRnB represents the eight
most significant bits and OCRnA represents the eight least significant bits. OCRnA/B defines the
top value of the counter, hence also its resolution. This mode allows greater control of the Com-
pare Match output frequency. It also simplifies the operation of counting external events.
An interrupt can be generated each time the counter reaches the TOP value by using the
OCFnA 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 the 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 OCRnA/B is lower than the current
TCNTn
Period
for bit settings. The Overflow Flag (TOVn) will be set in the same timer clock
Table 17-2 on page 84
1
2
for bit settings. In CTC mode the counter is cleared to
3
ATmega16HVB/32HVB
4
Figure
17-3. The counter value (TCNTn)
OCnx Interrupt Flag Set
Table
85

Related parts for ATmega16HVB