[ADMIN:CORE:FUSE:INTERRUPT_VECTOR:LOCKBIT:MEMORY:PACKAGE:PROGRAMMING:IO_MODULE:ICE_SETTINGS] ATmega162 16MHZ 236 RELEASED $1E $94 $04 ATmega161comp ATmega162 V2E AVRSimCoreV2.SimCoreV2 [] [] [] 32 $00 $1B $1A $1D $1C $1F $1E [LOW:HIGH:EXTENDED] 8 CLKDIV8 Divide clock by 8 0 CKOUT Oscillator options 1 SUT1 Select start-up time 0 SUT0 Select start-up time 0 CKSEL3 Select Clock Source 0 CKSEL2 Select Clock Source 0 CKSEL1 Select Clock Source 0 CKSEL0 Select Clock Source 1 52 0x80 0x00 Divide clock by 8 internally; [CKDIV8=0] 0x40 0x00 Clock output on PORTB0; [CKOUT=0] 0x3F 0x00 Ext. Clock; Start-up time: 6 CK + 0 ms; [CKSEL=0000 SUT=00] 0x3F 0x10 Ext. Clock; Start-up time: 6 CK + 4.1 ms; [CKSEL=0000 SUT=01] 0x3F 0x20 Ext. Clock; Start-up time: 6 CK + 65 ms; [CKSEL=0000 SUT=10] 0x3F 0x02 Int. RC Osc.; Start-up time: 6 CK + 0 ms; [CKSEL=0010 SUT=00] 0x3F 0x12 Int. RC Osc.; Start-up time: 6 CK + 4.1 ms; [CKSEL=0010 SUT=01] 0x3F 0x22 Int. RC Osc.; Start-up time: 6 CK + 65 ms; [CKSEL=0010 SUT=10] 0x3F 0x07 Ext. Low-Freq. Crystal; Start-up time: 32K CK + 0 ms; Int. Cap.; [CKSEL=0111 SUT=00] 0x3F 0x17 Ext. Low-Freq. Crystal; Start-up time: 32K CK + 4.1 ms; Int. Cap.; [CKSEL=0111 SUT=01] 0x3F 0x27 Ext. Low-Freq. Crystal; Start-up time: 32K CK + 65 ms; Int. Cap.; [CKSEL=0111 SUT=10] 0x3F 0x06 Ext. Low-Freq. Crystal; Start-up time: 1K CK + 0 ms; Int. Cap.; [CKSEL=0110 SUT=00] 0x3F 0x16 Ext. Low-Freq. Crystal; Start-up time: 1K CK + 4.1 ms; Int. Cap.; [CKSEL=0110 SUT=01] 0x3F 0x26 Ext. Low-Freq. Crystal; Start-up time: 1K CK + 65 ms; Int. Cap.; [CKSEL=0110 SUT=10] 0x3F 0x05 Ext. Low-Freq. Crystal; Start-up time: 32K CK + 0 ms; [CKSEL=0101 SUT=00] 0x3F 0x15 Ext. Low-Freq. Crystal; Start-up time: 32K CK + 4.1 ms; [CKSEL=0101 SUT=01] 0x3F 0x25 Ext. Low-Freq. Crystal; Start-up time: 32K CK + 65 ms; [CKSEL=0101 SUT=10] 0x3F 0x04 Ext. Low-Freq. Crystal; Start-up time: 1K CK + 0 ms; [CKSEL=0100 SUT=00] 0x3F 0x14 Ext. Low-Freq. Crystal; Start-up time: 1K CK + 4.1 ms; [CKSEL=0100 SUT=01] 0x3F 0x24 Ext. Low-Freq. Crystal; Start-up time: 1K CK + 65 ms; [CKSEL=0100 SUT=10] 0x3F 0x08 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 258 CK + 4.1 ms; [CKSEL=1000 SUT=00] 0x3F 0x18 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 258 CK + 65 ms; [CKSEL=1000 SUT=01] 0x3F 0x28 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 1K CK + 0 ms; [CKSEL=1000 SUT=10] 0x3F 0x38 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 1K CK + 4.1 ms; [CKSEL=1000 SUT=11] 0x3F 0x09 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 1K CK + 65 ms; [CKSEL=1001 SUT=00] 0x3F 0x19 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 16K CK + 0 ms; [CKSEL=1001 SUT=01] 0x3F 0x29 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 16K CK + 4.1 ms; [CKSEL=1001 SUT=10] 0x3F 0x39 Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time: 16K CK + 65 ms; [CKSEL=1001 SUT=11] 0x3F 0x0A Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 258 CK + 4.1 ms; [CKSEL=1010 SUT=00] 0x3F 0x1A Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 258 CK + 65 ms; [CKSEL=1010 SUT=01] 0x3F 0x2A Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 1K CK + 0 ms; [CKSEL=1010 SUT=10] 0x3F 0x3A Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 1K CK + 4.1 ms; [CKSEL=1010 SUT=11] 0x3F 0x0B Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 1K CK + 65 ms; [CKSEL=1011 SUT=00] 0x3F 0x1B Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 16K CK + 0 ms; [CKSEL=1011 SUT=01] 0x3F 0x2B Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 16K CK + 4.1 ms; [CKSEL=1011 SUT=10] 0x3F 0x3B Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time: 16K CK + 65 ms; [CKSEL=1011 SUT=11] 0x3F 0x0C Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 258 CK + 4.1 ms; [CKSEL=1100 SUT=00] 0x3F 0x1C Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 258 CK + 65 ms; [CKSEL=1100 SUT=01] 0x3F 0x2C Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 1K CK + 0 ms; [CKSEL=1100 SUT=10] 0x3F 0x3C Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 1K CK + 4.1 ms; [CKSEL=1100 SUT=11] 0x3F 0x0D Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 1K CK + 65 ms; [CKSEL=1101 SUT=00] 0x3F 0x1D Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 16K CK + 0 ms; [CKSEL=1101 SUT=01] 0x3F 0x2D Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 16K CK + 4.1 ms; [CKSEL=1101 SUT=10] 0x3F 0x3D Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time: 16K CK + 65 ms; [CKSEL=1101 SUT=11] 0x3F 0x0E Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 258 CK + 4.1 ms; [CKSEL=1110 SUT=00] 0x3F 0x1E Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 258 CK + 65 ms; [CKSEL=1110 SUT=01] 0x3F 0x2E Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 1K CK + 0 ms; [CKSEL=1110 SUT=10] 0x3F 0x3E Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 1K CK + 4.1 ms; [CKSEL=1110 SUT=11] 0x3F 0x0F Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 1K CK + 65 ms; [CKSEL=1111 SUT=00] 0x3F 0x1F Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 16K CK + 0 ms; [CKSEL=1111 SUT=01] 0x3F 0x2F Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 16K CK + 4.1 ms; [CKSEL=1111 SUT=10] 0x3F 0x3F Ext. Crystal Osc.; Frequency 8.0- MHz; Start-up time: 16K CK + 65 ms; [CKSEL=1111 SUT=11] 8 OCDEN Enable OCD 1 JTAGEN Enable JTAG 0 SPIEN Enable Serial programming and Data Downloading 0 WDTON Watchdog timer always on 1 EESAVE EEPROM memory is preserved through chip erase 1 BOOTSZ1 Select Boot Size 0 BOOTSZ0 Select Boot Size 0 BOOTRST Select Reset Vector 1 10 0x80 0x00 On-Chip Debug Enabled; [OCDEN=0] 0x40 0x00 JTAG Interface Enabled; [JTAGEN=0] 0x20 0x00 Serial program downloading (SPI) enabled; [SPIEN=0] 0x10 0x00 Watchdog timer always on; [WDTON=0] 0x08 0x00 Preserve EEPROM memory through the Chip Erase cycle; [EESAVE=0] 0x06 0x06 Boot Flash section size=128 words Boot start address=$1F80; [BOOTSZ=11] 0x06 0x04 Boot Flash section size=256 words Boot start address=$1F00; [BOOTSZ=10] 0x06 0x02 Boot Flash section size=512 words Boot start address=$1E00; [BOOTSZ=01] 0x06 0x00 Boot Flash section size=1024 words Boot start address=$1C00; [BOOTSZ=00] ; default value 0x01 0x00 Boot Reset vector Enabled (default address=$0000); [BOOTRST=0] 4 M161C ATMega 161 compatibility mode 1 BODLEVEL2 Brown out detector trigger level 1 BODLEVEL1 Brown out detector trigger level 1 BODLEVEL0 Brown out detector trigger level 1 5 0x10 0x00 ATmega161 compability mode; [M161C=0] 0x0E 0x0E Brown-out detection disabled; [BODLEVEL=111] 0x0E 0x0C Brown-out detection level at VCC=1.8 V; [BODLEVEL=110] 0x0E 0x0A Brown-out detection level at VCC=2.7 V; [BODLEVEL=101] 0x0E 0x08 Brown-out detection level at VCC=4.3 V; [BODLEVEL=100] 28 $000 RESET External Pin,Power-on Reset,Brown-out Reset,Watchdog Reset,and JTAG AVR Reset. See Datasheet. $002 INT0 External Interrupt Request 0 $004 INT1 External Interrupt Request 1 $006 INT2 External Interrupt Request 2 $008 PCINT0 Pin Change Interrupt Request 0 $00A PCINT1 Pin Change Interrupt Request 1 $00C TIMER3 CAPT Timer/Counter3 Capture Event $00E TIMER3 COMPA Timer/Counter3 Compare Match A $010 TIMER3 COMPB Timer/Counter3 Compare Match B $012 TIMER3 OVF Timer/Counter3 Overflow $014 TIMER2 COMP Timer/Counter2 Compare Match $016 TIMER2 OVF Timer/Counter2 Overflow $018 TIMER1 CAPT Timer/Counter1 Capture Event $01A TIMER1 COMPA Timer/Counter1 Compare Match A $01C TIMER1 COMPB Timer/Counter Compare Match B $01E TIMER1 OVF Timer/Counter1 Overflow $020 TIMER0 COMP Timer/Counter0 Compare Match $022 TIMER0 OVF Timer/Counter0 Overflow $024 SPI, STC SPI Serial Transfer Complete $026 USART0, RXC USART0, Rx Complete $028 USART1, RXC USART1, Rx Complete $02A USART0, UDRE USART0 Data register Empty $02C USART1, UDRE USART1, Data register Empty $02E USART0, TXC USART0, Tx Complete $030 USART1, TXC USART1, Tx Complete $032 EE_RDY EEPROM Ready $034 ANA_COMP Analog Comparator $036 SPM_RDY Store Program Memory Read [LB1 = 1 : LB2 = 1] No memory lock features enabled. [LB1 = 0 : LB2 = 1] Further programming of Flash and EEPROM is enabled. [LB1 = 0 : LB2 = 0] Same as previous, but verify is also disabled 6 11 0x03 0x03 Mode 1: No memory lock features enabled 0x03 0x02 Mode 2: Further programming disabled 0x03 0x00 Mode 3: Further programming and verification disabled 0x0C 0x0C Application Protection Mode 1: No lock on SPM and LPM in Application Section 0x0C 0x08 Application Protection Mode 2: SPM prohibited in Application Section 0x0C 0x00 Application Protection Mode 3: LPM and SPM prohibited in Application Section 0x0C 0x04 Application Protection Mode 4: LPM prohibited in Application Section 0x30 0x30 Boot Loader Protection Mode 1: No lock on SPM and LPM in Boot Loader Section 0x30 0x20 Boot Loader Protection Mode 2: SPM prohibited in Boot Loader Section 0x30 0x00 Boot Loader Protection Mode 3: LPM and SPM prohibited in Boot Loader Section 0x30 0x10 Boot Loader Protection Mode 4: LPM prohibited in Boot Loader Section LB1 Lock bit LB2 Lock bit BLB01 Boot Lock bit BLB02 Boot Lock bit BLB11 Boot lock bit BLB12 Boot lock bit AVRSimMemory8bit.SimMemory8bit 16384 512 1024 $100 1024 $60 65536 $500 65536 $460 $00 $3F $60 $FF $20 $FF NA $8B 0x010x020x040x080x100x200x400x80 NA $8A 0x010x020x040x080x100x400x80 NA $89 0x010x020x040x080x100x200x400x80 NA $88 0x010x020x040x080x100x200x400x80 NA $87 0x010x020x040x080x100x200x400x80 NA $86 0x010x020x040x080x100x200x400x80 NA $85 0x010x020x040x080x100x200x400x80 NA $84 0x010x020x040x080x100x200x400x80 NA $81 0x010x020x040x080x100x200x400x80 NA $80 0x010x020x040x080x100x200x400x80 NA $7D 0x040x080x100x20 NA $7C 0x040x080x100x20 NA $6C 0x010x020x040x080x100x200x400x80 NA $6B 0x010x020x040x080x100x200x400x80 NA $61 0x010x020x040x080x80 $3F $5F 0x010x020x040x080x100x200x400x80 $3E $5E 0x010x020x040x080x100x200x400x80 $3D $5D 0x010x020x040x080x100x200x400x80 $3C $5C 0x010x020x040x08 $3C $5C 0x010x020x040x080x100x200x400x80 $3B $5B 0x010x020x080x100x200x400x80 $3A $5A 0x080x100x200x400x80 $39 $59 0x080x200x400x800x040x100x010x02 $38 $58 0x080x200x400x800x040x100x010x02 $37 $57 0x010x020x040x080x100x400x80 $36 $56 0x010x020x040x080x100x200x400x80 $35 $55 0x010x020x040x080x100x200x400x80 $34 $54 0x010x020x040x080x100x200x800x80 $33 $53 0x010x020x040x080x100x200x400x80 $32 $52 0x010x020x040x080x100x200x400x80 $31 $51 0x010x020x040x080x100x200x400x80 $30 $50 0x010x020x040x080x100x200x400x80 $2F $4F 0x010x020x040x080x100x200x400x80 $2E $4E 0x010x020x040x080x100x400x80 $2D $4D 0x010x020x040x080x100x200x400x80 $2C $4C 0x010x020x040x080x100x200x400x80 $2B $4B 0x010x020x040x080x100x200x400x80 $2A $4A 0x010x020x040x080x100x200x400x80 $29 $49 0x010x020x040x080x100x200x400x80 $28 $48 0x010x020x040x080x100x200x400x80 $27 $47 0x010x020x040x080x100x200x400x80 $26 $46 0x010x020x040x08 $25 $45 0x010x020x040x080x100x200x400x80 $24 $44 0x010x020x040x080x100x200x400x80 $23 $43 0x010x020x040x080x100x200x400x80 $22 $42 0x010x020x040x080x100x200x400x80 $21 $41 0x010x020x040x080x10 $20 $40 0x010x020x040x080x80 $20 $40 0x010x020x040x080x100x200x400x80 $1F $3F 0x01 $1E $3E 0x010x020x040x080x100x200x400x80 $1D $3D 0x010x020x040x080x100x200x400x80 $1C $3C 0x010x020x040x08 $1B $3B $ff 0x010x020x040x080x100x200x400x80 $1A $3A 0x010x020x040x080x100x200x400x80 $19 $39 0x010x020x040x080x100x200x400x80 $18 $38 $ff 0x010x020x040x080x100x200x400x80 $17 $37 0x010x020x040x080x100x200x400x80 $16 $36 0x010x020x040x080x100x200x400x80 $15 $35 $ff 0x010x020x040x080x100x200x400x80 $14 $34 0x010x020x040x080x100x200x400x80 $13 $33 0x010x020x040x080x100x200x400x80 $12 $32 $ff 0x010x020x040x080x100x200x400x80 $11 $31 0x010x020x040x080x100x200x400x80 $10 $30 0x010x020x040x080x100x200x400x80 $0F $2F 0x010x020x040x080x100x200x400x80 $0E $2E 0x010x400x80 $0D $2D 0x010x020x040x080x100x200x400x80 $0C $2C 0x010x020x040x080x100x200x400x80 $0B $2B 0x010x020x040x080x100x200x400x80 $0A $2A 0x010x020x040x080x100x200x400x80 $09 $29 0x010x020x040x080x100x200x400x80 $08 $28 0x010x020x040x080x100x200x400x80 $07 $27 0x010x020x04 $06 $26 0x010x020x04 $05 $25 0x010x020x040x08 $04 $24 0x010x020x040x080x100x200x40 $04 $24 0x010x020x040x080x100x200x400x80 $03 $23 0x010x020x040x080x100x200x400x80 $02 $22 0x010x020x040x080x100x200x400x80 $01 $21 0x010x020x040x080x100x200x400x80 $00 $20 0x010x020x040x080x100x200x400x80 0x1C00 0x1FFF 0 0x1BFF 64 128 2 0 $1F80 $1F80 256 4 0 $1F00 $1F00 512 8 0 $1E00 $1E00 1024 16 0 $1C00 $1C00 [TQFP] 44 [PB5:MOSI] MOSI:SPI Master data output,slave data input for SPI channel.When the SPI is enabled as a slave,this pin is configured as an input regardless of the setting of DDB5. When the SPI is enabled as a master,the data direction of this pin is controlled by DDB5.When the pin is forced by the SPI to be an input,the pull-up can still be controlled by the PORTB5 bit. [PB6:MISO] MISO:Master data input,slave data output pin for SPI channel.When the SPI is enabled as a master,this pin is configured as an input regardless of the setting of DDB6.When the SPI is enabled as a slave,the data direction of this pin is controlled by DDB6.When the pin is forced by the SPI to be an input,the pull-up can still be controlled by the PORTB6 bit. [PB7_SCK] SCK:Master clock output,slave clock input pin for SPI channel.When the SPI is enabled as a slave,this pin is configured as an input regardless of the setting of DDB7. When the SPI is enabled as a master,the data direction of this pin is controlled by DDB7.When the pin is forced by the SPI to be an input,the pull-up can still be controlled by the PORTB7 bit. ['RESET] [PDO:RXD0] RXD0,Receive Data (Data input pin for USART0).When the USART0 receiver is enabled this pin is configured as an input regardless of the value of DDD0.When USART0 forces this pin to be an input,the pull-up can still be controlled by the PORTD0 bit. [PD1:TXD0] TXD0,Transmit Data (Data output pin for USART0).When the USART0 transmitter is enabled,this pin is configured as an output regardless of the value of DDD1. [PD2:INT0:XCK1] INT0,External Interrupt source 0:The PD2 pin can serve as an external interrupt source. XCK1,USART1 external clock.The Data Direction Register (DDD2)controls whether the clock is output (DDD2 set)or input (DDD2 cleared).The XCK1 pin is active only when USART1 operates in synchronous mode. [PD3:INT1:XCK1] INT1,External Interrupt source 1:The PD3 pin can serve as an external interrupt source. ICP3 -Input Capture Pin:The PD3 pin can act as an input capture pin for Timer/Counter3. [PD4:TOSC1:XCK0:OC3A] TOSC1,Timer Oscillator pin 1:When the AS2 bit in ASSR is set (one)to enable asynchronous clocking of Timer/Counter2,pin PD4 is disconnected from the port,and becomes the input of the inverting oscillator amplifier.In this mode,a crystal oscillator is connected to this pin,and the pin can not be used as an I/O pin. XCK0,USART0 external clock.The Data Direction Register (DDD4)controls whether the clock is output (DDD4 set)or input (DDD4 cleared).The XCK0 pin is active only when USART0 operates in synchronous mode. OC3A,Output Compare matchA output:The PD4 pin can serve as an external output for the Timer/Counter1 output compareA.The pin has to be configured as an output (DDD4 set (one))to serve this function.The OC4A pin is also the output pin for the PWM mode timer function. [PD5:OC1A:TOSC2] TOSC2,Timer Oscillator pin 2:When the AS2 bit in ASSR is set (one)to enable asynchronous clocking of Timer/Counter2,pin PD5 is disconnected from the port,and becomes the inverting output of the oscillator amplifier.In this mode,a crystal oscillator is connected to this pin,and the pin can not be used as an I/O pin. OC1A,Output Compare matchA output:The PD5 pin can serve as an external output for the Timer/Counter1 output compareA.The pin has to be configured as an output (DDD5 set (one))to serve this function.The OC1A pin is also the output pin for the PWM mode timer function. [PD6:'WR] WR is the external data memory write control strobe. [PD7:RD] RD is the external data memory read control strobe. XTAL2 XTAL1 GND [PC0:PCINT8:A8] A8,External memory interface address bit 8. PCINT8:The pin can also serve as a pin change interrupt. [PC1:PCINT9:A9] A9,External memory interface address bit 9. PCINT9:The pin can also serve as a pin change interrupt. [PC2:PCINT10:A10] A10,External memory interface address bit 10. PCINT11:The pin can also serve as a pin change interrupt. [PC3:PCINT11:A11] A11,External memory interface address bit 11. PCINT11:The pin can also serve as a pin change interrupt. [PC4:PCINT12:A12:TCK] A12,External memory interface address bit 12. TCK,JTAG Test Clock:JTAG operation is synchronous to TCK.When the JTAG inter-face is enabled,this pin can not be used as an I/O pin. PCINT12:The pin can also serve as a pin change interrupt. [PC5:PCINT13:A13:TMS] A13,External memory interface address bit 13. TMS,JTAG Test Mode Select:This pin is used for navigating through the TAP-controller state machine.When the JTAG interface is enabled,this pin can not be used as an I/O pin. PCINT13:The pin can also serve as a pin change interrupt. [PC6:PCINT14:A14:TDO] A14,External memory interface address bit 14. TDO,JTAG Test Data Out:Serial output data from Instruction register or Data Register. When the JTAG interface is enabled,this pin can not be used as an I/O pin. PCINT14:The pin can also serve as a pin change interrupt. [PC7:PCINT15:A15:TDI] A15,External memory interface address bit 15. TDI,JTAG Test Data In:Serial input data to be shifted into the Instruction Register or Data Register (scan chains).When the JTAG interface is enabled,this pin can not be used as an I/O pin. PCINT15:The pin can also serve as a pin change interrupt. [PE2:OC1B] OC1B,Output Compare matchB output:The PE0 pin can serve as an external output for the Timer/Counter1 output compareB.The pin has to be configured as an output (DDE0 set (one))to serve this function.The OC1Bpin is also the output pin for the PWM mode timer function. [PE1:ALE] ALE is the external data memory Address Latch Enable signal. [PE0:ICP1:INT2] ICP1 -Input Capture Pin:The PE2 pin can act as an input capture pin for Timer/Counter1. INT2,External Interrupt source 2:The PE2 pin can serve as an external interrupt source. [PA7:PCINT7:AD7] AD7 (External memory interface address and data bit 7) PCINT7 (Pin Change INTerrupt 7) [PA6:PCINT6:AD6] AD6 (External memory interface address and data bit 6) PCINT6 (Pin Change INTerrupt 6) [PA5:PCINT5:AD5] AD5 (External memory interface address and data bit 5) PCINT5 (Pin Change INTerrupt 5) [PA4:PCINT4:AD4] AD4 (External memory interface address and data bit 4) PCINT4 (Pin Change INTerrupt 4) [PA3:PCINT3:AD3] AD3 (External memory interface address and data bit 3) PCINT3 (Pin Change INTerrupt 3) [PA2:PCINT2:AD2] AD2 (External memory interface address and data bit 2) PCINT2 (Pin Change INTerrupt 2) [PA1:PCINT1:AD1] AD1 (External memory interface address and data bit 1) PCINT1 (Pin Change INTerrupt 1) [PA0:PCINT0:AD0] AD0 (External memory interface address and data bit 0) PCINT0 (Pin Change INTerrupt 0) [VCC] [PB0:OC0:T0] T0,Timer/Counter0 counter source. OC0,Output compare match output:The PB0 pin can serve as an external output for the Timer/Counter0 compare match.The PB0 pin has to be configured as an output (DDB0 set (one))to serve this function.The OC0 pin is also the output pin for the PWM mode timer function. [PB1:OC2:T1] T1,Timer/Counter1 counter source. OC2,Output compare match output:The PB1 pin can serve as an external output for the Timer/Counter2 compare match.The PB1 pin has to be configured as an output (DDB1 set (one))to serve this function.The OC2 pin is also the output pin for the PWM mode timer function. [PB2:RXD1:AIN0] AIN0,Analog Comparator Positive Input.Configure the port pin as input with the internal pull-up switched off to avoid the digital port function from interfering with the function of the analog comparator. RXD1,Receive Data (Data input pin for USART1).When the USART1 receiver is enabled this pin is configured as an input regardless of the value of DDB2.When the USART1 forces this pin to be an input,the pull-up can still be controlled by the PORTB2 bit. [PB3:TXD1:AIN1] AIN1,Analog Comparator Negative Input.Configure the port pin as input with the internal pull-up switched off to avoid the digital port function from interfering with the function of the analog comparator. TXD1,Transmit Data (Data output pin for USART1).When the USART1 transmitter is enabled,this pin is configured as an output regardless of the value of DDB3. [PB4:OC3B:'SS] SS:Slave Select input.When the SPI is enabled as a slave,this pin is configured as an input regardless of the setting of DDB4.As a slave,the SPI is activated when this pin is driven low.When the SPI is enabled as a master,the data direction of this pin is controlled by DDB4.When the pin is forced by the SPI to be an input,the pull-up can still be controlled by the PORTB4 bit. OC3B,Output Compare matchB output:The PB4 pin can serve as an external output for the Timer/Counter3 output compareB.The pin has to be configured as an output (DDB4 set (one))to serve this function.The OC3B pin is also the output pin for the PWM mode timer function. 0xff,0xdf 0xff,0xdf 1,0x40,0x40,WARNING! These fuse settings will disable the JTAG interface! 1,0x20,0x20,WARNING! These fuse settings will disable the ISP interface! 1,0x40,0x40,WARNING! These fuse settings will disable the JTAG interface! 1,0x20,0x20,WARNING! These fuse settings will disable the ISP interface! 1,0x40,0x40,WARNING! These fuse settings will disable the JTAG interface! 1,0x20,0x20,WARNING! These fuse settings will disable the ISP interface! 0x00,8.0 MHz 128 4 [TIMER_COUNTER_1:TIMER_COUNTER_2:TIMER_COUNTER_3:ANALOG_COMPARATOR:USART0:USART1:SPI:CPU:JTAG:BOOT_LOAD:EEPROM:PORTA:PORTB:PORTC:PORTD:TIMER_COUNTER_0:WATCHDOG:PORTE:EXTERNAL_INTERRUPT] [TIMSK:TIFR:TCCR1A:TCCR1B:TCNT1H:TCNT1L:OCR1AH:OCR1AL:OCR1BH:OCR1BL:ICR1H:ICR1L] [TCNT1H:TCNT1L];[OCR1AH:OCR1AL];[OCR1BH:OCR1BL];[ICR1H:ICR1L] io_timer.bmp t16pwm1_2.xml The 16-bit Timer/Counter1 can select clock source from CK, prescaled CK, or an external pin. In addition it can be stopped as described in the specification for the Timer/Counter1 Control Registers - TCCR1A and TCCR1B. The different status flags (overflow, compare match and capture event) are found in the Timer/Counter Interrupt Flag Register - TIFR. Control signals are found in the Timer/Counter1 Control Registers - TCCR1A and TCCR1B. The interrupt enable/disable settings for Timer/Counter1 are found in the Timer/Counter Interrupt Mask Register - TIM TIMSK Timer/Counter Interrupt Mask Register $39 $59 io_flag.bmp Y TOIE1 Timer/Counter1 Overflow Interrupt Enable When the TOIE1 bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter1 Overflow interrupt is enabled. The corresponding interrupt (at vector $006) is executed if an overflow in Timer/Counter1 occurs, i.e., when the TOV1 bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 OCIE1A Timer/Counter1 Output CompareA Match Interrupt Enable When the OCIE1A bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter1 CompareA Match interrupt is enabled. The corresponding interrupt (at vector $004) is executed if a CompareA match in Timer/Counter1 occurs, i.e., when the OCF1A bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 OCIE1B Timer/Counter1 Output CompareB Match Interrupt Enable When the OCIE1B bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter1 CompareB Match interrupt is enabled. The corresponding interrupt (at vector $005) is executed if a CompareB match in Timer/Counter1 occurs, i.e., when the OCF1B bit is set in the Timer/Counter Interrupt Flag Register - TIFR. R 0 TICIE1 Timer/Counter1 Input Capture Interrupt Enable When the TICIE1 bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter1 Input Capture Event Interrupt is enabled. The corresponding interrupt (at vector $003) is executed if a capture-triggering event occurs on pin 31, ICP, i.e., when the ICF1 bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 TIFR Timer/Counter Interrupt Flag register $38 $58 io_flag.bmp Y TOV1 Timer/Counter1 Overflow Flag The TOV1 is set (one) when an overflow occurs in Timer/Counter1. TOV1 is cleared by hardware when executing the cor-responding interrupt handling vector. Alternatively, TOV1 is cleared by writing a logic one to the flag. When the I-bit in SREG, and TOIE1 (Timer/Counter1 Overflow Interrupt Enable), and TOV1 are set (one), the Timer/Counter1 Overflow Interrupt is executed. In PWM mode, this bit is set when Timer/Counter1 changes counting direction at $0000. RW 0 OCF1A Output Compare Flag 1A The OCF1A bit is set (one) when compare match occurs between the Timer/Counter1 and the data in OCR1A - Output Compare Register 1A. OCF1A is cleared by hardware when executing the corresponding interrupt handling vector. Alterna-tively, OCF1A is cleared by writing a logic one to the flag. When the I-bit in SREG, and OCIE1A (Timer/Counter1 Compare match InterruptA Enable), and the OCF1A are set (one), the Timer/Counter1 Compare A match Interrupt is executed. RW 0 OCF1B Output Compare Flag 1B The OCF1B bit is set (one) when compare match occurs between the Timer/Counter1 and the data in OCR1B - Output Compare Register 1B. OCF1B is cleared by hardware when executing the corresponding interrupt handling vector. Alterna-tively, OCF1B is cleared by writing a logic one to the flag. When the I-bit in SREG, and OCIE1B (Timer/Counter1 Compare match InterruptB Enable), and the OCF1B are set (one), the Timer/Counter1 Compare B match Interrupt is executed. RW 0 ICF1 Input Capture Flag 1 The ICF1 bit is set (one) to flag an input capture event, indicating that the Timer/Counter1 value has been transferred to the input capture register - ICR1. ICF1 is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, ICF1 is cleared by writing a logic one to the flag. When the SREG I-bit, and TICIE1 (Timer/Counter1 Input Capture Interrupt Enable), and ICF1 are set (one), the Timer/Counter1 Capture Interrupt is executed. RW 0 TCCR1A Timer/Counter1 Control Register A $2F $4F io_flag.bmp Y COM1A1 Compare Output Mode 1A, bit 1 The COM1A1 and COM1A0 control bits determine any output pin action following a compare match in Timer/Counter1. Any output pin actions affect pin OC1A - Output CompareA pin 1. This is an alternative function to an I/O port and the corresponding direction control bit must be set (one) to control the output pin. The control configuration is shown in Table 9. RW 0 COM1A0 Compare Ouput Mode 1A, bit 0 The COM1A1 and COM1A0 control bits determine any output pin action following a compare match in Timer/Counter1. Any output pin actions affect pin OC1A - Output CompareA pin 1. This is an alternative function to an I/O port and the corresponding direction control bit must be set (one) to control the output pin. The control configuration is shown in Table 9. RW 0 COM1B1 Compare Output Mode 1B, bit 1 The COM1B1 and COM1B0 control bits determine any output pin action following a compare match in Timer/Counter1. Any output pin actions affect pin OC1B - Output CompareB. RW 0 COM1B0 Compare Output Mode 1B, bit 0 The COM1B1 and COM1B0 control bits determine any output pin action following a compare match in Timer/Counter1. Any output pin actions affect pin OC1B - Output CompareB. RW 0 FOC1A Force Output Compare for Channel A The FOC1A/FOC1B bits are only active when the WGM13:0 bits specifies a non-PWM mode.However,for ensuring compatibility with future devices,these bits must be set to zero when TCCR1A is written when operating in a PWM mode.When writing a logical one to the FOC1A/FOC1Bbit,an immediate compare match is forced on the waveform generation unit.The OC1A/OC1B output is changed according to its COM1x1:0 bits setting.Note that the FOC1A/FOC1Bbits are implemented as strobes.Therefore it is the value present in the COM1x1:0 bits that determine the effect of the forced compare. A FOC1A/FOC1B strobe will not generate any interrupt nor will it clear the timer in clear timer on compare match (CTC)mode using OCR1A as TOP. The FOC1A/FOC1Bbits are always read as zero. W 0 FOC1B Force Output Compare for Channel B The FOC1A/FOC1B bits are only active when the WGM13:0 bits specifies a non-PWM mode.However,for ensuring compatibility with future devices,these bits must be set to zero when TCCR1A is written when operating in a PWM mode.When writing a logical one to the FOC1A/FOC1Bbit,an immediate compare match is forced on the waveform generation unit.The OC1A/OC1B output is changed according to its COM1x1:0 bits setting.Note that the FOC1A/FOC1Bbits are implemented as strobes.Therefore it is the value present in the COM1x1:0 bits that determine the effect of the forced compare. A FOC1A/FOC1B strobe will not generate any interrupt nor will it clear the timer in clear timer on compare match (CTC)mode using OCR1A as TOP. The FOC1A/FOC1Bbits are always read as zero. W 0 WGM11 PWM11 Pulse Width Modulator Select Bit 1 Combined with the WGM13:2 bits found in the TCCR1B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 WGM10 PWM10 Pulse Width Modulator Select Bit 0 Combined with the WGM13:2 bits found in the TCCR1B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 TCCR1B Timer/Counter1 Control Register B $2E $4E io_flag.bmp Y ICNC1 Input Capture 1 Noise Canceler When the ICNC1 bit is cleared (zero), the input capture trigger noise canceler function is disabled. The input capture is triggered at the first rising/falling edge sampled on the ICP - input capture pin - as specified. When the ICNC1 bit is set (one), four successive samples are measures on the ICP - input capture pin, and all samples must be high/low according to the input capture trigger specification in the ICES1 bit. The actual sampling frequency is XTAL clock frequency. RW 0 ICES1 Input Capture 1 Edge Select While the ICES1 bit is cleared (zero), the Timer/Counter1 contents are transferred to the Input Capture Register - ICR1 - on the falling edge of the input capture pin - ICP. While the ICES1 bit is set (one), the Timer/Counter1 contents are transferred to the Input Capture Register - ICR1 - on the rising edge of the input capture pin - ICP. RW 0 WGM13 CTC11 Pulse Width Modulator Select Bit 3 Combined with the WGM11:0 bits found in the TCCR1B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 WGM12 CTC10 Pulse Width Modulator Select Bit 2 Combined with the WGM11:0 bits found in the TCCR1B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 CS12 Clock Select1 bit 2 RW 0 CS11 Clock Select1 bit 1 RW 0 CS10 Clock Select1 bit 0 RW 0 TCNT1H Timer/Counter1 High Byte This 16-bit register contains the prescaled value of the 16-bit Timer/Counter1. To ensure that both the high and low bytes are read and written simultaneously when the CPU accesses these registers, the access is performed using an 8-bit temporary register (TEMP). This temporary register is also used when accessing OCR1A, OCR1B and ICR1. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. <Please refer to the datasheet $2D $4D io_timer.bmp N TCNT1H7 Timer/Counter1 High Byte bit 7 RW 0 TCNT1H6 Timer/Counter1 High Byte bit 6 RW 0 TCNT1H5 Timer/Counter1 High Byte bit 5 RW 0 TCNT1H4 Timer/Counter1 High Byte bit 4 RW 0 TCNT1H3 Timer/Counter1 High Byte bit 3 RW 0 TCNT1H2 Timer/Counter1 High Byte bit 2 RW 0 TCNT1H1 Timer/Counter1 High Byte bit 1 RW 0 TCNT1H0 Timer/Counter1 High Byte bit 0 RW 0 TCNT1L Timer/Counter1 Low Byte This 16-bit register contains the prescaled value of the 16-bit Timer/Counter1. To ensure that both the high and low bytes are read and written simultaneously when the CPU accesses these registers, the access is performed using an 8-bit temporary register (TEMP). This temporary register is also used when accessing OCR1A, OCR1B and ICR1. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program.<Please refer to the datasheet $2C $4C io_timer.bmp N TCNT1L7 Timer/Counter1 Low Byte bit 7 RW 0 TCNT1L6 Timer/Counter1 Low Byte bit 6 RW 0 TCNT1L5 Timer/Counter1 Low Byte bit 5 RW 0 TCNT1L4 Timer/Counter1 Low Byte bit 4 RW 0 TCNT1L3 Timer/Counter1 Low Byte bit 3 RW 0 TCNT1L2 Timer/Counter1 Low Byte bit 2 RW 0 TCNT1L1 Timer/Counter1 Low Byte bit 1 RW 0 TCNT1L0 Timer/Counter1 Low Byte bit 0 RW 0 OCR1AH Timer/Counter1 Outbut Compare Register A High Byte The output compare registers are 16-bit read/write registers. The Timer/Counter1 Output Compare Registers contain the data to be continuously compared with Timer/Counter1. Actions on compare matches are specified in the Timer/Counter1 Control and Status register.A compare match does only occur if Timer/Counter1 counts to the OCR value. A software write that sets TCNT1 and OCR1A or OCR1B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR1A and OCR1B - are 16-bit registers, a temporary register TEMP is used when OCR1A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR1AH or OCR1BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR1AL or OCR1BL, the TEMP register is simultaneously written to OCR1AH or OCR1BH. Consequently, the high byte OCR1AH or OCR1BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT1, and ICR1. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. <Please refer to the datasheet $2B $4B io_timer.bmp N OCR1AH7 Timer/Counter1 Outbut Compare Register High Byte bit 7 RW 0 OCR1AH6 Timer/Counter1 Outbut Compare Register High Byte bit 6 RW 0 OCR1AH5 Timer/Counter1 Outbut Compare Register High Byte bit 5 RW 0 OCR1AH4 Timer/Counter1 Outbut Compare Register High Byte bit 4 RW 0 OCR1AH3 Timer/Counter1 Outbut Compare Register High Byte bit 3 RW 0 OCR1AH2 Timer/Counter1 Outbut Compare Register High Byte bit 2 RW 0 OCR1AH1 Timer/Counter1 Outbut Compare Register High Byte bit 1 RW 0 OCR1AH0 Timer/Counter1 Outbut Compare Register High Byte bit 0 RW 0 OCR1AL Timer/Counter1 Output Compare Register A Low Byte The output compare registers are 16-bit read/write registers. The Timer/Counter1 Output Compare Registers contain the data to be continuously compared with Timer/Counter1. Actions on compare matches are specified in the Timer/Counter1 Control and Status register.A compare match does only occur if Timer/Counter1 counts to the OCR value. A software write that sets TCNT1 and OCR1A or OCR1B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR1A and OCR1B - are 16-bit registers, a temporary register TEMP is used when OCR1A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR1AH or OCR1BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR1AL or OCR1BL, the TEMP register is simultaneously written to OCR1AH or OCR1BH. Consequently, the high byte OCR1AH or OCR1BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT1, and ICR1. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program .<Please refer to the datashee $2A $4A io_timer.bmp N OCR1AL7 Timer/Counter1 Output Compare Register Low Byte Bit 7 RW 0 OCR1AL6 Timer/Counter1 Output Compare Register Low Byte Bit 6 RW 0 OCR1AL5 Timer/Counter1 Output Compare Register Low Byte Bit 5 RW 0 OCR1AL4 Timer/Counter1 Output Compare Register Low Byte Bit 4 RW 0 OCR1AL3 Timer/Counter1 Output Compare Register Low Byte Bit 3 RW 0 OCR1AL2 Timer/Counter1 Output Compare Register Low Byte Bit 2 RW 0 OCR1AL1 Timer/Counter1 Output Compare Register Low Byte Bit 1 RW 0 OCR1AL0 Timer/Counter1 Output Compare Register Low Byte Bit 0 RW 0 OCR1BH Timer/Counter1 Output Compare Register B High Byte The output compare registers are 16-bit read/write registers. The Timer/Counter1 Output Compare Registers contain the data to be continuously compared with Timer/Counter1. Actions on compare matches are specified in the Timer/Counter1 Control and Status register.A compare match does only occur if Timer/Counter1 counts to the OCR value. A software write that sets TCNT1 and OCR1A or OCR1B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR1A and OCR1B - are 16-bit registers, a temporary register TEMP is used when OCR1A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR1AH or OCR1BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR1AL or OCR1BL, the TEMP register is simultaneously written to OCR1AH or OCR1BH. Consequently, the high byte OCR1AH or OCR1BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT1, and ICR1. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. <Please refer to the datasheet $29 $49 io_timer.bmp N OCR1BH7 Timer/Counter1 Output Compare Register High Byte bit 7 RW 0 OCR1BH6 Timer/Counter1 Output Compare Register High Byte bit 6 RW 0 OCR1BH5 Timer/Counter1 Output Compare Register High Byte bit 5 RW 0 OCR1BH4 Timer/Counter1 Output Compare Register High Byte bit 4 RW 0 OCR1BH3 Timer/Counter1 Output Compare Register High Byte bit 3 RW 0 OCR1BH2 Timer/Counter1 Output Compare Register High Byte bit 2 RW 0 OCR1BH1 Timer/Counter1 Output Compare Register High Byte bit 1 RW 0 OCR1BH0 Timer/Counter1 Output Compare Register High Byte bit 0 RW 0 OCR1BL Timer/Counter1 Output Compare Register B Low Byte The output compare registers are 16-bit read/write registers. The Timer/Counter1 Output Compare Registers contain the data to be continuously compared with Timer/Counter1. Actions on compare matches are specified in the Timer/Counter1 Control and Status register.A compare match does only occur if Timer/Counter1 counts to the OCR value. A software write that sets TCNT1 and OCR1A or OCR1B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR1A and OCR1B - are 16-bit registers, a temporary register TEMP is used when OCR1A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR1AH or OCR1BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR1AL or OCR1BL, the TEMP register is simultaneously written to OCR1AH or OCR1BH. Consequently, the high byte OCR1AH or OCR1BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT1, and ICR1. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program.<Please refer to the datasheet $28 $48 io_timer.bmp N OCR1BL7 Timer/Counter1 Output Compare Register Low Byte bit 7 R 0 OCR1BL6 Timer/Counter1 Output Compare Register Low Byte bit 6 RW 0 OCR1BL5 Timer/Counter1 Output Compare Register Low Byte bit 5 RW 0 OCR1BL4 Timer/Counter1 Output Compare Register Low Byte bit 4 RW 0 OCR1BL3 Timer/Counter1 Output Compare Register Low Byte bit 3 RW 0 OCR1BL2 Timer/Counter1 Output Compare Register Low Byte bit 2 RW 0 OCR1BL1 Timer/Counter1 Output Compare Register Low Byte bit 1 RW 0 OCR1BL0 Timer/Counter1 Output Compare Register Low Byte bit 0 RW 0 ICR1H Timer/Counter1 Input Capture Register High Byte The input capture register is a 16-bit read-only register. When the rising or falling edge (according to the input capture edge setting - ICES1) of the signal at the input capture pin -ICP - is detected, the current value of the Timer/Counter1 is transferred to the Input Capture Register - ICR1. At the same time, the input capture flag - ICF1 - is set (one). Since the Input Capture Register - ICR1 - is a 16-bit register, a temporary register TEMP is used when ICR1 is read to ensure that both bytes are read simultaneously. When the CPU reads the low byte ICR1L, the data is sent to the CPU and the data of the high byte ICR1H is placed in the TEMP register. When the CPU reads the data in the high byte ICR1H, the CPU receives the data in the TEMP register. Consequently, the low byte ICR1L must be accessed first for a full 16-bit register read operation. The TEMP register is also used when accessing TCNT1, OCR1A and OCR1B. <Please refer to the datashee $25 $45 io_timer.bmp N ICR1H7 Timer/Counter1 Input Capture Register High Byte bit 7 RW 0 ICR1H6 Timer/Counter1 Input Capture Register High Byte bit 6 R 0 ICR1H5 Timer/Counter1 Input Capture Register High Byte bit 5 R 0 ICR1H4 Timer/Counter1 Input Capture Register High Byte bit 4 R 0 ICR1H3 Timer/Counter1 Input Capture Register High Byte bit 3 R 0 ICR1H2 Timer/Counter1 Input Capture Register High Byte bit 2 R 0 ICR1H1 Timer/Counter1 Input Capture Register High Byte bit 1 R 0 ICR1H0 Timer/Counter1 Input Capture Register High Byte bit 0 R 0 ICR1L Timer/Counter1 Input Capture Register Low Byte The input capture register is a 16-bit read-only register. When the rising or falling edge (according to the input capture edge setting - ICES1) of the signal at the input capture pin -ICP - is detected, the current value of the Timer/Counter1 is transferred to the Input Capture Register - ICR1. At the same time, the input capture flag - ICF1 - is set (one). Since the Input Capture Register - ICR1 - is a 16-bit register, a temporary register TEMP is used when ICR1 is read to ensure that both bytes are read simultaneously. When the CPU reads the low byte ICR1L, the data is sent to the CPU and the data of the high byte ICR1H is placed in the TEMP register. When the CPU reads the data in the high byte ICR1H, the CPU receives the data in the TEMP register. Consequently, the low byte ICR1L must be accessed first for a full 16-bit register read operation. The TEMP register is also used when accessing TCNT1, OCR1A and OCR1B. <Please refer to the datasheet $24 $44 io_timer.bmp N ICR1L7 Timer/Counter1 Input Capture Register Low Byte bit 7 R 0 ICR1L6 Timer/Counter1 Input Capture Register Low Byte bit 6 R 0 ICR1L5 Timer/Counter1 Input Capture Register Low Byte bit 5 R 0 ICR1L4 Timer/Counter1 Input Capture Register Low Byte bit 4 R 0 ICR1L3 Timer/Counter1 Input Capture Register Low Byte bit 3 R 0 ICR1L2 Timer/Counter1 Input Capture Register Low Byte bit 2 R 0 ICR1L1 Timer/Counter1 Input Capture Register Low Byte bit 1 R 0 ICR1L0 Timer/Counter1 Input Capture Register Low Byte bit 0 R 0 [TCCR2:TCNT2:OCR2:TIMSK:TIFR:ASSR] io_timer.bmp t8pwm1_01 TCCR2 Timer/Counter Control Register $27 $47 io_flag.bmp Y FOC2 Forde Output Compare The FOC2 bit is only active when the WGM bits specify a non-PWM mode.However,for ensuring compatibility with future devices,this bit must be set to zero when TCCR2 is written when operating in PWM mode.When writing a logical one to the FOC2 bit,an immediate compare match is forced on the waveform generation unit.The OC2 output is changed according to its COM21:0 bits setting.Note that the FOC2 bit is implemented as a strobe.Therefore it is the value present in the COM21:0 bits that determines the effect of the forced compare. W 0 WGM20 PWM2 Pulse Width Modulator Select Bit 0 These bits control the counting sequence of the counter,the source for the maximum (TOP)counter value,and what type of waveform generation to be used.Modes of oper-ation supported by the Timer/Counter unit are:Normal mode,Clear Timer on Compare match (CTC)mode,and two types of Pulse Width Modulation (PWM)modes. RW 0 COM21 Compare Match Output Mode These bits control the output compare pin (OC2) behavior. If one or both of the COM21:0 bits are set, the OC2 output over-rides the normal port functionality of the I/O pin it is connected to. However, note that the Data Direction Register (DDR) bit corresponding to OC2 pin must be set in order to enable the output driver. When OC2 is connected to the pin, the function of the COM21:0 bits depends on the WGM21:0 bit setting. Table 64 shows the COM21:0 bit functionality when the WGM21:0 bits are set to a normal or CTC mode (non-PWM RW 0 COM20 Compare Match Output Mode These bits control the output compare pin (OC2) behavior. If one or both of the COM21:0 bits are set, the OC2 output over-rides the normal port functionality of the I/O pin it is connected to. However, note that the Data Direction Register (DDR) bit corresponding to OC2 pin must be set in order to enable the output driver. When OC2 is connected to the pin, the function of the COM21:0 bits depends on the WGM21:0 bit setting. Table 64 shows the COM21:0 bit functionality when the WGM21:0 bits are set to a normal or CTC mode (non-PW RW 0 WGM21 CTC2 Pulse Width Modulator Select Bit 1 These bits control the counting sequence of the counter, the source for the maximum (TOP) counter value, and what type of waveform generation to be used. Modes of operation supported by the Timer/Counter unit are: Normal mode, Clear Timer on Compare match (CTC) mode, and two types of Pulse Width Modulation (PWM) modes. RW 0 CS22 Clock Select The three clock select bits select the clock source to be used by the Timer/Counter. RW 0 CS21 Clock Select The three clock select bits select the clock source to be used by the Timer/Counter. RW 0 CS20 Clock Select The three clock select bits select the clock source to be used by the Timer/Counter. RW 0 TCNT2 Timer/Counter Register The Timer/Counter Register gives direct access, both for read and write operations, to the Timer/Counter unit 8-bit counter. Writing to the TCNT2 register blocks (removes) the compare match on the following timer clock. Modifying the counter (TCNT2) while the counter is running, introduces a risk of missing a compare match between TCNT2 the OCR2 register. $23 $43 io_timer.bmp N TCNT2_7 Timer/Counter Register Bit 7 RW 0 TCNT2_6 Timer/Counter Register Bit 6 RW 0 TCNT2_5 Timer/Counter Register Bit 5 RW 0 TCNT2_4 Timer/Counter Register Bit 4 RW 0 TCNT2_3 Timer/Counter Register Bit 3 RW 0 TCNT2_2 Timer/Counter Register Bit 2 RW 0 TCNT2_1 Timer/Counter Register Bit 1 RW 0 TCNT2_0 Timer/Counter Register Bit 0 RW 0 OCR2 Output Compare Register The Output Compare Register contains an 8-bit value that is continuously compared with the counter value (TCNT2). A match can be used to generate an output compare interrupt, or to generate a waveform output on the OC2 pin. $22 $42 io_timer.bmp N OCR2_7 Output Compare Register Bit 7 RW 0 OCR2_6 Output Compare Register Bit 6 RW 0 OCR2_5 Output Compare Register Bit 5 RW 0 OCR2_4 Output Compare Register Bit 4 RW 0 OCR2_3 Output Compare Register Bit 3 RW 0 OCR2_2 Output Compare Register Bit 2 RW 0 OCR2_1 Output Compare Register Bit 1 RW 0 OCR2_0 Output Compare Register Bit 0 RW 0 TIMSK Timer/Counter Interrupt Mask Register $39 $59 io_flag.bmp Y OCIE2 Timer/Counter2 Output Compare Match Interrupt Enable When the OCIE2 bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter2 Compare Match inter-rupt is enabled. The corresponding interrupt (at vector $003) is executed if a compare match in Timer/Counter2 occurs (i.e., when the OCF2 bit is set in the Timer/Counter Interrupt Flag Register [TIFR]). RW 0 TOIE2 Timer/Counter2 Overflow Interrupt Enable When the TOIE2 bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter2 Overflow interrupt is enabled. The corresponding interrupt (at vector $004) is executed if an overflow in Timer/Counter2 occurs (i.e., when the TOV2 bit is set in the Timer/Counter Interrupt Flag Register [TIFR]). RW 0 TIFR Timer/Counter Interrupt Flag Register $38 $58 io_flag.bmp Y OCF2 Output Compare Flag 2 The OCF2 bit is set (one)when a compare match occurs between the Timer/Counter2 and the data in OCR2 -Output Compare Register2.OCF2 is cleared by hardware when executing the corresponding interrupt handling vector.Alternatively,OCF2 is cleared by writing a logic one to the flag.When the I-bit in SREG,OCIE2 (Timer/Counter2 Compare match Interrupt Enable),and OCF2 are set (one),the Timer/Counter2 Compare match Interrupt is executed. RW 0 TOV2 Timer/Counter2 Overflow Flag The TOV2 bit is set (one)when an overflow occurs in Timer/Counter2.TOV2 is cleared by hardware when executing the corresponding interrupt handling vector.Alternatively, TOV2 is cleared by writing a logic one to the flag.When the SREG I-bit,TOIE2 (Timer/Counter2 Overflow Interrupt Enable),and TOV2 are set (one),the Timer/Counter2 Overflow interrupt is executed.In PWM mode,this bit is set when Timer/Counter2 changes counting direction at $00. RW 0 ASSR Asynchronous Status Register $26 $46 io_flag.bmp Y AS2 Asynchronous Timer 2 When AS2 is set (one), Timer/Counter2 is clocked from the TOSC1 pin. Pins PC6 and PC7 become connected to a crystal oscillator and cannot be used as general I/O pins. When cleared (zero), Timer/Counter2 is clocked from the internal system clock, CK. When the value of this bit is changed, the contents of TCNT2, OCR2 and TCCR2 might get corrupted. RW 0 TCN2UB Timer/Counter2 Update Busy When Timer/Counter2 operates asynchronously and TCNT2 is written, this bit becomes set (one). When TCNT2 has been updated from the temporary storage register, this bit is cleared (zero) by hardware. A logical “0” in this bit indicates that TCNT2 is ready to be updated with a new value. RW 0 OCR2UB Output Compare Register2 Update Busy When Timer/Counter2 operates asynchronously and OCR2 is written, this bit becomes set (one). When OCR2 has been updated from the temporary storage register, this bit is cleared (zero) by hardware. A logical “0” in this bit indicates that OCR2 is ready to be updated with a new value. RW 0 TCR2UB Timer/Counter Control Register2 Update Busy When Timer/Counter2 operates asynchronously and TCCR2 is written, this bit becomes set (one). When TCCR2 has been updated from the temporary storage register, this bit is cleared (zero) by hardware. A logical “0” in this bit indicates that TCCR2 is ready to be updated with a new value. If a write is performed to any of the three Timer/Counter2 registers while its Update Busy flag is set (one), the updated value might get corrupted and cause an unintentional interrupt to occur. The mechanisms for reading TCNT2, OCR2 and TCCR2 are different. When reading TCNT2, the actual timer value is read. When reading OCR2 or TCCR2, the value in the temporary storage register is rea RW 0 [ETIMSK:ETIFR:TCCR3A:TCCR3B:TCNT3H:TCNT3L:OCR3AH:OCR3AL:OCR3BH:OCR3BL:ICR3H:ICR3L] [TCNT3H:TCNT3L];[OCR3AH:OCR3AL];[OCR3BH:OCR3BL];[ICR3H:ICR3L] io_timer.bmp t16pwm3_01.xml The 16-bit Timer/Counter3 can select clock source from CK, prescaled CK, or an external pin. In addition it can be stopped as described in the specification for the Timer/Counter3 Control Registers - TCCR3A and TCCR3B. The different status flags (overflow, compare match and capture event) are found in the Extended Timer/Counter Interrupt Flag Register - ETIFR. Control signals are found in the Timer/Counter3 Control Registers - TCCR3A and TCCR3B. The interrupt enable/disable settings for Timer/Counter3 are found in the Exteded Timer/Counter Interrupt Mask Register - ETIMSK. ETIMSK Extended Timer/Counter Interrupt Mask Register NA $7D io_flag.bmp Y TICIE3 Timer/Counter3 Input Capture Interrupt Enable When the TICIE3 bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter1 Input Capture Event Interrupt is enabled. The corresponding interrupt (at vector $003) is executed if a capture-triggering event occurs on pin 31, ICP, i.e., when the ICF3 bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 OCIE3A Timer/Counter3 Output CompareA Match Interrupt Enable When the OCIE1A bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter1 CompareA Match interrupt is enabled. The corresponding interrupt (at vector $004) is executed if a CompareA match in Timer/Counter1 occurs, i.e., when the OCF3A bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 OCIE3B Timer/Counter3 Output CompareB Match Interrupt Enable When the OCIE3B bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter3 CompareB Match interrupt is enabled. The corresponding interrupt (at vector $005) is executed if a CompareB match in Timer/Counter3 occurs, i.e., when the OCF1B bit is set in the Timer/Counter Interrupt Flag Register - TIFR. R 0 TOIE3 Timer/Counter3 Overflow Interrupt Enable When the TOIE3 bit is set (one) and the I-bit in the Status Register is set (one), the Timer/Counter3 Overflow interrupt is enabled. The corresponding interrupt (at vector $006) is executed if an overflow in Timer/Counter3 occurs, i.e., when the TOV1 bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 ETIFR Extended Timer/Counter Interrupt Flag register NA $7C io_flag.bmp Y ICF3 Input Capture Flag 3 The ICF3 bit is set (one) to flag an input capture event, indicating that the Timer/Counter3 value has been transferred to the input capture register - ICR1. ICF3 is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, ICF3 is cleared by writing a logic one to the flag. When the SREG I-bit, and TICIE3 (Timer/Counter3 Input Capture Interrupt Enable), and ICF3 are set (one), the Timer/Counter3 Capture Interrupt is executed. RW 0 OCF3A Output Compare Flag 3A The OCF3A bit is set (one) when compare match occurs between the Timer/Counter3 and the data in OCR1A - Output Compare Register 1A. OCF3A is cleared by hardware when executing the corresponding interrupt handling vector. Alterna-tively, OCF3A is cleared by writing a logic one to the flag. When the I-bit in SREG, and OCIE1A (Timer/Counter3 Compare match InterruptA Enable), and the OCF3A are set (one), the Timer/Counter3 Compare A match Interrupt is executed. RW 0 OCF3B Output Compare Flag 3B The OCF1B bit is set (one) when compare match occurs between the Timer/Counter3 and the data in OCR1B - Output Compare Register 1B. OCF1B is cleared by hardware when executing the corresponding interrupt handling vector. Alterna-tively, OCF1B is cleared by writing a logic one to the flag. When the I-bit in SREG, and OCIE3B (Timer/Counter3 Compare match InterruptB Enable), and the OCF1B are set (one), the Timer/Counter3 Compare B match Interrupt is executed. RW 0 TOV3 Timer/Counter3 Overflow Flag The TOV3 is set (one) when an overflow occurs in Timer/Counter3. TOV3 is cleared by hardware when executing the cor-responding interrupt handling vector. Alternatively, TOV3 is cleared by writing a logic one to the flag. When the I-bit in SREG, and TOIE3 (Timer/Counter3 Overflow Interrupt Enable), and TOV3 are set (one), the Timer/Counter3 Overflow Interrupt is executed. In PWM mode, this bit is set when Timer/Counter3 changes counting direction at $0000. RW 0 TCCR3A Timer/Counter3 Control Register A NA $8B io_flag.bmp Y COM3A1 Compare Output Mode 3A, bit 1 The COM3A1 and COM3A0 control bits determine any output pin action following a compare match in Timer/Counter3. Any output pin actions affect pin OC3A - Output CompareA pin 1. This is an alternative function to an I/O port and the corresponding direction control bit must be set (one) to control the output pin. RW 0 COM3A0 Compare Ouput Mode 3A, bit 0 The COM3A1 and COM3A0 control bits determine any output pin action following a compare match in Timer/Counter3. Any output pin actions affect pin OC3A - Output CompareA pin 1. This is an alternative function to an I/O port and the corresponding direction control bit must be set (one) to control the output pin. RW 0 COM3B1 Compare Output Mode 3B, bit 1 The COM3B1 and COM3B0 control bits determine any output pin action following a compare match in Timer/Counter3. Any output pin actions affect pin OC3B - Output CompareB. RW 0 COM3B0 Compare Output Mode 3B, bit 0 The COM3B1 and COM3B0 control bits determine any output pin action following a compare match in Timer/Counter3. Any output pin actions affect pin OC3B - Output CompareB. RW 0 FOC3A Force Output Compare for Channel A The FOC3A/FOC3B bits are only active when the WGM33:0 bits specifies a non-PWM mode.However,for ensuring compatibility with future devices,these bits must be set to zero when TCCR3A is written when operating in a PWM mode.When writing a logical one to the FOC3A/FOC3B bit,an immediate compare match is forced on the waveform generation unit.The OC3A/OC3B output is changed according to its COM3x1:0 bits setting.Note that the FOC3A/FOC3B bits are implemented as strobes.Therefore it is the value present in the COM3x1:0 bits that determine the effect of the forced compare. A FOC3A/FOC3B strobe will not generate any interrupt nor will it clear the timer in clear timer on compare match (CTC)mode using OCR3A as TOP. The FOC3A/FOC3Bbits are always read as zero W 0 FOC3B Force Output Compare for Channel B The FOC3A/FOC3B bits are only active when the WGM33:0 bits specifies a non-PWM mode.However,for ensuring compatibility with future devices,these bits must be set to zero when TCCR3A is written when operating in a PWM mode.When writing a logical one to the FOC3A/FOC3B bit,an immediate compare match is forced on the waveform generation unit.The OC3A/OC3B output is changed according to its COM3x1:0 bits setting.Note that the FOC3A/FOC3B bits are implemented as strobes.Therefore it is the value present in the COM3x1:0 bits that determine the effect of the forced compare. A FOC3A/FOC3B strobe will not generate any interrupt nor will it clear the timer in clear timer on compare match (CTC)mode using OCR3A as TOP. The FOC3A/FOC3Bbits are always read as ze W 0 WGM31 Pulse Width Modulator Select Bit 1 Combined with the WGM33:2 bits found in the TCCR1B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 WGM30 Pulse Width Modulator Select Bit 0 Combined with the WGM33:2 bits found in the TCCR1B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 TCCR3B Timer/Counter3 Control Register B NA $8A io_flag.bmp Y ICNC3 Input Capture 3 Noise Canceler When the ICNC3 bit is cleared (zero), the input capture trigger noise canceler function is disabled. The input capture is triggered at the first rising/falling edge sampled on the ICP - input capture pin - as specified. When the ICNC3 bit is set (one), four successive samples are measures on the ICP - input capture pin, and all samples must be high/low according to the input capture trigger specification in the ICES3 bit. The actual sampling frequency is XTAL clock frequency. RW 0 ICES3 Input Capture 3 Edge Select While the ICES3 bit is cleared (zero), the Timer/Counter3 contents are transferred to the Input Capture Register - ICR3 - on the falling edge of the input capture pin - ICP. While the ICES3 bit is set (one), the Timer/Counter3 contents are transferred to the Input Capture Register - ICR3 - on the rising edge of the input capture pin - ICP. RW 0 WGM33 Pulse Width Modulator Select Bit 3 Combined with the WGM31:0 bits found in the TCCR3B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 WGM32 Pulse Width Modulator Select Bit 2 Combined with the WGM31:0 bits found in the TCCR3B register,these bits control the counting sequence of the counter,the source for maximum (TOP)counter value,and what type of waveform generation to be used.Modes of operation supported by the Timer/Counter unit are:Normal mode (counter),Clear Timer on Compare match (CTC)mode,and three types of Pulse Width Modulation (PWM)modes. RW 0 CS32 Clock Select3 bit 2 RW 0 CS31 Clock Select3 bit 1 RW 0 CS30 Clock Select3 bit 0 RW 0 TCNT3H Timer/Counter3 High Byte This 16-bit register contains the prescaled value of the 16-bit Timer/Counter3. To ensure that both the high and low bytes are read and written simultaneously when the CPU accesses these registers, the access is performed using an 8-bit temporary register (TEMP). This temporary register is also used when accessing OCR3A, OCR3B and ICR3. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. NA $89 io_timer.bmp N TCNT3H7 Timer/Counter3 High Byte bit 7 RW 0 TCNT3H6 Timer/Counter3 High Byte bit 6 RW 0 TCNT3H5 Timer/Counter3 High Byte bit 5 RW 0 TCNT3H4 Timer/Counter3 High Byte bit 4 RW 0 TCNT3H3 Timer/Counter3 High Byte bit 3 RW 0 TCNT3H2 Timer/Counter3 High Byte bit 2 RW 0 TCNT3H1 Timer/Counter3 High Byte bit 1 RW 0 TCNT3H0 Timer/Counter3 High Byte bit 0 RW 0 TCNT3L Timer/Counter3 Low Byte This 16-bit register contains the prescaled value of the 16-bit Timer/Counter3. To ensure that both the high and low bytes are read and written simultaneously when the CPU accesses these registers, the access is performed using an 8-bit temporary register (TEMP). This temporary register is also used when accessing OCR3A, OCR3B and ICR3. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. NA $88 io_timer.bmp N TCNT3L7 Timer/Counter3 Low Byte bit 7 RW 0 TCNT3L6 Timer/Counter3 Low Byte bit 6 RW 0 TCNT3L5 Timer/Counter3 Low Byte bit 5 RW 0 TCNT3L4 Timer/Counter3 Low Byte bit 4 RW 0 TCNT3L3 Timer/Counter3 Low Byte bit 3 RW 0 TCNT3L2 Timer/Counter3 Low Byte bit 2 RW 0 TCNT3L1 Timer/Counter3 Low Byte bit 1 RW 0 TCNT3L0 Timer/Counter3 Low Byte bit 0 RW 0 OCR3AH Timer/Counter3 Outbut Compare Register A High Byte The output compare registers are 16-bit read/write registers. The Timer/Counter3 Output Compare Registers contain the data to be continuously compared with Timer/Counter3. Actions on compare matches are specified in the Timer/Counter3 Control and Status register.A compare match does only occur if Timer/Counter3 counts to the OCR value. A software write that sets TCNT3 and OCR3A or OCR3B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR3A and OCR3B - are 16-bit registers, a temporary register TEMP is used when OCR3A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR3AH or OCR3BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR3AL or OCR3BL, the TEMP register is simultaneously written to OCR3AH or OCR3BH. Consequently, the high byte OCR3AH or OCR3BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT3, and ICR3. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. NA $87 io_timer.bmp N OCR3AH7 Timer/Counter3 Outbut Compare Register High Byte bit 7 RW 0 OCR3AH6 Timer/Counter3 Outbut Compare Register High Byte bit 6 RW 0 OCR3AH5 Timer/Counter3 Outbut Compare Register High Byte bit 5 RW 0 OCR3AH4 Timer/Counter3 Outbut Compare Register High Byte bit 4 RW 0 OCR3AH3 Timer/Counter3 Outbut Compare Register High Byte bit 3 RW 0 OCR3AH2 Timer/Counter3 Outbut Compare Register High Byte bit 2 RW 0 OCR3AH1 Timer/Counter3 Outbut Compare Register High Byte bit 1 RW 0 OCR3AH0 Timer/Counter3 Outbut Compare Register High Byte bit 0 RW 0 OCR3AL Timer/Counter3 Output Compare Register A Low Byte The output compare registers are 16-bit read/write registers. The Timer/Counter3 Output Compare Registers contain the data to be continuously compared with Timer/Counter3. Actions on compare matches are specified in the Timer/Counter3 Control and Status register.A compare match does only occur if Timer/Counter3 counts to the OCR value. A software write that sets TCNT3 and OCR3A or OCR3B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR3A and OCR3B - are 16-bit registers, a temporary register TEMP is used when OCR3A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR3AH or OCR3BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR3AL or OCR3BL, the TEMP register is simultaneously written to OCR3AH or OCR3BH. Consequently, the high byte OCR3AH or OCR3BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT3, and ICR3. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. NA $86 io_timer.bmp N OCR3AL7 Timer/Counter3 Output Compare Register Low Byte Bit 7 RW 0 OCR3AL6 Timer/Counter3 Output Compare Register Low Byte Bit 6 RW 0 OCR3AL5 Timer/Counter3 Output Compare Register Low Byte Bit 5 RW 0 OCR3AL4 Timer/Counter3 Output Compare Register Low Byte Bit 4 RW 0 OCR3AL3 Timer/Counter3 Output Compare Register Low Byte Bit 3 RW 0 OCR3AL2 Timer/Counter3 Output Compare Register Low Byte Bit 2 RW 0 OCR3AL1 Timer/Counter3 Output Compare Register Low Byte Bit 1 RW 0 OCR3AL0 Timer/Counter3 Output Compare Register Low Byte Bit 0 RW 0 OCR3BH Timer/Counte3 Output Compare Register B High Byte The output compare registers are 16-bit read/write registers. The Timer/Counter3 Output Compare Registers contain the data to be continuously compared with Timer/Counter3. Actions on compare matches are specified in the Timer/Counter3 Control and Status register.A compare match does only occur if Timer/Counter3 counts to the OCR value. A software write that sets TCNT3 and OCR3A or OCR3B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR3A and OCR3B - are 16-bit registers, a temporary register TEMP is used when OCR3A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR3AH or OCR3BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR3AL or OCR3BL, the TEMP register is simultaneously written to OCR3AH or OCR3BH. Consequently, the high byte OCR3AH or OCR3BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT3, and ICR3. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. NA $85 io_timer.bmp N OCR3BH7 Timer/Counter3 Output Compare Register High Byte bit 7 RW 0 OCR3BH6 Timer/Counter3 Output Compare Register High Byte bit 6 RW 0 OCR3BH5 Timer/Counter3 Output Compare Register High Byte bit 5 RW 0 OCR3BH4 Timer/Counter3 Output Compare Register High Byte bit 4 RW 0 OCR3BH3 Timer/Counter3 Output Compare Register High Byte bit 3 RW 0 OCR3BH2 Timer/Counter3 Output Compare Register High Byte bit 2 RW 0 OCR3BH1 Timer/Counter3 Output Compare Register High Byte bit 1 RW 0 OCR3BH0 Timer/Counter3 Output Compare Register High Byte bit 0 RW 0 OCR3BL Timer/Counter3 Output Compare Register Low Byte The output compare registers are 16-bit read/write registers. The Timer/Counter3 Output Compare Registers contain the data to be continuously compared with Timer/Counter3. Actions on compare matches are specified in the Timer/Counter3 Control and Status register.A compare match does only occur if Timer/Counter3 counts to the OCR value. A software write that sets TCNT3 and OCR3A or OCR3B to the same value does not generate a compare match. A compare match will set the compare interrupt flag in the CPU clock cycle following the compare event. Since the Output Compare Registers - OCR3A and OCR3B - are 16-bit registers, a temporary register TEMP is used when OCR3A/B are written to ensure that both bytes are updated simultaneously. When the CPU writes the high byte, OCR3AH or OCR3BH, the data is temporarily stored in the TEMP register. When the CPU writes the low byte, OCR3AL or OCR3BL, the TEMP register is simultaneously written to OCR3AH or OCR3BH. Consequently, the high byte OCR3AH or OCR3BH must be written first for a full 16-bit register write operation. The TEMP register is also used when accessing TCNT3, and ICR3. If the main program and also interrupt routines perform access to registers using TEMP, interrupts must be disabled during access from the main program. NA $84 io_timer.bmp N OCR3BL7 Timer/Counter3 Output Compare Register Low Byte bit 7 R 0 OCR3BL6 Timer/Counter3 Output Compare Register Low Byte bit 6 RW 0 OCR3BL5 Timer/Counter3 Output Compare Register Low Byte bit 5 RW 0 OCR3BL4 Timer/Counter3 Output Compare Register Low Byte bit 4 RW 0 OCR3BL3 Timer/Counter3 Output Compare Register Low Byte bit 3 RW 0 OCR3BL2 Timer/Counter3 Output Compare Register Low Byte bit 2 RW 0 OCR3BL1 Timer/Counter3 Output Compare Register Low Byte bit 1 RW 0 OCR3BL0 Timer/Counter3 Output Compare Register Low Byte bit 0 RW 0 ICR3H Timer/Counter3 Input Capture Register High Byte The input capture register is a 16-bit read-only register. When the rising or falling edge (according to the input capture edge setting - ICES3) of the signal at the input capture pin -ICP - is detected, the current value of the Timer/Counter3 is transferred to the Input Capture Register - ICR3. At the same time, the input capture flag - ICF3 - is set (one). Since the Input Capture Register - ICR3 - is a 16-bit register, a temporary register TEMP is used when ICR3 is read to ensure that both bytes are read simultaneously. When the CPU reads the low byte ICR3L, the data is sent to the CPU and the data of the high byte ICR3H is placed in the TEMP register. When the CPU reads the data in the high byte ICR3H, the CPU receives the data in the TEMP register. Consequently, the low byte ICR3L must be accessed first for a full 16-bit register read operation. The TEMP register is also used when accessing TCNT3, OCR3A and OCR3B. NA $81 io_timer.bmp N ICR3H7 Timer/Counter3 Input Capture Register High Byte bit 7 RW 0 ICR3H6 Timer/Counter3 Input Capture Register High Byte bit 6 R 0 ICR3H5 Timer/Counter3 Input Capture Register High Byte bit 5 R 0 ICR3H4 Timer/Counter3 Input Capture Register High Byte bit 4 R 0 ICR3H3 Timer/Counter3 Input Capture Register High Byte bit 3 R 0 ICR3H2 Timer/Counter3 Input Capture Register High Byte bit 2 R 0 ICR3H1 Timer/Counter3 Input Capture Register High Byte bit 1 R 0 ICR3H0 Timer/Counter3 Input Capture Register High Byte bit 0 R 0 ICR3L Timer/Counter3 Input Capture Register Low Byte The input capture register is a 16-bit read-only register. When the rising or falling edge (according to the input capture edge setting - ICES3) of the signal at the input capture pin -ICP - is detected, the current value of the Timer/Counter3 is transferred to the Input Capture Register - ICR3. At the same time, the input capture flag - ICF3 - is set (one). Since the Input Capture Register - ICR3 - is a 16-bit register, a temporary register TEMP is used when ICR3 is read to ensure that both bytes are read simultaneously. When the CPU reads the low byte ICR3L, the data is sent to the CPU and the data of the high byte ICR3H is placed in the TEMP register. When the CPU reads the data in the high byte ICR3H, the CPU receives the data in the TEMP register. Consequently, the low byte ICR3L must be accessed first for a full 16-bit register read operation. The TEMP register is also used when accessing TCNT3, OCR3A and OCR3B. NA $80 io_timer.bmp N ICR3L7 Timer/Counter3 Input Capture Register Low Byte bit 7 R 0 ICR3L6 Timer/Counter3 Input Capture Register Low Byte bit 6 R 0 ICR3L5 Timer/Counter3 Input Capture Register Low Byte bit 5 R 0 ICR3L4 Timer/Counter3 Input Capture Register Low Byte bit 4 R 0 ICR3L3 Timer/Counter3 Input Capture Register Low Byte bit 3 R 0 ICR3L2 Timer/Counter3 Input Capture Register Low Byte bit 2 R 0 ICR3L1 Timer/Counter3 Input Capture Register Low Byte bit 1 R 0 ICR3L0 Timer/Counter3 Input Capture Register Low Byte bit 0 R 0 [ACSR] io_analo.bmp AlgComp_01 ACSR Analog Comparator Control And Status Register $08 $28 io_analo.bmp Y ACD Analog Comparator Disable When this bit is written logic one, the power to the analog comparator is switched off. This bit can be set at any time to turn off the analog comparator. This will reduce power consumption in active and idle mode. When changing the ACD bit, the Analog Comparator Interrupt must be disabled by clearing the ACIE bit in ACSR. Otherwise an interrupt can occur when the bit is changed. RW 0 ACBG AINBG Analog Comparator Bandgap Select When this bit is set, a fixed bandgap reference voltage replaces the positive input to the Analog Comparator. When this bit is cleared, AIN0 is applied to the positive input of the Analog Comparator. See “Internal Voltage Reference” on page 42. RW 0 ACO Analog Compare Output The output of the analog comparator is synchronized and then directly connected to ACO. The synchronization introduces a delay of 1-2 clock cycles. R NA ACI Analog Comparator Interrupt Flag This bit is set by hardware when a comparator output event triggers the interrupt mode defined by ACIS1 and ACIS0. The Analog Comparator Interrupt routine is executed if the ACIE bit is set and the I-bit in SREG is set. ACI is cleared by hard-ware when executing the corresponding interrupt handling vector. Alternatively, ACI is cleared by writing a logic one to the flag. RW 0 ACIE Analog Comparator Interrupt Enable When the ACIE bit is written logic one and the I-bit in the Status Register is set, the analog comparator interrupt is acti-vated. When written logic zero, the interrupt is disabled. RW 0 ACIC Analog Comparator Input Capture Enable When written logic one, this bit enables the Input Capture function in Timer/Counter1 to be triggered by the analog comparator. The comparator output is in this case directly connected to the Input Capture front-end logic, making the comparator utilize the noise canceler and edge select features of the Timer/Counter1 Input Capture interrupt. When written logic zero, no connection between the analog comparator and the Input Capture function exists. To make the comparator trigger the Timer/Counter1 Input Capture interrupt, the TICIE1 bit in the Timer Interrupt Mask Register (TIMSK) must be set RW 0 ACIS1 Analog Comparator Interrupt Mode Select bit 1 These bits determine which comparator events that trigger the Analog Comparator interrupt. RW 0 ACIS0 Analog Comparator Interrupt Mode Select bit 0 These bits determine which comparator events that trigger the Analog Comparator interrupt. RW 0 [UDR0:UCSR0A:UCSR0B:UCSR0C:UBRR0H:UBRR0L] [UBRR0H:UBRR0L] io_com.bmp The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. The main features are: • Full Duplex Operation (Independent Serial Receive and Transmit Registers) • Asynchronous or Synchronous Operation • Master or Slave Clocked Synchronous Operation • High Resolution Baud Rate Generator • Supports Serial Frames with 5, 6, 7, 8 or 9 Data Bits and 1 or 2 Stop Bits • Odd or Even Parity Generation and Parity Check Supported by Hardware • Data OverRun Detection • Framing Error Detection • Noise Filtering Includes False Start Bit Detection and Digital Low Pass Filter • Three Separate Interrupts on TX Complete, TX Data Register Empty and RX Complete • Multi-processor Communication Mode • Double Speed Asynchronous Communica UDR0 UDR USART I/O Data Register The UDR0 register is actually two physically separate registers sharing the same I/O address. When writing to the register, the USART Transmit Data register is written. When reading from UDR0, the USART Receive Data register is read. $0C $2C io_com.bmp N UDR0-7 USART I/O Data Register bit 7 RW 0 UDR0-6 USART I/O Data Register bit 6 RW 0 UDR0-5 USART I/O Data Register bit 5 RW 0 UDR0-4 USART I/O Data Register bit 4 RW 0 UDR0-3 USART I/O Data Register bit 3 RW 0 UDR0-2 USART I/O Data Register bit 2 RW 0 UDR0-1 USART I/O Data Register bit 1 RW 0 UDR0-0 USART I/O Data Register bit 0 RW 0 UCSR0A USR USART Control and Status Register A $0B $2B io_flag.bmp Y RXC0 RXC USART Receive Complete This bit is set (one) when a received character is transferred from the Receiver Shift register to UDR0. The bit is set regard-less of any detected framing errors. When the RXCIE bit in UCR is set, the USART Receive Complete interrupt will be executed when RXC is set(one). RXC is cleared by reading UDR0. When interrupt-driven data reception is used, the USART Receive Complete Interrupt routine must read UDRin order to clear RXC, otherwise a new interrupt will occur once the interrupt routine terminates. R 0 TXC0 TXC USART Transmitt Complete This bit is set (one) when the entire character (including the stop bit) in the Transmit Shift register has been shifted out and no new data has been written to UDR0. This flag is especially useful in half-duplex communications interfaces, where a transmitting application must enter receive mode and free the communications bus immediately after completing the transmission. When the TXCIE bit in UCR is set, setting of TXC causes the USART Transmit Complete interrupt to be executed. TXC is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, the TXC bit is cleared (zero) by writing a logical one to the b RW 0 UDRE0 UDRE USART Data Register Empty This bit is set (one) when a character written to UDRis transferred to the Transmit shift register. Setting of this bit indicates that the transmitter is ready to receive a new character for transmission. When the UDR0IE bit in UCR is set, the USART Transmit Complete interrupt to be executed as long as UDR0E is set. UDR0E is cleared by writing UDR0. When interrupt-driven data transmittal is used, the USART Data Register Empty Interrupt routine must write UDRin order to clear UDR0E, otherwise a new interrupt will occur once the interrupt routine terminates. UDR0E is set (one) during reset to indicate that the transmitter is re R 1 FE0 FE Framing Error This bit is set if a Framing Error condition is detected, i.e. when the stop bit of an incoming character is zero. The FE bit is cleared when the stop bit of received data is one. R 0 DOR0 DOR Data overRun This bit is set if an Overrun condition is detected, i.e. when a character already present in the UDRregister is not read before the next character has been shifted into the Receiver Shift register. The OR bit is buffered, which means that it will be set once the valid data still in UDR0E is read. The OR bit is cleared (zero) when data is received and transferred to UDR0. R 0 UPE0 Parity Error This bit is set if the next character in the receive buffer had a Parity Error when received and the parity checking was enabled at that point (UPM1 = 1). This bit is valid until the receive buffer (UDR0) is read. Always set this bit to zero when writing to UCSR0A. R 0 U2X0 U2X Double the USART transmission speed This bit only has effect for the asynchronous operation. Write this bit to zero when using synchronous operation. Writing this bit to one will reduce the divisor of the baud rate divider from 16 to 8 effectively doubling the transfer rate for asynchronous communication. RW 0 MPCM0 Multi-processor Communication Mode This bit enables the Multi-processor Communication Mode. When the MPCM bit is written to one, all the incoming frames received by the USART receiver that do not contain address information will be ignored. The transmitter is unaffected by the MPCM setting. For more detailed information see “Multi-processor Communication Mode” on page 152. RW 0 UCSR0B UCR USART Control and Status Register B $0A $2A io_flag.bmp Y RXCIE0 RXCIE RX Complete Interrupt Enable Writing this bit to one enables interrupt on the RXC flag. A USART Receive Complete interrupt will be generated only if the RXCIE bit is written to one, the global interrupt flag in SREG is written to one and the RXC bit in UCSR0A is set. RW 0 TXCIE0 TXCIE TX Complete Interrupt Enable Writing this bit to one enables interrupt on the TXC flag. A USART Transmit Complete interrupt will be generated only if the TXCIE bit is written to one, the global interrupt flag in SREG is written to one and the TXC bit in UCSR0A is set. RW 0 UDRIE0 UDRIE USART Data register Empty Interrupt Enable Writing this bit to one enables interrupt on the UDR0E flag. A Data Register Empty interrupt will be generated only if the UDR0IE bit is written to one, the global interrupt flag in SREG is written to one and the UDR0E bit in UCSR0A is set. RW 1 RXEN0 RXEN Receiver Enable Writing this bit to one enables the USART receiver. The receiver will override normal port operation for the RxD pin when enabled. Disabling the receiver will flush the receive buffer invalidating the FE, DOR and PE flags. RW 0 TXEN0 TXEN Transmitter Enable Writing this bit to one enables the USART transmitter. The transmitter will override normal port operation for the TxD pin when enabled. The disabling of the transmitter (writing TXEN to zero) will not become effective until ongoing and pending transmissions are completed, i.e. when the transmit shift register and transmit buffer register does not contain data to be transmitted. When disabled, the transmitter will no longer override the TxD port. RW 0 UCSZ02 UCSZ2 Character Size The UCSZ2 bits combined with the UCSZ1:0 bit in UCSR0C sets the number of data bits (character size) in a frame the receiver and transmitter use. RW 0 RXB80 RXB8 Receive Data Bit 8 RXB8 is the 9th data bit of the received character when operating with serial frames with 9 data bits. Must be read before reading the low bits from UDR0. R 0 TXB80 TXB8 Transmit Data Bit 8 TXB8 is the 9th data bit in the character to be transmitted when operating with serial frames with 9 data bits. Must be writ-ten before writing the low bits to UDR0. W 0 UCSR0C UBRRHI USART Control and Status Register C $20 $40 io_flag.bmp Y URSEL0 Register Select This bit selects between accessing the UCSRC or the UBRRH register.It is read as one when reading UCSRC.The URSEL must be one when writing the UCSRC. RW 0 UMSEL0 USART Mode Select 0: Asynchronous Operation. 1: Synchronous Operation RW 0 UPM01 Parity Mode Bit 1 This bit enable and set type of parity generation and check. If enabled, the transmitter will automatically generate and send the parity of the transmitted data bits within each frame. The receiver will generate a parity value for the incoming data and compare it to the UPM0 setting. If a mismatch is detected, the PE flag in UCSR0A will be set. RW 0 UPM00 Parity Mode Bit 0 This bit enable and set type of parity generation and check. If enabled, the transmitter will automatically generate and send the parity of the transmitted data bits within each frame. The receiver will generate a parity value for the incoming data and compare it to the UPM0 setting. If a mismatch is detected, the PE flag in UCSR0A will be set. RW 0 USBS0 Stop Bit Select 0: 1-bit. 1: 2-bit. RW 0 UCSZ01 Character Size Character Size: 0 0 0 = 5-bit. 0 0 1 = 6-bit. 0 1 0 = 7 bit. 0 1 1 = 8-bit. 1 1 1 = 9 bit. RW 0 UCSZ00 Character Size Character Size: 0 0 0 = 5-bit. 0 0 1 = 6-bit. 0 1 0 = 7 bit. 0 1 1 = 8-bit. 1 1 1 = 9 bit. RW 1 UCPOL0 Clock Polarity This bit is used for synchronous mode only. Write this bit to zero when asynchronous mode is used. The UCPOL bit sets the relationship between data output change and data input sample, and the synchronous clock (XCK). RW 0 UBRR0H USART Baud Rate Register Hight Byte This is a 12-bit register which contains the USART baud rate. The UBRR0H contains the 4 most significant bits, and the UBRR0L contains the 8 least significant bits of the USART baud rate. Ongoing transmissions by the transmitter and receiver will be corrupted if the baud rate is changed. Writing UBRR0L will trigger an immediate update of the baud rate prescaler. $20 $40 io_com.bmp N URSEL Register Select This bit selects between accessing the UCSRC or the UBRRH register.It is read as one when reading UCSRC.The URSEL must be one when writing the UCSRC. RW 0 UBRR11 USART Baud Rate Register bit 11 RW 0 UBRR10 USART Baud Rate Register bit 10 RW 0 UBRR9 USART Baud Rate Register bit 9 RW 0 UBRR8 USART Baud Rate Register bit 8 RW 0 UBRR0L UBRR0 UBRR USART Baud Rate Register Low Byte This is a 12-bit register which contains the USART baud rate. The UBRR0H contains the 4 most significant bits, and the UBRR0L contains the 8 least significant bits of the USART baud rate. Ongoing transmissions by the transmitter and receiver will be corrupted if the baud rate is changed. Writing UBRR0L will trigger an immediate update of the baud rate prescaler. $09 $29 io_com.bmp N UBRR7 USART Baud Rate Register bit 7 RW 0 UBRR6 USART Baud Rate Register bit 6 RW 0 UBRR5 USART Baud Rate Register bit 5 RW 0 UBRR4 USART Baud Rate Register bit 4 RW 0 UBRR3 USART Baud Rate Register bit 3 RW 0 UBRR2 USART Baud Rate Register bit 2 RW 0 UBRR1 USART Baud Rate Register bit 1 RW 0 UBRR0 USART Baud Rate Register bit 0 RW 0 [UDR1:UCSR1A:UCSR1B:UCSR1C:UBRR1H:UBRR1L] [UBRR1H:UBRR1L] io_com.bmp The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. The main features are: • Full Duplex Operation (Independent Serial Receive and Transmit Registers) • Asynchronous or Synchronous Operation • Master or Slave Clocked Synchronous Operation • High Resolution Baud Rate Generator • Supports Serial Frames with 5, 6, 7, 8 or 9 Data Bits and 1 or 2 Stop Bits • Odd or Even Parity Generation and Parity Check Supported by Hardware • Data OverRun Detection • Framing Error Detection • Noise Filtering Includes False Start Bit Detection and Digital Low Pass Filter • Three Separate Interrupts on TX Complete, TX Data Register Empty and RX Complete • Multi-processor Communication Mode • Double Speed Asynchronous Communicat UDR USART I/O Data Register The UDR0 register is actually two physically separate registers sharing the same I/O address. When writing to the register, the USART Transmit Data register is written. When reading from UDR0, the USART Receive Data register is read. $03 $23 io_com.bmp N UDR1-7 USART1 I/O Data Register bit 7 RW 0 UDR1-6 USART1 I/O Data Register bit 6 RW 0 UDR1-5 USART1 I/O Data Register bit 5 RW 0 UDR1-4 USART1 I/O Data Register bit 4 RW 0 UDR1-3 USART1 I/O Data Register bit 3 RW 0 UDR1-2 USART1 I/O Data Register bit 2 RW 0 UDR1-1 USART1 I/O Data Register bit 1 RW 0 UDR1-0 USART1 I/O Data Register bit 0 RW 0 UCSR1A USART Control and Status Register A $02 $22 io_flag.bmp Y RXC1 USART Receive Complete This bit is set (one) when a received character is transferred from the Receiver Shift register to UDR0. The bit is set regard-less of any detected framing errors. When the RXCIE bit in UCR is set, the USART Receive Complete interrupt will be executed when RXC is set(one). RXC is cleared by reading UDR0. When interrupt-driven data reception is used, the USART Receive Complete Interrupt routine must read UDRin order to clear RXC, otherwise a new interrupt will occur once the interrupt routine terminates. R 0 TXC1 USART Transmitt Complete This bit is set (one) when the entire character (including the stop bit) in the Transmit Shift register has been shifted out and no new data has been written to UDR0. This flag is especially useful in half-duplex communications interfaces, where a transmitting application must enter receive mode and free the communications bus immediately after completing the transmission. When the TXCIE bit in UCR is set, setting of TXC causes the USART Transmit Complete interrupt to be executed. TXC is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, the TXC bit is cleared (zero) by writing a logical one to the b RW 0 UDRE1 USART Data Register Empty This bit is set (one) when a character written to UDRis transferred to the Transmit shift register. Setting of this bit indicates that the transmitter is ready to receive a new character for transmission. When the UDR0IE bit in UCR is set, the USART Transmit Complete interrupt to be executed as long as UDR0E is set. UDR0E is cleared by writing UDR0. When interrupt-driven data transmittal is used, the USART Data Register Empty Interrupt routine must write UDRin order to clear UDR0E, otherwise a new interrupt will occur once the interrupt routine terminates. UDR0E is set (one) during reset to indicate that the transmitter is re R 1 FE1 Framing Error This bit is set if a Framing Error condition is detected, i.e. when the stop bit of an incoming character is zero. The FE bit is cleared when the stop bit of received data is one. R 0 DOR1 Data overRun This bit is set if an Overrun condition is detected, i.e. when a character already present in the UDRregister is not read before the next character has been shifted into the Receiver Shift register. The OR bit is buffered, which means that it will be set once the valid data still in UDR0E is read. The OR bit is cleared (zero) when data is received and transferred to UDR0. R 0 UPE1 Parity Error This bit is set if the next character in the receive buffer had a Parity Error when received and the parity checking was enabled at that point (UPM1 = 1). This bit is valid until the receive buffer (UDR0) is read. Always set this bit to zero when writing to UCSR0A. R 0 U2X1 Double the USART transmission speed This bit only has effect for the asynchronous operation. Write this bit to zero when using synchronous operation. Writing this bit to one will reduce the divisor of the baud rate divider from 16 to 8 effectively doubling the transfer rate for asynchronous communication. RW 0 MPCM1 Multi-processor Communication Mode This bit enables the Multi-processor Communication Mode. When the MPCM bit is written to one, all the incoming frames received by the USART receiver that do not contain address information will be ignored. The transmitter is unaffected by the MPCM setting. For more detailed information see “Multi-processor Communication Mode” on page 152. RW 0 UCSR1B USART Control and Status Register B $01 $21 io_flag.bmp Y RXCIE1 RX Complete Interrupt Enable Writing this bit to one enables interrupt on the RXC flag. A USART Receive Complete interrupt will be generated only if the RXCIE bit is written to one, the global interrupt flag in SREG is written to one and the RXC bit in UCSR0A is set. RW 0 TXCIE1 TX Complete Interrupt Enable Writing this bit to one enables interrupt on the TXC flag. A USART Transmit Complete interrupt will be generated only if the TXCIE bit is written to one, the global interrupt flag in SREG is written to one and the TXC bit in UCSR0A is set. RW 0 UDRIE1 USART Data register Empty Interrupt Enable Writing this bit to one enables interrupt on the UDR0E flag. A Data Register Empty interrupt will be generated only if the UDR0IE bit is written to one, the global interrupt flag in SREG is written to one and the UDR0E bit in UCSR0A is set. RW 1 RXEN1 Receiver Enable Writing this bit to one enables the USART receiver. The receiver will override normal port operation for the RxD pin when enabled. Disabling the receiver will flush the receive buffer invalidating the FE, DOR and PE flags. RW 0 TXEN1 Transmitter Enable Writing this bit to one enables the USART transmitter. The transmitter will override normal port operation for the TxD pin when enabled. The disabling of the transmitter (writing TXEN to zero) will not become effective until ongoing and pending transmissions are completed, i.e. when the transmit shift register and transmit buffer register does not contain data to be transmitted. When disabled, the transmitter will no longer override the TxD port. RW 0 UCSZ12 CHR91 Character Size The UCSZ2 bits combined with the UCSZ1:0 bit in UCSR1C sets the number of data bits (character size) in a frame the receiver and transmitter use. RW 0 RXB81 Receive Data Bit 8 RXB8 is the 9th data bit of the received character when operating with serial frames with 9 data bits. Must be read before reading the low bits from UDR0. R 0 TXB81 Transmit Data Bit 8 TXB8 is the 9th data bit in the character to be transmitted when operating with serial frames with 9 data bits. Must be writ-ten before writing the low bits to UDR0. W 0 UCSR1C USART Control and Status Register C $3C $5C io_flag.bmp Y URSEL1 Register Select This bit selects between accessing the UCSRC or the UBRRH register.It is read as one when reading UCSRC.The URSELmust be one when writing the UCSRC. RW 0 UMSEL1 USART Mode Select 0: Asynchronous Operation. 1: Synchronous Operation RW 0 UPM11 Parity Mode Bit 1 This bit enable and set type of parity generation and check. If enabled, the transmitter will automatically generate and send the parity of the transmitted data bits within each frame. The receiver will generate a parity value for the incoming data and compare it to the UPM0 setting. If a mismatch is detected, the PE flag in UCSR0A will be set. RW 0 UPM10 Parity Mode Bit 0 This bit enable and set type of parity generation and check. If enabled, the transmitter will automatically generate and send the parity of the transmitted data bits within each frame. The receiver will generate a parity value for the incoming data and compare it to the UPM0 setting. If a mismatch is detected, the PE flag in UCSR0A will be set. RW 0 USBS1 Stop Bit Select 0: 1-bit. 1: 2-bit. RW 0 UCSZ11 Character Size Character Size: 0 0 0 = 5-bit. 0 0 1 = 6-bit. 0 1 0 = 7 bit. 0 1 1 = 8-bit. 1 1 1 = 9 bit. RW 0 UCSZ10 Character Size Character Size: 0 0 0 = 5-bit. 0 0 1 = 6-bit. 0 1 0 = 7 bit. 0 1 1 = 8-bit. 1 1 1 = 9 bit. RW 1 UCPOL1 Clock Polarity This bit is used for synchronous mode only. Write this bit to zero when asynchronous mode is used. The UCPOL bit sets the relationship between data output change and data input sample, and the synchronous clock (XCK). RW 0 UBRR1H USART Baud Rate Register Highg Byte This is a 12-bit register which contains the USART baud rate. The UBRR1H contains the 4 most significant bits, and the UBRR0L contains the 8 least significant bits of the USART baud rate. Ongoing transmissions by the transmitter and receiver will be corrupted if the baud rate is changed. Writing UBRR0L will trigger an immediate update of the baud rate prescaler. $3C $5C io_com.bmp N UBRR11 USART Baud Rate Register bit 11 RW 0 UBRR10 USART Baud Rate Register bit 10 RW 0 UBRR9 USART Baud Rate Register bit 9 RW 0 UBRR8 USART Baud Rate Register bit 8 RW 0 UBRR1L UBRR1 USART Baud Rate Register Low Byte This is a 12-bit register which contains the USART baud rate. The UBRR0H contains the 4 most significant bits, and the UBRR0L contains the 8 least significant bits of the USART baud rate. Ongoing transmissions by the transmitter and receiver will be corrupted if the baud rate is changed. Writing UBRR0L will trigger an immediate update of the baud rate prescaler. $00 $20 io_com.bmp N UBRR1L7 USART Baud Rate Register bit 7 RW 0 UBRR1L6 USART Baud Rate Register bit 6 RW 0 UBRR1L5 USART Baud Rate Register bit 5 RW 0 UBRR1L4 USART Baud Rate Register bit 4 RW 0 UBRR1L3 USART Baud Rate Register bit 3 RW 0 UBRR1L2 USART Baud Rate Register bit 2 RW 0 UBRR1L1 USART Baud Rate Register bit 1 RW 0 UBRR1L0 USART Baud Rate Register bit 0 RW 0 [SPDR:SPSR:SPCR] io_com.bmp The Serial Peripheral Interface(SPI) allows high-speed synchronous data transfer between the AT90S4414/8515 and peripheral devices or between several AVR devices. The AT90S4414/8515 SPI features include the following: • Full-duplex, 3-wire Synchronous Data Transfer • Master or Slave Operation • LSB First or MSB First Data Transfer • Four Programmable Bit Rates • End of Transmission Interrupt Flag • Write Collision Flag Protection • Wakeup from Idle Mode (Slave Mode Only) SPCR SPI Control Register $0D $2D io_flag.bmp Y SPIE SPI Interrupt Enable This bit causes the SPI interrupt to be executed if SPIF bit in the SPSR register is set and the global interrupts are enabled. RW 0 SPE SPI Enable When the SPE bit is set (one), the SPI is enabled. This bit must be set to enable any SPI operations. RW 0 DORD Data Order When the DORD bit is set (one), the LSB of the data word is transmitted first. When the DORD bit is cleared (zero), the MSB of the data word is transmitted first. RW 0 MSTR Master/Slave Select This bit selects Master SPI mode when set (one), and Slave SPI mode when cleared (zero). If SS is configured as an input and is driven low while MSTR is set, MSTR will be cleared, and SPIF in SPSR will become set. The user will then have to set MSTR to re-enable SPI master mode. RW 0 CPOL Clock polarity When this bit is set (one), SCK is high when idle. When CPOL is cleared (zero), SCK is low when idle. Refer to Figure 36 and Figure 37 for additional information. RW 0 CPHA Clock Phase Refer to Figure 36 or Figure 37 for the functionality of this bit. RW 0 SPR1 SPI Clock Rate Select 1 These two bits control the SCK rate of the device configured as a master. SPR1 and SPR0 have no effect on the slave. RW 0 SPR0 SPI Clock Rate Select 0 These two bits control the SCK rate of the device configured as a master. SPR1 and SPR0 have no effect on the slave. RW 0 SPSR SPI Status Register $0E $2E io_flag.bmp Y SPIF SPI Interrupt Flag When a serial transfer is complete, the SPIF bit is set (one) and an interrupt is generated if SPIE in SPCR is set (one) and global interrupts are enabled. If SS is an input and is driven low when the SPI is in master mode, this will also set the SPIF flag. SPIF is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, the SPIF bit is cleared by first reading the SPI status register when SPIF is set (one), then accessing the SPI Data Register (SPDR). R 0 WCOL Write Collision Flag The WCOL bit is set if the SPI data register (SPDR) is written during a data transfer. The WCOL bit (and the SPIF bit) are cleared (zero) by first reading the SPI Status Register when WCOL is set (one), and then accessing the SPI Data Register. R 0 SPI2X Double SPI Speed Bit When this bit is written logic one the SPI speed (SCK Frequency)will be doubled when the SPI is in master mode .This means that the minimum SCK period will be 2 CPU clock periods.When the SPI is configured as Slave,the SPI is only guaranteed to work at f osc /4orlower. The SPI interface on the ATmega162 is also used for program memory and EEPROM downloading or uploading. RW 0 SPDR SPI Data Register The SPI Data Register is a read/write register used for data transfer between the register file and the SPI Shift register. Writing to the register initiates data transmission. Reading the register causes the Shift Register Receive buffer to be read. $0F $2F io_com.bmp N SPDR7 SPI Data Register bit 7 RW X SPDR6 SPI Data Register bit 6 RW X SPDR5 SPI Data Register bit 5 RW X SPDR4 SPI Data Register bit 4 RW X SPDR3 SPI Data Register bit 3 RW X SPDR2 SPI Data Register bit 2 RW X SPDR1 SPI Data Register bit 1 R 0 SPDR0 SPI Data Register bit 0 R 0 [SREG:SPH:SPL:MCUCR:MCUCSR:EMCUCR:OSCCAL:CLKPR:SFIOR] [SPH:SPL] io_cpu.bmp SREG Status Register $3F $5F io_sreg.bmp Y I Global Interrupt Enable The global interrupt enable bit must be set (one) for the interrupts to be enabled. The individual interrupt enable control is then performed in separate control registers. If the global interrupt enable bit is cleared (zero), none of the interrupts are enabled independent of the individual interrupt enable settings. The I-bit is cleared by hardware after an interrupt has occurred, and is set by the RETI instruction to enable subsequent interrupts. RW 0 T Bit Copy Storage The bit copy instructions BLD (Bit LoaD) and BST (Bit STore) use the T bit as source and destination for the operated bit. A bit from a register in the register file can be copied into T by the BST instruction, and a bit in T can be copied into a bit in a register in the register file by the BLD instruction. RW 0 H Half Carry Flag The half carry flag H indicates a half carry in some arithmetic operations. See the Instruction Set Description for detailed information. RW 0 S Sign Bit The S-bit is always an exclusive or between the negative flag N and the two’s complement overflow flag V. See the Instruc-tion Set Description for detailed information. RW 0 V Two's Complement Overflow Flag The two’s complement overflow flag V supports two’s complement arithmetics. See the Instruction Set Description for detailed information. RW 0 N Negative Flag The negative flag N indicates a negative result after the different arithmetic and logic operations. See the Instruction Set Description for detailed information. RW 0 Z Zero Flag The zero flag Z indicates a zero result after the different arithmetic and logic operations. See the Instruction Set Description for detailed information. RW 0 C Carry Flag The carry flag C indicates a carry in an arithmetic or logic operation. See the Instruction Set Description for detailed information. Note that the status register is not automatically stored when entering an interrupt routine and restored when returning from an interrupt routine. This must be handled by software. RW 0 SPH Stack Pointer High The general AVR 16-bit Stack Pointer is effectively built up of two 8-bit registers in the I/O space locations $3E ($5E) and $3D ($5D). As the AT90S4414/8515 supports up to 64 kB external SRAM, all 16-bits are used. The Stack Pointer points to the data SRAM stack area where the Subroutine and Interrupt Stacks are located. This Stack space in the data SRAM must be defined by the program before any subroutine calls are executed or interrupts are enabled. The stack pointer must be set to point above $60. The Stack Pointer is decremented by one when data is pushed onto the Stack with the PUSH instruction, and it is decremented by two when an address is pushed onto the Stack with subroutine calls and interrupts. The Stack Pointer is incremented by one when data is popped from the Stack with the POP instruction, and it is incremented by two when an address is popped from the Stack with return from subroutine RET or return from interrupt R $3E $5E io_sph.bmp N SP15 Stack pointer bit 15 RW 0 SP14 Stack pointer bit 14 RW 0 SP13 Stack pointer bit 13 RW 0 SP12 Stack pointer bit 12 RW 0 SP11 Stack pointer bit 11 RW 0 SP10 Stack pointer bit 10 RW 0 SP9 Stack pointer bit 9 RW 0 SP8 Stack pointer bit 8 RW 0 SPL Stack Pointer Low The general AVR 16-bit Stack Pointer is effectively built up of two 8-bit registers in the I/O space locations $3E ($5E) and $3D ($5D). As the AT90S4414/8515 supports up to 64 kB external SRAM, all 16-bits are used. The Stack Pointer points to the data SRAM stack area where the Subroutine and Interrupt Stacks are located. This Stack space in the data SRAM must be defined by the program before any subroutine calls are executed or interrupts are enabled. The stack pointer must be set to point above $60. The Stack Pointer is decremented by one when data is pushed onto the Stack with the PUSH instruction, and it is decremented by two when an address is pushed onto the Stack with subroutine calls and interrupts. The Stack Pointer is incremented by one when data is popped from the Stack with the POP instruction, and it is incremented by two when an address is popped from the Stack with return from subroutine RET or return from interrupt $3D $5D io_sph.bmp N SP7 Stack pointer bit 7 RW 0 SP6 Stack pointer bit 6 RW 0 SP5 Stack pointer bit 5 RW 0 SP4 Stack pointer bit 4 RW 0 SP3 Stack pointer bit 3 RW 0 SP2 Stack pointer bit 2 RW 0 SP1 Stack pointer bit 1 RW 0 SP0 Stack pointer bit 0 RW 0 MCUCR MCU Control Register The MCU Control Register contains control bits for general MCU functions. $35 $55 io_flag.bmp Y SRE External SRAM Enable Writing SRE to one enables the External Memory Interface.The pin functions AD7:0, A15:8, ALE, WR, and RD are acti-vated as the alternate pin functions. The SRE bit overrides any pin direction settings in the respective data direction regis-ters. Writing SRE to zero, disables the External Memory Interface and the normal pin and data direction settings are used. RW 0 SRW10 SRW External SRAM Wait State Select For a detailed description in non ATmega103 Compatibility mode, see common description for the SRWn bits below (XMRA description). In ATmega103 Compatibility mode, writing SRW10 to one enables the wait state and one extra cycle is added during read/write strobe as shown in Figure 14. RW 0 SE Sleep Enable The SE bit must be written to logic one to make the MCU enter the sleep mode when the SLEEP instruction is executed.To avoid the MCU entering the sleep mode unless it is the programmers purpose,it is recommended to write the Sleep Enable (SE)bit to one just before the execution of the SLEEP instruction and to clear it immediately after waking up. RW 0 SM1 SM Sleep Mode Select The description is to long for the tooltip help, please refer to the manual RW 0 ISC11 Interrupt Sense Control 1 bit 1 The External Interrupt 1 is activated by the external pin INT1 if the SREG I-bit and the corresponding interrupt mask in the GICR are set.The value on the INT1 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. RW 0 ISC10 Interrupt Sense Control 1 bit 1 The External Interrupt 1 is activated by the external pin INT1 if the SREG I-bit and the corresponding interrupt mask in the GICR are set.The value on the INT1 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. RW 0 ISC01 Interrupt Sense Control 0 bit 1 The External Interrupt 0 is activated by the external pin INT0 if the SREG I-flag and the corresponding interrupt mask are set.The value on the INT0 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. RW 0 ISC00 Interrupt Sense Control 0 bit 0 The External Interrupt 0 is activated by the external pin INT0 if the SREG I-flag and the corresponding interrupt mask are set.The value on the INT0 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. RW 0 MCUCSR MCUSR MCU Control And Status Register The MCU Control And Status Register provides information on which reset source caused a MCU reset. $34 $54 io_flag.bmp Y JDT JTAG Interface Disable When this bit is zero,the JTAG interface is enabled if the JTAGEN fuse is programmed. If this bit is one,the JTAG interface is disabled.In order to avoid unintentional disabling or enabling of the JTAG interface,a timed sequence must be followed when changing this bit:The application software must write this bit to the desired value twice within four cycles to change its value. R/W 0 SM2 Sleep Mode Select Bit 2 The Sleep Mode Select bits select between the five available sleep modes. See Datasheet. R/W 0 JTRF JTAG Reset Flag This bit is set if a reset is being caused by a logic one in the JTAG Reset Register selected by the JTAG instruction AVR_RESET. This bit is reset by a Power-on reset, or by writing a logic zero to the flag. • Bit 3 - WDRF: Watchdog Reset Flag R/W 0 WDRF Watchdog Reset Flag This bit is set if a watchdog reset occurs. The bit is reset by a power-on reset, or by writing a logic zero to the flag. R/W 0 BORF Brown-out Reset Flag This bit is set if a brown-out reset occurs. The bit is reset by a power-on reset, or by writing a logic zero to the flag. R/W 0 EXTRF External Reset Flag This bit is set if an external reset occurs. The bit is reset by a power-on reset, or by writing a logic zero to the flag. R/W 0 PORF Power-on reset flag This bit is set if a power-on reset occurs. The bit is reset only by writing a logic zero to the flag. To make use of the reset flags to identify a reset condition, the user should read and then reset the MCUCSR as early as possible in the program. If the register is cleared before another reset occurs, the source of the reset can be found by examining the reset flags. R/W 0 EMCUCR Extended MCU Control Register The Extended MCU Control Register contains control bits for general MCU functions. $36 $56 io_flag.bmp Y SM0 Sleep mode Select Bit 0 The Sleep Mode Select bits select between the five available sleep modes. See Datasheet. RW 0 SRL2 Wait State Sector Limit Bit 2 It is possible to configure different wait-states for different external memory addresses. The external memory address space can be divided in two sectors that have separate wait-state bits.The SRL2,SRL1,and SRL0 bits select the splitting of these sectors. By default,the SRL2,SRL1,and SRL0 bits are set to zero and the entire external memory address space is treated as one sector.When the entire SRAM address space is configured as one sector,the wait-states are configured by the SRW11 and SRW10 bits. RW 0 SRL1 Wait State Sector Limit Bit 1 It is possible to configure different wait-states for different external memory addresses. The external memory address space can be divided in two sectors that have separate wait-state bits.The SRL2,SRL1,and SRL0 bits select the splitting of these sectors. By default,the SRL2,SRL1,and SRL0 bits are set to zero and the entire external memory address space is treated as one sector.When the entire SRAM address space is configured as one sector,the wait-states are configured by the SRW11 and SRW10 bits. RW 0 SRL0 Wait State Sector Limit Bit 0 It is possible to configure different wait-states for different external memory addresses. The external memory address space can be divided in two sectors that have separate wait-state bits.The SRL2,SRL1,and SRL0 bits select the splitting of these sectors. By default,the SRL2,SRL1,and SRL0 bits are set to zero and the entire external memory address space is treated as one sector.When the entire SRAM address space is configured as one sector,the wait-states are configured by the SRW11 and SRW10 bits. RW 0 SRW01 Wait State Select Bit 1 for Lower Sector The SRW00 and SRW01 bits control the number of wait-states for the upper sector of the external memory address space. RW 0 SRW00 Wait State Select Bit 0 for Lower Sector The SRW00 and SRW01 bits control the number of wait-states for the upper sector of the external memory address space. RW 0 SRW11 Wait State Select Bit 1 for Upper Sector The SRW11 and SRW10 bits control the number of wait-states for the upper sector of the external memory address space. RW 0 ISC2 Interrupt Sense Control 2 The asynchronous external interrupt 2 is activated by the external pin INT2 if the SREG I-bit and the corresponding interrupt mask in GICR are set.If ISC2 is written to zero,a falling edge on INT2 activates the interrupt.If ISC2 is written to one,a rising edge on INT2 activates the interrupt.Edges on INT2 are registered asynchronously.Pulses on INT2 wider than the minimum pulse given width will generate an interrupt. Shorter pulses are not guaranteed to generate an interrupt.When changing the ISC2 bit,an interrupt can occur.Therefore,it is recommended to first disable INT2 by clearing its Interrupt Enable bit in the GICR register.Then,the ISC2 bit can be changed.Finally, the INT2 interruptflag should becleared by writing a logical one to its Interrupt Flagbit (INTF2)in the GIFR register before the interrupt is re-enabled. RW 0 OSCCAL Oscillator Calibration Value Writing the calibration byte to this address will trim the internal oscillator to remove process variations from the oscillator frequency. This is done automatically during chip reset. When OSCCAL is zero, the lowest available frequency is chosen. Writing non-zero values to this register will increase the frequency of the internal oscillator. Writing $FF to the register gives the highest available frequency. The calibrated oscillator is used to time EEPROM and Flash access. If EEPROM or Flash is written, do not calibrate to more than 10% above the nominal frequency. Otherwise, the EEPROM or Flash write may fail. Note that the Oscillator is intended for calibration to 1.0 MHz, 2.0 MHz, 4.0 MHz, or 8.0MHz. Tuning to other values is not guaranteed, as indicated in Table 1 $04 $24 io_cpu.bmp N CAL6 Oscillator Calibration Value Bit6 R/W 0 CAL5 Oscillator Calibration Value Bit5 R/W 0 CAL4 Oscillator Calibration Value Bit4 R/W 0 CAL3 Oscillator Calibration Value Bit3 R/W 0 CAL2 Oscillator Calibration Value Bit2 R/W 0 CAL1 Oscillator Calibration Value Bit1 R/W 0 CAL0 Oscillator Calibration Value Bit0 R/W 0 CLKPR Clock prescale register The ATmega162 system clock can be divided by setting the Clock Prescale Register CLKPR. This feature can be used to decrease power consumption when the requirement for processing power is low. This can be used with all clock source options, and it will affect the clock frequency of the CPU and all synchronous peripherals. NA $61 io_cpu.bmp Y CLKPCE Clock Prescaler Change Enable The CLKPCE bit must be written to logic one to enable change of the CLKPS bits. CLKPCE is cleared by hardware four cycles after it is written or when CLKPS is written. R/W 0 CLKPS3 Clock Prescaler Select Bit 3 R/W 0 CLKPS2 Clock Prescaler Select Bit 2 R/W 0 CLKPS1 Clock Prescaler Select Bit 1 R/W 0 CLKPS0 Clock Prescaler Select Bit 0 R/W 0 SFIOR Special Function IO Register $30 $50 io_cpu.bmp Y TSM Timer/Counter Synchronization Mode Writing TSM to one,PSR0 and PSR321 becomes registers that hold their value until rewritten,or the TSM bit is written zero.This mode is useful for synchronizing timer/counters.By setting both TSM and the appropriate PSR bit(s),the appropriate timer/counters are halted,and can be configured to same value without the risk of one of them advancing during configuration.When the TSM bit is written zero,the Timer/Counters start counting simultaneously. RW 0 XMBK External Memory Bus Keeper Enable Writing XMBK to one enables the bus keeper on the AD7:0 lines.When the bus keeper RW 0 XMM2 External Memory High Mask Bit 2 Please refer to the datasheet for a full description of the usage. RW 0 XMM1 External Memory High Mask Bit 1 Please refer to the datasheet for a full description of the usage. RW 0 XMM0 External Memory High Mask Bit 0 Please refer to the datasheet for a full description of the usage. RW 0 PUD Pull-up Disable When this bit is written to one,the pull-ups in the I/O ports are disabled even if the DDxn RW 0 PSR2 Prescaler Reset Timer/Counter2 When this bit is written to one,the Timer/Counter2 prescaler will be reset.The bit will be cleared by hardware after the operation is performed.Writing a zero to this bit will have no effect.This bit will always be read as zero if Timer/Counter2 is clocked by the internal CPU clock.If this bit is written when Timer/Counter2 is operating in asynchronous mode,the bit will remain one until the prescaler has been reset. RW 0 PSR310 PSR10 PSR0 PSR1 Prescaler Reset Timer/Counter3, Timer/Counter1 and Timer/Counter0 When this bit is written to one,the Timer/Counter3,Timer/Counter1,and Timer/Counter0 prescaler will be reset.The bit will be cleared by hardware after the operation is performed.Writing a zero to this bit will have no effect.Note that Timer/Counter3,Timer/Counter1,and Timer/Counter0 share the same prescaler and a reset of this prescaler will affect all 3 timers.This bit will always be read as zero. RW 0 [OCDR:MCUCSR] io_com.bmp 00 JTAG Features: JTAG (IEEE std. 1149.1 compliant) Interface. Boundary-Scan Capabilities According to the IEEE std. 1149.1 (JTAG) Standard. Debugger Access to: – All Internal Peripheral Units – Internal and External RAM – The Internal Register File –Program Counter – EEPROM and Flash Memories. Extensive On-Chip Debug Support for Break Conditions, Including: –AVR Break Instruction – Break on Change of Program Memory Flow –Single Step Break –Program Memory Breakpoints on Single Address or Address Range – Data Memory Breakpoints on Single Address or Address Range. Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG Interface. On-Chip Debugging Supported by AVR S OCDR On-Chip Debug Related Register in I/O Memory The OCDR register provides a communication channel from the running program in the microcontroller to the debugger. The CPU can transfer a byte to the debugger by writing to this location. At the same time, an internal flag; I/O Debug Reg-ister Dirty - IDRD - is set to indicate to the debugger that the register has been written. When the CPU reads the OCDR reg-ister the 7 LSB will be from the OCDR register, while the MSB is the IDRD bit. The debugger clears the IDRD bit when it has read the information. In some AVR devices, this register is shared with a standard I/O location. In this case, the OCDR register can only be accessed if the OCDEN fuse is programmed, and the debugger enables access to the OCDR register. In all other cases, the standard I/O location is accessed. Refer to the debugger documentation for further information on how to use this registe $04 $24 io_com.bmp Y OCDR7 IDRD On-Chip Debug Register Bit 7 RW 0 OCDR6 On-Chip Debug Register Bit 6 RW 0 OCDR5 On-Chip Debug Register Bit 5 RW 0 OCDR4 On-Chip Debug Register Bit 4 RW 0 OCDR3 On-Chip Debug Register Bit 3 RW 0 OCDR2 On-Chip Debug Register Bit 2 RW 0 OCDR1 On-Chip Debug Register Bit 1 RW 0 OCDR0 On-Chip Debug Register Bit 0 RW 0 MCUCSR MCU Control And Status Register The MCU Control and Status Register contains control bits for general MCU functions, and provides information on which reset source caused an MCU reset. $34 $54 io_flag.bmp Y JTD JTAG Interface Disable When this bit is written to zero, the JTAG interface is enabled if the JTAGEN fuse is programmed. If this bit is written to one, the JTAG interface is disabled. In order to avoid unintentional disabling or enabling of the JTAG interface, a timed sequence must be followed: The application software must write this to the desired value twice within four cycles to change the bit. RW 0 JTRF JTAG Reset Flag This bit is set if a reset is being caused by a logic one in the JTAG Reset Register selected by the JTAG instruction AVR_RESET. This bit is reset by a Power-on reset, or by writing a logic zero to the flag. RW 0 [SPMCR] io_cpu.bmp 00 The Boot Loader Support provides a real Read While Write self-programming mechanism for downloading and uploading program code by the MCU itself. This feature allows flexible application software updates controlled by the MCU using a Flash-resident Boot Loader program. The Boot Loader program can use any available data interface and associated proto-col to read code and write (program) that code into the Flash memory, or read the code from the program memory. The program code within the Boot Loader section has the capability to write into the entire Flash, including the Boot Loader Memory. The Boot Loader can thus even modify itself, and it can also erase itself from the code if the feature is not needed anymore. The size of the Boot Loader Memory is configurable with fuses and the Boot Loader has two separate sets of Boot Lock Bits which can be set independently. This gives the user a unique flexibility to select different levels of protection. Boot Loader Features: Read While Write self-programming. Flexibl Boot Memory size. High security (separate Boot Lock bits for a flexible protection). Separate fuse to select reset vector Optimized page (1) size. Code efficient algorithm Efficient read-modify-write suppo SPMCR Store Program Memory Control Register The Store Program Memory Control Register contains the control bits needed to control the Boot Loader operations. $37 $57 io_flag.bmp Y SPMIE SPM Interrupt Enable When the SPMIE bit is written to one, and the I-bit in the Status Register is set (one), the SPM ready interrupt will be enabled. The SPM ready Interrupt will be executed as long as the SPMEN bit in the SPMCR register is cleared. RW 0 RWWSB ASB Read While Write Section Busy When a self-programming (page erase or page write) operation to the RWW section is initiated, the RWWSB will be set (one) by hardware. When the RWWSB bit is set, the RWW section cannot be accessed. The RWWSB bit will be cleared if the RWWSRE bit is written to one after a self-programming operation is completed. Alternatively the RWWSB bit will auto-matically be cleared if a page load operation is initiated. R 0 RWWSRE ASRE Read While Write secion read enable When programming (page erase or page write) to the RWW section, the RWW section is blocked for reading (the RWWSB will be set by hardware). To re-enable the RWW section, the user software must wait until the programming is completed (SPMEN will be cleared). Then, if the RWWSRE bit is written to one at the same time as SPMEN, the next SPM instruction within four clock cycles re-enables the RWW section. The RWW section cannot be re-enabled while Flash is busy with a page erase or a page write (SPMEN is set). If the RWWSRE bit is written while the Flash is being loaded, the Flash load operation will abort and the data loaded will be lo RW 0 BLBSET Boot Lock Bit Set If this bit is written to one at the same time as SPMEN, the next SPM instruction within four clock cycles sets Boot Lock bits, according to the data in R0. The data in R1 and the address in the Z pointer are ignored. The BLBSET bit will automatically be cleared upon completion of the lock bit set, or if no SPM instruction is executed within four clock cycles. An LPM instruction within three cycles after BLBSET and SPMEN are set in the SPMCR register, will read either the Lock-bits or the Fuse bits (depending on Z0 in the Z pointer) into the destination register. See “Reading the Fuse and Lock Bits from Software” on page 235 for details RW 0 PGWRT Page Write If this bit is written to one at the same time as SPMEN, the next SPM instruction within four clock cycles executes page write, with the data stored in the temporary buffer. The page address is taken from the high part of the Z pointer. The data in R1 and R0 are ignored. The PGWRT bit will auto-clear upon completion of a page write, or if no SPM instruction is exe-cuted within four clock cycles. The CPU is halted during the entire page write operation if the NRWW section is addressed. RW 0 PGERS Page Erase If this bit is written to one at the same time as SPMEN, the next SPM instruction within four clock cycles executes page erase. The page address is taken from the high part of the Z pointer. The data in R1 and R0 are ignored. The PGERS bit will auto-clear upon completion of a page erase, or if no SPM instruction is executed within four clock cycles. The CPU is halted during the entire page write operation if the NRWW section is addressed. RW 0 SPMEN Store Program Memory Enable This bit enables the SPM instruction for the next four clock cycles. If written to one together with either RWWSRE, BLB-SET, PGWRT or PGERS, the following SPM instruction will have a special meaning, see description above. If only SPMEN is written, the following SPM instruction will store the value in R1:R0 in the temporary page buffer addressed by the Z pointer. The LSB of the Z pointer is ignored. The SPMEN bit will auto-clear upon completion of an SPM instruction, or if no SPM instruction is executed within four clock cycles. During page erase and page write, the SPMEN bit remain high until the operation is completed. Writing any other combination than “10001”, "01001", "00101", "00011" or "00001" in the lower five bits will have no effec RW 0 [EEARH:EEARL:EEDR:EECR] [EEARH:EEARL] io_cpu.bmp EEPROM Read/Write Access. The EEPROM access registers are accessible in the I/O space. The write access time for the EEPROM is given in Table 1. A self-timing function, however, lets the user software detect when the next byte can be written. If the user code contains instructions that write the EEPROM, some precautions must be taken. In heavily filtered power supplies, V CC is likely to rise or fall slowly on power-up/down. This causes the device for some period of time to run at a voltage lower than specified as minimum for the clock frequency used. See “Preventing EEPROM Corruption” on page 19. for details on how to avoid problems in these situations.In order to prevent unintentional EEPROM writes, a specific write procedure must be followed. Refer to the description of the EEPROM Control Register for details on this. When the EEPROM is read, the CPU is halted for four clock cycles before the next instruction is executed. When theEEPROM is written, the CPU is halted for two clock cycles before the next instruction is execute EEARH EEPROM Address Register High Byte Bits 11..0 - EEAR11..0: EEPROM Address The EEPROM Address Registers - EEARH and EEARL specify the EEPROM address in the 4K bytes EEPROM space. The EEPROM data bytes are addressed linearly between 0 and 4096. The initial value of EEAR is undefined. A proper value must be written before the EEPROM may be accessed. $1F $3F io_cpu.bmp N EEAR8 EEPROM Read/Write Access Bit 8 RW 0 EEARL EEPROM Address Register Low Byte Bits 11..0 - EEAR11..0: EEPROM Address The EEPROM Address Registers - EEARH and EEARL specify the EEPROM address in the 4K bytes EEPROM space. The EEPROM data bytes are addressed linearly between 0 and 4096. The initial value of EEAR is undefined. A proper value must be written before the EEPROM may be accessed. $1E $3E io_cpu.bmp N EEAR7 EEPROM Read/Write Access Bit 7 RW 0 EEAR6 EEPROM Read/Write Access Bit 6 RW 0 EEAR5 EEPROM Read/Write Access Bit 5 RW 0 EEAR4 EEPROM Read/Write Access Bit 4 RW 0 EEAR3 EEPROM Read/Write Access Bit 3 RW 0 EEAR2 EEPROM Read/Write Access Bit 2 RW 0 EEAR1 EEPROM Read/Write Access Bit 1 RW 0 EEAR0 EEPROM Read/Write Access Bit 0 RW 0 EEDR EEPROM Data Register For the EEPROM write operation, the EEDR register contains the data to be written to the EEPROM in the address given by the EEAR register. For the EEPROM read operation, the EEDR contains the data read out from the EEPROM at the address given by EEAR. $1D $3D io_cpu.bmp N EEDR7 EEPROM Data Register bit 7 RW 0 EEDR6 EEPROM Data Register bit 6 RW 0 EEDR5 EEPROM Data Register bit 5 RW 0 EEDR4 EEPROM Data Register bit 4 RW 0 EEDR3 EEPROM Data Register bit 3 RW 0 EEDR2 EEPROM Data Register bit 2 RW 0 EEDR1 EEPROM Data Register bit 1 RW 0 EEDR0 EEPROM Data Register bit 0 RW 0 EECR EEPROM Control Register $1C $3C io_flag.bmp Y EERIE EEPROM Ready Interrupt Enable EEPROM Ready Interrupt Enable Writing EERIE to one enables the EEPROM Ready Interrupt if the I bit in SREG is set. Writing EERIE to zero disables the interrupt. The EEPROM Ready interrupt generates a constant interrupt when EEWE is cleared. RW 0 EEMWE EEWEE EEPROM Master Write Enable The EEMWE bit determines whether setting EEWE to one causes the EEPROM to be written. When EEMWE is written to one, writing EEWE to one within 4 clock cycles will write data to the EEPROM at the selected address. If EEMWE is zero, writing EEWE to one will have no effect. When EEMWE has been written to one by software, hardware clears the bit to zero after four clock cycles. See the description of the EEWE bit for an EEPROM write procedure. RW 0 EEWE EEPROM Write Enable The EEPROM Write Enable Signal EEWE is the write strobe to the EEPROM. When address and data are correctly set up, the EEWE bit must be set to write the value into the EEPROM. The EEMWE bit must be set when the logical one is written to EEWE, otherwise no EEPROM write takes place. The following procedure should be followed when writing the EEPROM (the order of steps 3 and 4 is not essential): 1. Wait until EEWE becomes zero. 2. Wait until SPMEN in SPMCR becomes zero. 3. Write new EEPROM address to EEAR (optional). 4. Write new EEPROM data to EEDR (optional). 5. Write a logical one to the EEMWE bit while writing a zero to EEWE in EECR. 6. Within four clock cycles after setting EEMWE, write a logical one to EEWE. The EEPROM can not be programmed during a CPU write to the Flash memory. The software must check that the Flash programming is completed before initiating a new EEPROM write. Step 2 is only relevant if the software contains a boot loader allowing the CPU to program the Flash. If the Flash is never being updated by the CPU, step 2 can be omitted. See “Boot Loader Support - Read While Write self-programming” on page 228 for details about boot programming. Caution: An interrupt between step 5 and step 6 will make the write cycle fail, since the EEPROM Master Write Enable will time-out. If an interrupt routine accessing the EEPROM is interrupting another EEPROM access, the EEAR or EEDR regis-ter will be modified, causing the interrupted EEPROM access to fail. It is recommended to have the global interrupt flag cleared during the 4 last steps to avoid these problems. When the write access time has elapsed, the EEWE bit is cleared by hardware. The user software can poll this bit and wait for a zero before writing the next byte. When EEWE has been set, the CPU is halted for two cycles before the next instruc-tion is executed RW X EERE EEPROM Read Enable The EEPROM Read Enable Signal EERE is the read strobe to the EEPROM. When the correct address is set up in the EEAR register, the EERE bit must be written to a logic one to trigger the EEPROM read. The EEPROM read access takes one instruction, and the requested data is available immediately. When the EEPROM is read, the CPU is halted for four cycles before the next instruction is executed. The user should poll the EEWE bit before starting the read operation. If a write operation is in progress, it is neither possible to read the EEPROM, nor to change the EEAR register. The calibrated oscillator is used to time the EEPROM accesses. Table 1 lists the typical programming time for EEPROM access from the CPU RW 0 [PORTA:DDRA:PINA] io_port.bmp AVRSimIOPort.SimIOPort PORTA Port A Data Register $1B $3B io_port.bmp N PORTA7 Port A Data Register bit 7 RW 0 PORTA6 Port A Data Register bit 6 RW 0 PORTA5 Port A Data Register bit 5 RW 0 PORTA4 Port A Data Register bit 4 RW 0 PORTA3 Port A Data Register bit 3 RW 0 PORTA2 Port A Data Register bit 2 RW 0 PORTA1 Port A Data Register bit 1 RW 0 PORTA0 Port A Data Register bit 0 RW 0 DDRA Port A Data Direction Register $1A $3A io_flag.bmp N DDA7 Data Direction Register, Port A, bit 7 RW 0 DDA6 Data Direction Register, Port A, bit 6 RW 0 DDA5 Data Direction Register, Port A, bit 5 RW 0 DDA4 Data Direction Register, Port A, bit 4 RW 0 DDA3 Data Direction Register, Port A, bit 3 RW 0 DDA2 Data Direction Register, Port A, bit 2 RW 0 DDA1 Data Direction Register, Port A, bit 1 RW 0 DDA0 Data Direction Register, Port A, bit 0 RW 0 PINA Port A Input Pins The Port A Input Pins address - PINA - is not a register, and this address enables access to the physical value on each Port A pin. When reading PORTA the Port A Data Latch is read, and when reading PINA, the logical values present on the pins are read. $19 $39 io_port.bmp N PINA7 Input Pins, Port A bit 7 RW Hi-Z PINA6 Input Pins, Port A bit 6 RW Hi-Z PINA5 Input Pins, Port A bit 5 RW Hi-Z PINA4 Input Pins, Port A bit 4 RW Hi-Z PINA3 Input Pins, Port A bit 3 RW Hi-Z PINA2 Input Pins, Port A bit 2 RW Hi-Z PINA1 Input Pins, Port A bit 1 RW Hi-Z PINA0 Input Pins, Port A bit 0 RW Hi-Z [PORTB:DDRB:PINB] io_port.bmp AVRSimIOPort.SimIOPort PORTB Port B Data Register $18 $38 io_port.bmp N PORTB7 Port B Data Register bit 7 RW 0 PORTB6 Port B Data Register bit 6 RW 0 PORTB5 Port B Data Register bit 5 RW 0 PORTB4 Port B Data Register bit 4 RW 0 PORTB3 Port B Data Register bit 3 RW 0 PORTB2 Port B Data Register bit 2 RW 0 PORTB1 Port B Data Register bit 1 RW 0 PORTB0 Port B Data Register bit 0 RW 0 DDRB Port B Data Direction Register $17 $37 io_flag.bmp N DDB7 Port B Data Direction Register bit 7 RW 0 DDB6 Port B Data Direction Register bit 6 RW 0 DDB5 Port B Data Direction Register bit 5 RW 0 DDB4 Port B Data Direction Register bit 4 RW 0 DDB3 Port B Data Direction Register bit 3 RW 0 DDB2 Port B Data Direction Register bit 2 RW 0 DDB1 Port B Data Direction Register bit 1 RW 0 DDB0 Port B Data Direction Register bit 0 RW 0 PINB Port B Input Pins The Port B Input Pins address - PINB - is not a register, and this address enables access to the physical value on each Port B pin. When reading PORTB, the Port B Data Latch is read, and when reading PINB, the logical values present on the pins are read. $16 $36 io_port.bmp N PINB7 Port B Input Pins bit 7 R 0 PINB6 Port B Input Pins bit 6 R 0 PINB5 Port B Input Pins bit 5 R 0 PINB4 Port B Input Pins bit 4 R 0 PINB3 Port B Input Pins bit 3 R 0 PINB2 Port B Input Pins bit 2 R 0 PINB1 Port B Input Pins bit 1 R 0 PINB0 Port B Input Pins bit 0 R 0 [PORTC:DDRC:PINC] io_port.bmp AVRSimIOPort.SimIOPort PORTC Port C Data Register $15 $35 io_port.bmp N PORTC7 Port C Data Register bit 7 RW 0 PORTC6 Port C Data Register bit 6 RW 0 PORTC5 Port C Data Register bit 5 RW 0 PORTC4 Port C Data Register bit 4 RW 0 PORTC3 Port C Data Register bit 3 RW 0 PORTC2 Port C Data Register bit 2 RW 0 PORTC1 Port C Data Register bit 1 RW 0 PORTC0 Port C Data Register bit 0 RW 0 DDRC Port C Data Direction Register $14 $34 io_flag.bmp N DDC7 Port C Data Direction Register bit 7 RW 0 DDC6 Port C Data Direction Register bit 6 RW 0 DDC5 Port C Data Direction Register bit 5 RW 0 DDC4 Port C Data Direction Register bit 4 RW 0 DDC3 Port C Data Direction Register bit 3 RW 0 DDC2 Port C Data Direction Register bit 2 RW 0 DDC1 Port C Data Direction Register bit 1 RW 0 DDC0 Port C Data Direction Register bit 0 RW 0 PINC Port C Input Pins The Port C Input Pins address - PINC - is not a register, and this address enables access to the physical value on each Port C pin. When reading PORTC, the Port C Data Latch is read, and when reading PINC, the logical values present on the pins are read. $13 $33 io_port.bmp N PINC7 Port C Input Pins bit 7 R 0 PINC6 Port C Input Pins bit 6 R 0 PINC5 Port C Input Pins bit 5 R 0 PINC4 Port C Input Pins bit 4 R 0 PINC3 Port C Input Pins bit 3 R 0 PINC2 Port C Input Pins bit 2 R 0 PINC1 Port C Input Pins bit 1 R 0 PINC0 Port C Input Pins bit 0 R 0 [PORTD:DDRD:PIND] io_port.bmp AVRSimIOPort.SimIOPort PORTD Port D Data Register $12 $32 io_port.bmp N PORTD7 Port D Data Register bit 7 RW 0 PORTD6 Port D Data Register bit 6 RW 0 PORTD5 Port D Data Register bit 5 RW 0 PORTD4 Port D Data Register bit 4 RW 0 PORTD3 Port D Data Register bit 3 RW 0 PORTD2 Port D Data Register bit 2 RW 0 PORTD1 Port D Data Register bit 1 RW 0 PORTD0 Port D Data Register bit 0 RW 0 DDRD Port D Data Direction Register $11 $31 io_flag.bmp N DDD7 Port D Data Direction Register bit 7 RW 0 DDD6 Port D Data Direction Register bit 6 RW 0 DDD5 Port D Data Direction Register bit 5 RW 0 DDD4 Port D Data Direction Register bit 4 RW 0 DDD3 Port D Data Direction Register bit 3 RW 0 DDD2 Port D Data Direction Register bit 2 RW 0 DDD1 Port D Data Direction Register bit 1 RW 0 DDD0 Port D Data Direction Register bit 0 RW 0 PIND Port D Input Pins The Port D Input Pins address - PIND - is not a register, and this address enables access to the physical value on each Port D pin. When reading PORTD, the Port D Data Latch is read, and when reading PIND, the logical values present on the pins are read. $10 $30 io_port.bmp N PIND7 Port D Input Pins bit 7 R 0 PIND6 Port D Input Pins bit 6 R 0 PIND5 Port D Input Pins bit 5 R 0 PIND4 Port D Input Pins bit 4 R 0 PIND3 Port D Input Pins bit 3 R 0 PIND2 Port D Input Pins bit 2 R 0 PIND1 Port D Input Pins bit 1 R 0 PIND0 Port D Input Pins bit 0 R 0 [TCCR0:TCNT0:OCR0:TIMSK:TIFR] io_timer.bmp At8pwm0_01 TCCR0 Timer/Counter 0 Control Register $33 $53 io_flag.bmp Y FOC0 Force Output Compare The FOC0 bit is only active when the WGM bits specifies a non-PWM mode. However, for ensuring compatibility with future devices, this bit must be set to zero when TCCR0 is written when operating in PWM mode. When writing a logical one to the FOC0 bit, an immediate compare match is forced on the waveform generation unit. The OC0 output is changed accord-ing to its COM01:0 bits setting. Note that the FOC0 bit is implemented as a strobe. Therefore it is the value present in the COM01:0 bits that determines the effect of the forced compare. A FOC0 strobe will not generate any interrupt, nor will it clear the timer in CTC mode using OCR0 as TOP. The FOC0 bit is always read as zero. W 0 WGM00 PWM0 Waveform Generation Mode 0 These bits control the counting sequence of the counter, the source for the maximum (TOP) counter value, and what type of waveform generation to be used. Modes of operation supported by the Timer/Counter unit are: Normal mode, Clear Timer on Compare match (CTC) mode, and two types of Pulse Width Modulation (PWM) modes. See Table 51 and “Modes of Operation” on page 80. RW 0 COM01 Compare Match Output Mode 1 These bits control the output compare pin (OC0) behavior. If one or both of the COM01:0 bits are set, the OC0 output over-rides the normal port functionality of the I/O pin it is connected to. However, note that the Data Direction Register (DDR) bit corresponding to OC0 pin must be set in order to enable the output driver. When OC0 is connected to the pin, the function of the COM01:0 bits depends on the WGM01:0 bit setting. Table 52 shows the COM01:0 bit functionality when the WGM01:0 bits are set to a normal or CTC mode (non-PWM) RW 0 COM00 Compare match Output Mode 0 These bits control the output compare pin (OC0) behavior. If one or both of the COM01:0 bits are set, the OC0 output over-rides the normal port functionality of the I/O pin it is connected to. However, note that the Data Direction Register (DDR) bit corresponding to OC0 pin must be set in order to enable the output driver. When OC0 is connected to the pin, the function of the COM01:0 bits depends on the WGM01:0 bit setting. Table 52 shows the COM01:0 bit functionality when the WGM01:0 bits are set to a normal or CTC mode (non-PWM) RW 0 WGM01 CTC0 Waveform Generation Mode 1 These bits control the counting sequence of the counter, the source for the maximum (TOP) counter value, and what type of waveform generation to be used. Modes of operation supported by the Timer/Counter unit are: Normal mode, Clear Timer on Compare match (CTC) mode, and two types of Pulse Width Modulation (PWM) modes. See Table 51 and “Modes of Operation” on page 80. RW 0 CS02 Clock Select 2 The three clock select bits select the clock source to be used by the Timer/Counter, RW 0 CS01 Clock Select 1 The three clock select bits select the clock source to be used by the Timer/Counter, RW 0 CS00 Clock Select 1 The three clock select bits select the clock source to be used by the Timer/Counter, RW 0 TCNT0 Timer/Counter 0 Register The Timer/Counter Register gives direct access, both for read and write operations, to the Timer/Counter unit 8-bit counter. Writing to the TCNT0 register blocks (removes) the compare match on the following timer clock. Modifying the counter (TCNT0) while the counter is running, introduces a risk of missing a compare match between TCNT0 the OCR0 register. $32 $52 io_timer.bmp N TCNT0_7 RW 0 TCNT0_6 RW 0 TCNT0_5 RW 0 TCNT0_4 RW 0 TCNT0_3 RW 0 TCNT0_2 RW 0 TCNT0_1 RW 0 TCNT0_0 RW 0 OCR0 Timer/Counter 0 Output Compare Register The Output Compare Register contains an 8-bit value that is continuously compared with the counter value (TCNT0). A match can be used to generate an output compare interrupt, or to generate a waveform output on the OC0 pin. $31 $51 io_timer.bmp N OCR0_7 RW 0 OCR0_6 RW 0 OCR0_5 RW 0 OCR0_4 RW 0 OCR0_3 RW 0 OCR0_2 RW 0 OCR0_1 RW 0 OCR0_0 RW 0 TIMSK Timer/Counter Interrupt Mask Register $39 $59 io_flag.bmp Y TOIE0 Timer/Counter0 Overflow Interrupt Enable When the TOIE0 bit is written to one, and the I-bit in the Status Register is set (one), the Timer/Counter0 Overflow interrupt is enabled. The corresponding interrupt is executed if an overflow in Timer/Counter0 occurs, i.e. when the TOV0 bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 OCIE0 Timer/Counter0 Output Compare Match Interrupt register When the OCIE0 bit is written to one, and the I-bit in the Status Register is set (one), the Timer/Counter0 Compare Match interrupt is enabled. The corresponding interrupt is executed if a compare match in Timer/Counter0 occurs, i.e. when the OCF0 bit is set in the Timer/Counter Interrupt Flag Register - TIFR. RW 0 TIFR Timer/Counter Interrupt Flag register $38 $58 io_flag.bmp Y TOV0 Timer/Counter0 Overflow Flag The bit TOV0 is set (one) when an overflow occurs in Timer/Counter0. TOV0 is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, TOV0 is cleared by writing a logic one to the flag. When the SREG I-bit, TOIE0 (Timer/Counter0 Overflow Interrupt Enable), and TOV0 are set (one), the Timer/Counter0 Overflow interrupt is executed. In PWM mode, this bit is set when Timer/Counter0 changes counting direction at $00. RW 0 OCF0 Output Compare Flag 0 The OCF0 bit is set (one) when a compare match occurs between the Timer/Counter0 and the data in OCR0 - Output Compare Register0. OCF0 is cleared by hardware when executing the corresponding interrupt handling vector. Alterna-tively, OCF0 is cleared by writing a logic one to the flag. When the I-bit in SREG, OCIE0 (Timer/Counter0 Compare match Interrupt Enable), and OCF0 are set (one), the Timer/Counter0 Compare match Interrupt is executed. RW 0 [WDTCR] io_watch.bmp WDTCR WDTCSR Watchdog Timer Control Register $21 $41 io_flag.bmp Y WDCE WDTOE Watchdog Change Enable This bit must be set when the WDE bit is written to logic zero.Otherwise,the watchdog will not be disabled.Once written to one,hardware will clear this bit after four clock cycles.Refer to the description of the WDE bit for a watchdog disable procedure.This bit must also be set when changing the prescaler bits. RW 0 WDE Watch Dog Enable When the WDE is set (one) the Watchdog Timer is enabled, and if the WDE is cleared (zero) the Watchdog Timer function is disabled. WDE can only be cleared if the WDTOE bit is set(one). To disable an enabled watchdog timer, the following procedure must be followed: 1. In the same operation, write a logical one to WDTOE and WDE. A logical one must be written to WDE even though it is set to one before the disable operation starts. 2. Within the next four clock cycles, write a logical 0 to WDE. This disables the watchdog RW 0 WDP2 Watch Dog Timer Prescaler bit 2 The WDP2,WDP1,and WDP0 bits determine the Watchdog Timer prescaling when the Watchdog Timer is enabled. RW 0 WDP1 Watch Dog Timer Prescaler bit 1 The WDP2,WDP1,and WDP0 bits determine the Watchdog Timer prescaling when the Watchdog Timer is enabled. RW 0 WDP0 Watch Dog Timer Prescaler bit 0 The WDP2,WDP1,and WDP0 bits determine the Watchdog Timer prescaling when the Watchdog Timer is enabled. RW 0 [PORTE:DDRE:PINE] io_port.bmp AVRSimIOPort.SimIOPort PORTE Data Register, Port E $07 $27 io_port.bmp N PORTE2 RW 0 PORTE1 RW 0 PORTE0 RW 0 DDRE Data Direction Register, Port E $06 $26 io_flag.bmp N DDE2 RW 0 DDE1 RW 0 DDE0 RW 0 PINE Input Pins, Port E $05 $25 io_port.bmp N PINE3 R 0 PINE2 R 0 PINE1 R 0 PINE0 R 0 [MCUCR:EMCUCR:GICR:GIFR:PCMSK1:PCMSK0] io_ext.bmp MCUCR MCU Control Register $35 $55 io_flag.bmp Y ISC11 Interrupt Sense Control 1 Bit 1 The External Interrupt 1 is activated by the external pin INT1 if the SREG I bit and the corresponding interrupt mask in the GICR are set.The level and edges on the external INT1 pin that activate the interrupt are defined below.The value on the INT1 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. (ISC11:ISC10) Description: (0:0) The low level of INT1 generates an interrupt request. (0:1) Any logical change on INT1 generates an interrupt request. (1:0) The falling edge of INT1 generates an interrupt request. (1:1) The rising edge of INT1 generates an interrupt reques RW 0 ISC10 Interrupt Sense Control 1 Bit 0 The External Interrupt 1 is activated by the external pin INT1 if the SREG I bit and the corresponding interrupt mask in the GICR are set.The level and edges on the external INT1 pin that activate the interrupt are defined below.The value on the INT1 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. (ISC11:ISC10) Description: (0:0) The low level of INT1 generates an interrupt request. (0:1) Any logical change on INT1 generates an interrupt request. (1:0) The falling edge of INT1 generates an interrupt request. (1:1) The rising edge of INT1 generates an interrupt reques RW 0 ISC01 Interrupt Sense Control 0 Bit 1 The External Interrupt 0 is activated by the external pin INT0 if the SREG I flag and the corresponding interrupt mask are set.The level and edges on the external INT0 pin that activate the interrupt are defined below. The value on the INT0 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. (ISC01:ISC00) Description: (0:0) The low level of INT0 generates an interrupt request. (0:1) Any logical change on INT0 generates an interrupt request. (1:0) The falling edge of INT0 generates an interrupt request. (1:1) The rising edge of INT0 generates an interrupt request RW 0 ISC00 Interrupt Sense Control 0 Bit 0 The External Interrupt 0 is activated by the external pin INT0 if the SREG I flag and the corresponding interrupt mask are set.The level and edges on the external INT0 pin that activate the interrupt are defined below. The value on the INT0 pin is sampled before detecting edges.If edge or toggle interrupt is selected,pulses that last longer than one clock period will generate an interrupt.Shorter pulses are not guaranteed to generate an interrupt.If low level interrupt is selected,the low level must be held until the completion of the currently executing instruction to generate an interrupt. (ISC01:ISC00) Description: (0:0) The low level of INT0 generates an interrupt request. (0:1) Any logical change on INT0 generates an interrupt request. (1:0) The falling edge of INT0 generates an interrupt request. (1:1) The rising edge of INT0 generates an interrupt request RW 0 EMCUCR Extended MCU Control Register $36 $56 io_flag.bmp Y ISC2 Interrupt Sense Control 2 The asynchronous external interrupt 2 is activated by the external pin INT2 if the SREG I-bit and the corresponding interrupt mask in GICR are set.If ISC2 is written to zero,a falling edge on INT2 activates the interrupt.If ISC2 is written to one,a rising edge on INT2 activates the interrupt.Edges on INT2 are registered asynchronously.Pulses on INT2 wider than the minimum pulse width given in Table 41 will generate an interrupt. Shorter pulses are not guaranteed to generate an interrupt.When changing the ISC2 bit,an interrupt can occur.Therefore,it is recommended to first disable INT2 by clearing its Interrupt Enable bit in the GICR register.Then,the ISC2 bit can be changed.Finally, the INT2 interruptflag should be cleared by writing a logical one to its Interrupt Flag bit (INTF2)in the GIFR register before the interrupt is re-enabled. RW 0 GICR EIMSK GIMSK General Interrupt Control Register $3B $5B io_flag.bmp Y INT1 External Interrupt Request 1 Enable When the INT1 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), the external pin interrupt is enabled. The Interrupt Sense Control1 bits 1/0 (ISC11 and ISC10) in the MCU general Control Register (MCUCR) defines whether the external interrupt is activated on rising or falling edge of the INT1 pin or level sensed. Activity on the pin will cause an interrupt request even if INT1 is configured as an output. The corresponding interrupt of External Interrupt Request 1 is executed from program memory address $002. See also “External Interrupts”. RW 0 INT0 External Interrupt Request 0 Enable When the INT0 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), the external pin interrupt is enabled. The Interrupt Sense Control0 bits 1/0 (ISC01 and ISC00) in the MCU general Control Register (MCUCR) defines whether the external interrupt is activated on rising or falling edge of the INT0 pin or level sensed. Activity on the pin will cause an interrupt request even if INT0 is configured as an output. The corresponding interrupt of External Interrupt Request 0 is executed from program memory address $001. See also “External Interrupts.” • Bits 5..0 - Res: Reserved bits RW 0 INT2 External Interrupt Request 2 Enable RW 0 PCIE1 Pin Change Interrupt Enable 1 When the PCIE1 bit is set (one)and the I-bit in the Status Register (SREG)is set (one), pin change interrupt 1 is enabled.Any change on any enabled PCINT15..8 pin will cause an interrupt.The corresponding interrupt of Pin Change Interrupt Request is executed from the PCI1 interrupt vector.PCINT15..8 pins are enabled individually by the PCMSK1 register. RW 0 PCIE0 Pin Change Interrupt Enable 0 When the PCIE0 bit is set (one)and the I-bit in the Status Register (SREG)is set (one), RW 0 IVSEL Interrupt Vector Select When the IVSEL bit is cleared (zero),the interrupt vectors are placed at the start of the Flash memory.When this bit is set (one),the interrupt vectors are moved to the beginning of the Boot Loader section of the flash.The actual address of the start of the boot flash section is determined by the BOOTSZ fuses.Refer to the section “Boot Loader Support Read While Write self-programming ”on page 203 for details.To avoid unintentional changes of interrupt vector tables,a special write procedure must be followed to change the IVSEL bit: 1.Write the Interrupt Vector Change Enable (IVCE)bit to one. 2.Within four cycles,write the desired value to IVSEL while writing a zero to IVCE. Interrupts will automatically be disabled while this sequence is executed.Interrupts are disabled in the cycle IVCE is set,and they remain disabled until after the instruction following the write to IVSEL.If IVSEL is not written,interrupts remain disabled for four cycles.The I-bit in the Status Register is unaffected by the automatic disabling. Note:If interrupt vectors are placed in the Boot Loader section and Boot Lock bit BLB02 is programmed,interrupts are disabled while executing from the Application section.If interrupt vectors are placed in the Application section and Boot Lock bit BLB12 is programed,interrupts are disabled while executing from the Boot Loader section.Refer to the section “Boot Loader Support -Read While Write self-programming ”on page 203 for details on Boot Lock bits RW 0 IVCE Interrupt Vector Change Enable The IVCE bit must be written to logic one to enable change of the IVSEL bit.IVCE is cleared by hardware four cycles after it is written or when IVSEL is written.Setting the IVCE bit will disable interrupts. RW 0 GIFR General Interrupt Flag Register $3A $5A io_flag.bmp Y INTF1 External Interrupt Flag 1 When an event on the INT1 pin triggers an interrupt request,INTF1 becomes set (one).If the I bit in SREG and the INT1 bit in GICR are set (one),the MCU will jump to the corresponding interrupt vector.The flag is cleared when the interrupt routine is executed.Alternatively,the flag can be cleared by writing a logical one to it.This flag is always cleared when INT1 is configured as a level interrupt. RW 0 INTF0 External Interrupt Flag 0 When an event on the INT0 pin triggers an interrupt request,INTF0 becomes set (one).If the I bit in SREG and the INT0 bit in GICR are set (one),the MCU will jump to the corresponding interrupt vector.The flag is cleared when the interrupt rou tine is executed.Alternatively,the flag can be cleared by writing a logical one to it.This flag is always cleared when INT0 is configured as a level interrupt. RW 0 INTF2 External Interrupt Flag 2 When an event on the INT2 pin triggers an interrupt request,INTF2 becomes set (one).If the I bit in SREG and the INT2 bit in GICR are set (one),the MCU will jump to the corresponding interrupt vector.The flag is cleared when the interrupt rou tine is executed.Alternatively,the flag can be cleared by writing a logical one to it.Note that when entering some sleep modes with the INT2 interrupt disabled,the input buffer on this pin will be disabled.This may cause a logic change in inter nal signals which will set the INTF2 flag RW 0 PCIF1 Pin Change Interrupt Flag 1 When a logic change on any PCINT15..8 pin triggers an interrupt request,PCIF1 becomes set (one).If the I-bit in SREG and the PCIE1 bit in EIMSK are set (one),the MCU will jump to the corresponding interrupt vector.The flag is cleared when the interrupt routine is executed.Alternatively,the flag can be cleared by writing a logical one to it. RW 0 PCIF0 Pin Change Interrupt Flag 0 When a logic change on any PCINT7..0 pin triggers an interrupt request,PCIF0 becomes set (one).If the I-bit in SREG and the PCIE0 bit in EIMSK are set (one),the MCU will jump to the corresponding interrupt vector.The flag is cleared when the interrupt routine is executed.Alternatively,the flag can be cleared by writing a logical one to it. RW 0 PCMSK1 Pin Change Mask Register 1 Each PCINT15..8 bit selects whether pin change interrupt is enabled on the corresponding I/O pin.If PCINT15..8 is set and the PCIE1 bit in EIMSK is set,pin change interrupt is enabled on the corresponding I/O pin.If PCINT15..8 is cleared,pin change interrupt on the corresponding I/O pin is disabled. NA $6C io_flag.bmp N PCINT15 Pin Change Enable Mask 15 RW 0 PCINT14 Pin Change Enable Mask 14 RW 0 PCINT13 Pin Change Enable Mask 13 RW 0 PCINT12 Pin Change Enable Mask 12 R 0 PCINT11 Pin Change Enable Mask 11 R 0 PCINT10 Pin Change Enable Mask 10 RW 0 PCINT9 Pin Change Enable Mask 9 RW 0 PCINT8 Pin Change Enable Mask 8 RW 0 PCMSK0 Pin Change Enable Mask Each PCINT7..0 bit selects whether pin change interrupt is enabled on the corresponding I/O pin.If PCINT7..0 is set and the PCIE0 bit in EIMSK is set,pin change interrupt is enabled on the corresponding I/O pin.If PCINT7..0 is cleared,pin change interrupt on the corresponding I/O pin is disabled. NA $6B io_flag.bmp N PCINT7 Pin Change Enable Mask 7 RW 0 PCINT6 Pin Change Enable Mask 6 RW 0 PCINT5 Pin Change Enable Mask 5 RW 0 PCINT4 Pin Change Enable Mask 4 R 0 PCINT3 Pin Change Enable Mask 3 R 0 PCINT2 Pin Change Enable Mask 2 RW 0 PCINT1 Pin Change Enable Mask 1 RW 0 PCINT0 Pin Change Enable Mask 0 RW 0 [ICE50:SIMULATOR:JTAGICEmkII:STK500:STK500_2:AVRISPmkII] 0x05 0x0F 0x0F 0x0F 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x05 0x0F 0x0F 0x0F 0x15 0x14 0x14 0x000004FF 0x00000000 0x00000000 0x00000000 0x000001FF 0x00003FFF 0x00001FFF 0x00001FFF 0x00001FFF 0x00001FFF 0x000004FF 0x0000FFFF 0x000001FF 0x00000000 0x00000000 0x00000000 0x0023FFFF 0x00000FFF 0x000000FF 0x0000FFFF 0x00000000 0x00000000 0x00000000 0x000001FF 0x00003FFF 0x00001FFF 0x00001FFF 0x00001FFF 0x00001FFF 0x0000FFFF 0x0000FFFF 0x000001FF 0x00000000 0x00000000 0x00000000 0x0023FFFF 0x00000FFF 0x000000FF 0x000004FF 0x00000000 0x00000000 0x00000000 0x000001FF 0x00003FFF 0x00001FFF 0x00001FFF 0x00001FFF 0x00001FFF 0x000004FF 0x0000FFFF 0x000001FF 0x00000000 0x00000000 0x00000000 0x0023FFFF 0x00000FFF 0x0000FFFF 0xF9 0xff 0x62 0xff 0x24 0x67 ATmega162.bin 0x02 0x00 1000000 40000000 2 ; INTOSC = 1, INTRC=2;EXTCLK=4 1 ;NOTUSE = 1, EXTERNAL = 4, INTERNAL = 2 1 0 0x00 0x01 8 0x00000600 0x00000600 Boot Size 128 Words, 2 pages, $1F80-$1FFF, Boot reset $1F80 0x00000600 0x00000400 Boot Size 256 Words, 4 pages, $1F00-$1FFF, Boot reset $1F00 0x00000600 0x00000200 Boot Size 512 Words, 8 pages, $1E00-$1FFF, Boot reset $1E00 0x00000600 0x00000000 Boot Size 1024 Words, 16 pages, $1C00-$1FFF, Boot reset $1C00 0x00000031 0x00000000 258 CK, 4 ms 0x00000031 0x00000010 258 CK, 64 ms 0x00000031 0x00000020 1K CK 0x00000031 0x00000030 1K CK, 4 ms 0x00000031 0x00000001 1K CK, 64 ms 0x00000031 0x00000011 16K CK 0x00000031 0x00000021 16K CK, 4 ms 0x00000031 0x00000031 16K CK, 64 ms 0x00000030 0x00000000 6 CK 0x00000030 0x00000010 6 CK, 4 ms 0x00000030 0x00000020 6 CK, 64 ms 0x00000030 0x00000000 6 CK 0x00000030 0x00000010 6 CK, 4 ms 0x00000030 0x00000020 6 CK, 64 ms 0x0000003f 0x0000002b 0x0000003f 0x00000024 8.0 0x0000000f 0x00000000 0x00000100 0x00000100 Application reset, address $0 0x00000100 0x00000000 Boot loader reset 0x0c000000 0x0c000000 No restrictions for SPM or (E)LPM 0x0c000000 0x08000000 No write to the Application section 0x0c000000 0x00000000 No write to Application section, No read from the Application section 0x0c000000 0x04000000 No read from the Application section 0x30000000 0x30000000 No restrictions for SPM or (E)LPM 0x30000000 0x20000000 No write to the Boot Loader section 0x30000000 0x00000000 No write to Boot Loader section, No read from the Boot Loader section 0x30000000 0x10000000 No read from the Boot Loader section 0x00001000 0x00000000 Watchdog always ON 0x00001000 0x00001000 Watchdog disabled 8 0x00000080 0x00000000 CLKDIV8 Fuse 0x00000080 0x00000080 CLKDIV8 Fuse 0x00000040 0x00000000 CKOUT Fuse 0x00000040 0x00000040 CKOUT Fuse 0x000E0000 0x000E0000 BOD disabled 0x000E0000 0x000C0000 BOD enabled, 1.8 V 0x000E0000 0x000A0000 BOD enabled, 2.7 V 0x000E0000 0x00080000 BOD enabled, 4.0 V AVRSimCoreV2.SimCoreV2 AVRSimMemory8bit.SimMemory8bit AVRSimInterrupt.SimInterrupt 0x32 0 19 AVRSimIOPort.SimIOPort N AVRSimIOPort.SimIOPort N AVRSimIOPort.SimIOPort N AVRSimIOPort.SimIOPort N AVRSimIOPort.SimIOPort N AVRSimIOExtInterrupt.SimIOExtInterrupt 0x02 0x3B 0x40 0x3A 0x40 0x10 0x04 0x35 0x03 AVRSimIOExtInterrupt.SimIOExtInterrupt 0x04 0x3B 0x80 0x3A 0x80 0x10 0x08 0x35 0x0c AVRSimIOExtInterrupt.SimIOExtInterrupt 0x06 0x3B 0x20 0x3A 0x20 0x05 0x01 0x36 0x01 AVRSimIOPinChangeInterrupt.SimIOPinChangeInterrupt 0x08 0x3B 0x08 0x3A 0x08 0x4b 0x19 0xff AVRSimIOPinChangeInterrupt.SimIOPinChangeInterrupt 0x0A 0x3b 0x10 0x3a 0x10 0x13 0xff 0x4c AvrMasterTimer.MasterTimer 0x20 0x22 PORTB 0 0x16 0x01 1:8:64:256:1024 AVRSimIOTimert16pwm1.SimIOTimert16pwm1 0x18 0x1A 0x1C 0x1E 0x16 0x02 0x05 0x01 0x12 0x20 0x07 0x04 1:8:64:256:1024 AvrMasterTimer.MasterTimer 0x14 0x16 PORTB 1 1:8:32:64:128:256:1024 AVRSimIOTimert16pwm1.SimIOTimert16pwm1 0x0c 0x0e 0x10 0x12 0x00 0x00 0x10 0x08 0x12 0x10 0x18 0x10 1:8:16:32:64:256:1024 AVRSimIOSPM.SimIOSPM 0x36 AVRSimIOSpi.SimIOSpi 0x24 0x16 0x80 0x16 0x40 0x16 0x20 0x16 0x17 0x10 AVRSimIOUsart.SimIOUsart 0x26 0x2e 0x2a 0x10 0x02 0x10 0x01 AVRSimIOUsart.SimIOUsart 0x28 0x30 0x2c 0x16 0x08 0x16 0x04 AvrMasterTimer.MasterTimer 0 16384:32768:65536:131072:262144:524288:1048576:2097152 AVRSimAC.SimIOAC 0x34 0x0 0x0 0x0 0x0 0x0940403F JTAG 0xE7,0x6F,0xFF,0xFF,0xFE,0xFF,0xFF,0xEF 0xC3,0x26,0xB6,0xFD,0xFE,0xFF,0xFF,0xEA 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X10 0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X10 0x02,0x18,0x00,0x30,0xF3,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 0x02,0x18,0x00,0x20,0xF3,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 0x04 0X57 0X00 128 4 0x1F80 0x1F80 0x1F00 0x1E00 0x1C00 0xBB 0x4000 0x0000,32 0x0020,64 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3e 0x3d 0x00 0x00 0x04 0x01 0x00 0x01 0x3c 0x83 1 1 1 0xFF 0xFF 0xFF 0 2001002532030x53111000x41128100x400x4C0x000x000x000x414200xC10xC20x000x000x0025625644440x0E 0x1E 0x0F 0x1F 0x2E 0x3E 0x2F 0x3F 0x4E 0x5E 0x4F 0x5F 0x6E 0x7E 0x6F 0x7F 0x66 0x76 0x67 0x77 0x6A 0x7A 0x6B 0x7B 0xBE 0xFD 0x00 0x01 0x00 0x00 0x00 0x00100060000151501050x0F25625650x052562560505