;***** THIS IS A MACHINE GENERATED FILE - DO NOT EDIT ******************** ;***** Created: 2009-11-03 14:40 ******* Source: ATtiny2313.xml ********** ;************************************************************************* ;* A P P L I C A T I O N N O T E F O R T H E A V R F A M I L Y ;* ;* Number : AVR000 ;* File Name : "tn2313def.inc" ;* Title : Register/Bit Definitions for the ATtiny2313 ;* Date : 2009-11-03 ;* Version : 2.35 ;* Support E-mail : avr@atmel.com ;* Target MCU : ATtiny2313 ;* ;* DESCRIPTION ;* When including this file in the assembly program file, all I/O register ;* names and I/O register bit names appearing in the data book can be used. ;* In addition, the six registers forming the three data pointers X, Y and ;* Z have been assigned names XL - ZH. Highest RAM address for Internal ;* SRAM is also defined ;* ;* The Register names are represented by their hexadecimal address. ;* ;* The Register Bit names are represented by their bit number (0-7). ;* ;* Please observe the difference in using the bit names with instructions ;* such as "sbr"/"cbr" (set/clear bit in register) and "sbrs"/"sbrc" ;* (skip if bit in register set/cleared). The following example illustrates ;* this: ;* ;* in r16,PORTB ;read PORTB latch ;* sbr r16,(1<<PB6)+(1<<PB5) ;set PB6 and PB5 (use masks, not bit#) ;* out PORTB,r16 ;output to PORTB ;* ;* in r16,TIFR ;read the Timer Interrupt Flag Register ;* sbrc r16,TOV0 ;test the overflow flag (use bit#) ;* rjmp TOV0_is_set ;jump if set ;* ... ;otherwise do something else ;*************************************************************************
#ifndef _TN2313DEF_INC_ #define _TN2313DEF_INC_
#pragma partinc 0
; ***** SPECIFY DEVICE *************************************************** .device ATtiny2313 #pragma AVRPART ADMIN PART_NAME ATtiny2313 .equ SIGNATURE_000 = 0x1e .equ SIGNATURE_001 = 0x91 .equ SIGNATURE_002 = 0x0a
#pragma AVRPART CORE CORE_VERSION V2 #pragma AVRPART CORE NEW_INSTRUCTIONS lpm rd,z+
; ***** I/O REGISTER DEFINITIONS ***************************************** ; NOTE: ; Definitions marked "MEMORY MAPPED"are extended I/O ports ; and cannot be used with IN/OUT instructions .equ SREG = 0x3f .equ SPL = 0x3d .equ OCR0B = 0x3c .equ GIMSK = 0x3b .equ EIFR = 0x3a .equ TIMSK = 0x39 .equ TIFR = 0x38 .equ SPMCSR = 0x37 .equ OCR0A = 0x36 .equ MCUCR = 0x35 .equ MCUSR = 0x34 .equ TCCR0B = 0x33 .equ TCNT0 = 0x32 .equ OSCCAL = 0x31 .equ TCCR0A = 0x30 .equ TCCR1A = 0x2f .equ TCCR1B = 0x2e .equ TCNT1L = 0x2c .equ TCNT1H = 0x2d .equ OCR1AL = 0x2a .equ OCR1AH = 0x2b .equ OCR1BL = 0x28 .equ OCR1BH = 0x29 .equ CLKPR = 0x26 .equ ICR1L = 0x24 .equ ICR1H = 0x25 .equ GTCCR = 0x23 .equ TCCR1C = 0x22 .equ WDTCR = 0x21 .equ PCMSK = 0x20 .equ EEAR = 0x1e .equ EEDR = 0x1d .equ EECR = 0x1c .equ PORTA = 0x1b .equ DDRA = 0x1a .equ PINA = 0x19 .equ PORTB = 0x18 .equ DDRB = 0x17 .equ PINB = 0x16 .equ GPIOR2 = 0x15 .equ GPIOR1 = 0x14 .equ GPIOR0 = 0x13 .equ PORTD = 0x12 .equ DDRD = 0x11 .equ PIND = 0x10 .equ USIDR = 0x0f .equ USISR = 0x0e .equ USICR = 0x0d .equ UDR = 0x0c .equ UCSRA = 0x0b .equ UCSRB = 0x0a .equ UBRRL = 0x09 .equ ACSR = 0x08 .equ UCSRC = 0x03 .equ UBRRH = 0x02 .equ DIDR = 0x01
; ***** BIT DEFINITIONS **************************************************
; ***** PORTB ************************ ; PORTB - Port B Data Register .equ PORTB0 = 0 ; Port B Data Register bit 0 .equ PB0 = 0 ; For compatibility .equ PORTB1 = 1 ; Port B Data Register bit 1 .equ PB1 = 1 ; For compatibility .equ PORTB2 = 2 ; Port B Data Register bit 2 .equ PB2 = 2 ; For compatibility .equ PORTB3 = 3 ; Port B Data Register bit 3 .equ PB3 = 3 ; For compatibility .equ PORTB4 = 4 ; Port B Data Register bit 4 .equ PB4 = 4 ; For compatibility .equ PORTB5 = 5 ; Port B Data Register bit 5 .equ PB5 = 5 ; For compatibility .equ PORTB6 = 6 ; Port B Data Register bit 6 .equ PB6 = 6 ; For compatibility .equ PORTB7 = 7 ; Port B Data Register bit 7 .equ PB7 = 7 ; For compatibility
; DDRB - Port B Data Direction Register .equ DDB0 = 0 ; Port B Data Direction Register bit 0 .equ DDB1 = 1 ; Port B Data Direction Register bit 1 .equ DDB2 = 2 ; Port B Data Direction Register bit 2 .equ DDB3 = 3 ; Port B Data Direction Register bit 3 .equ DDB4 = 4 ; Port B Data Direction Register bit 4 .equ DDB5 = 5 ; Port B Data Direction Register bit 5 .equ DDB6 = 6 ; Port B Data Direction Register bit 6 .equ DDB7 = 7 ; Port B Data Direction Register bit 7
; PINB - Port B Input Pins .equ PINB0 = 0 ; Port B Input Pins bit 0 .equ PINB1 = 1 ; Port B Input Pins bit 1 .equ PINB2 = 2 ; Port B Input Pins bit 2 .equ PINB3 = 3 ; Port B Input Pins bit 3 .equ PINB4 = 4 ; Port B Input Pins bit 4 .equ PINB5 = 5 ; Port B Input Pins bit 5 .equ PINB6 = 6 ; Port B Input Pins bit 6 .equ PINB7 = 7 ; Port B Input Pins bit 7
; ***** TIMER_COUNTER_0 ************** ; TIMSK - Timer/Counter Interrupt Mask Register .equ OCIE0A = 0 ; Timer/Counter0 Output Compare Match A Interrupt Enable .equ TOIE0 = 1 ; Timer/Counter0 Overflow Interrupt Enable .equ OCIE0B = 2 ; Timer/Counter0 Output Compare Match B Interrupt Enable
; TIFR - Timer/Counter Interrupt Flag register .equ OCF0A = 0 ; Timer/Counter0 Output Compare Flag 0A .equ TOV0 = 1 ; Timer/Counter0 Overflow Flag .equ OCF0B = 2 ; Timer/Counter0 Output Compare Flag 0B
; OCR0B - Timer/Counter0 Output Compare Register .equ OCR0_0 = 0 ; .equ OCR0_1 = 1 ; .equ OCR0_2 = 2 ; .equ OCR0_3 = 3 ; .equ OCR0_4 = 4 ; .equ OCR0_5 = 5 ; .equ OCR0_6 = 6 ; .equ OCR0_7 = 7 ;
; OCR0A - Timer/Counter0 Output Compare Register .equ OCR0A_0 = 0 ; .equ OCR0A_1 = 1 ; .equ OCR0A_2 = 2 ; .equ OCR0A_3 = 3 ; .equ OCR0A_4 = 4 ; .equ OCR0A_5 = 5 ; .equ OCR0A_6 = 6 ; .equ OCR0A_7 = 7 ;
; TCCR0A - Timer/Counter Control Register A .equ WGM00 = 0 ; Waveform Generation Mode .equ WGM01 = 1 ; Waveform Generation Mode .equ COM0B0 = 4 ; Compare Match Output B Mode .equ COM0B1 = 5 ; Compare Match Output B Mode .equ COM0A0 = 6 ; Compare Match Output A Mode .equ COM0A1 = 7 ; Compare Match Output A Mode
; TCNT0 - Timer/Counter0 .equ TCNT0_0 = 0 ; .equ TCNT0_1 = 1 ; .equ TCNT0_2 = 2 ; .equ TCNT0_3 = 3 ; .equ TCNT0_4 = 4 ; .equ TCNT0_5 = 5 ; .equ TCNT0_6 = 6 ; .equ TCNT0_7 = 7 ;
; TCCR0B - Timer/Counter Control Register B .equ TCCR0 = TCCR0B ; For compatibility .equ CS00 = 0 ; Clock Select .equ CS01 = 1 ; Clock Select .equ CS02 = 2 ; Clock Select .equ WGM02 = 3 ; .equ FOC0B = 6 ; Force Output Compare B .equ FOC0A = 7 ; Force Output Compare B
; ***** TIMER_COUNTER_1 ************** ; TIMSK - Timer/Counter Interrupt Mask Register .equ ICIE1 = 3 ; Timer/Counter1 Input Capture Interrupt Enable .equ TICIE = ICIE1 ; For compatibility .equ OCIE1B = 5 ; Timer/Counter1 Output CompareB Match Interrupt Enable .equ OCIE1A = 6 ; Timer/Counter1 Output CompareA Match Interrupt Enable .equ TOIE1 = 7 ; Timer/Counter1 Overflow Interrupt Enable
; TIFR - Timer/Counter Interrupt Flag register .equ ICF1 = 3 ; Input Capture Flag 1 .equ OCF1B = 5 ; Output Compare Flag 1B .equ OCF1A = 6 ; Output Compare Flag 1A .equ TOV1 = 7 ; Timer/Counter1 Overflow Flag
; TCCR1A - Timer/Counter1 Control Register A .equ WGM10 = 0 ; Pulse Width Modulator Select Bit 0 .equ PWM10 = WGM10 ; For compatibility .equ WGM11 = 1 ; Pulse Width Modulator Select Bit 1 .equ PWM11 = WGM11 ; For compatibility .equ COM1B0 = 4 ; Comparet Ouput Mode 1B, bit 0 .equ COM1B1 = 5 ; Compare Output Mode 1B, bit 1 .equ COM1A0 = 6 ; Comparet Ouput Mode 1A, bit 0 .equ COM1A1 = 7 ; Compare Output Mode 1A, bit 1
; TCCR1B - Timer/Counter1 Control Register B .equ CS10 = 0 ; Clock Select bit 0 .equ CS11 = 1 ; Clock Select 1 bit 1 .equ CS12 = 2 ; Clock Select1 bit 2 .equ WGM12 = 3 ; Waveform Generation Mode Bit 2 .equ CTC1 = WGM12 ; For compatibility .equ WGM13 = 4 ; Waveform Generation Mode Bit 3 .equ ICES1 = 6 ; Input Capture 1 Edge Select .equ ICNC1 = 7 ; Input Capture 1 Noise Canceler
; TCCR1C - Timer/Counter1 Control Register C .equ FOC1B = 6 ; Force Output Compare for Channel B .equ FOC1A = 7 ; Force Output Compare for Channel A
; ***** WATCHDOG ********************* ; WDTCR - Watchdog Timer Control Register .equ WDTCSR = WDTCR ; For compatibility .equ WDP0 = 0 ; Watch Dog Timer Prescaler bit 0 .equ WDP1 = 1 ; Watch Dog Timer Prescaler bit 1 .equ WDP2 = 2 ; Watch Dog Timer Prescaler bit 2 .equ WDE = 3 ; Watch Dog Enable .equ WDCE = 4 ; Watchdog Change Enable .equ WDTOE = WDCE ; For compatibility .equ WDP3 = 5 ; Watchdog Timer Prescaler Bit 3 .equ WDIE = 6 ; Watchdog Timeout Interrupt Enable .equ WDIF = 7 ; Watchdog Timeout Interrupt Flag
; ***** EXTERNAL_INTERRUPT *********** ; GIMSK - General Interrupt Mask Register .equ PCIE = 5 ; .equ INT0 = 6 ; External Interrupt Request 0 Enable .equ INT1 = 7 ; External Interrupt Request 1 Enable
; EIFR - Extended Interrupt Flag Register .equ GIFR = EIFR ; For compatibility .equ PCIF = 5 ; .equ INTF0 = 6 ; External Interrupt Flag 0 .equ INTF1 = 7 ; External Interrupt Flag 1
; ***** USART ************************ ; UDR - USART I/O Data Register .equ UDR0 = 0 ; USART I/O Data Register bit 0 .equ UDR1 = 1 ; USART I/O Data Register bit 1 .equ UDR2 = 2 ; USART I/O Data Register bit 2 .equ UDR3 = 3 ; USART I/O Data Register bit 3 .equ UDR4 = 4 ; USART I/O Data Register bit 4 .equ UDR5 = 5 ; USART I/O Data Register bit 5 .equ UDR6 = 6 ; USART I/O Data Register bit 6 .equ UDR7 = 7 ; USART I/O Data Register bit 7
; UCSRA - USART Control and Status Register A .equ USR = UCSRA ; For compatibility .equ MPCM = 0 ; Multi-processor Communication Mode .equ U2X = 1 ; Double the USART Transmission Speed .equ UPE = 2 ; USART Parity Error .equ PE = UPE ; For compatibility .equ DOR = 3 ; Data overRun .equ FE = 4 ; Framing Error .equ UDRE = 5 ; USART Data Register Empty .equ TXC = 6 ; USART Transmitt Complete .equ RXC = 7 ; USART Receive Complete
; UCSRB - USART Control and Status Register B .equ UCR = UCSRB ; For compatibility .equ TXB8 = 0 ; Transmit Data Bit 8 .equ RXB8 = 1 ; Receive Data Bit 8 .equ UCSZ2 = 2 ; Character Size .equ CHR9 = UCSZ2 ; For compatibility .equ TXEN = 3 ; Transmitter Enable .equ RXEN = 4 ; Receiver Enable .equ UDRIE = 5 ; USART Data register Empty Interrupt Enable .equ TXCIE = 6 ; TX Complete Interrupt Enable .equ RXCIE = 7 ; RX Complete Interrupt Enable
; UCSRC - USART Control and Status Register C .equ UCPOL = 0 ; Clock Polarity .equ UCSZ0 = 1 ; Character Size Bit 0 .equ UCSZ1 = 2 ; Character Size Bit 1 .equ USBS = 3 ; Stop Bit Select .equ UPM0 = 4 ; Parity Mode Bit 0 .equ UPM1 = 5 ; Parity Mode Bit 1 .equ UMSEL = 6 ; USART Mode Select
.equ UBRR = UBRRL ; For compatibility
; ***** ANALOG_COMPARATOR ************ ; ACSR - Analog Comparator Control And Status Register .equ ACIS0 = 0 ; Analog Comparator Interrupt Mode Select bit 0 .equ ACIS1 = 1 ; Analog Comparator Interrupt Mode Select bit 1 .equ ACIC = 2 ; .equ ACIE = 3 ; Analog Comparator Interrupt Enable .equ ACI = 4 ; Analog Comparator Interrupt Flag .equ ACO = 5 ; Analog Compare Output .equ ACBG = 6 ; Analog Comparator Bandgap Select .equ ACD = 7 ; Analog Comparator Disable
; DIDR - Digital Input Disable Register 1 .equ AIN0D = 0 ; AIN0 Digital Input Disable .equ AIN1D = 1 ; AIN1 Digital Input Disable
; ***** PORTD ************************ ; PORTD - Data Register, Port D .equ PORTD0 = 0 ; .equ PD0 = 0 ; For compatibility .equ PORTD1 = 1 ; .equ PD1 = 1 ; For compatibility .equ PORTD2 = 2 ; .equ PD2 = 2 ; For compatibility .equ PORTD3 = 3 ; .equ PD3 = 3 ; For compatibility .equ PORTD4 = 4 ; .equ PD4 = 4 ; For compatibility .equ PORTD5 = 5 ; .equ PD5 = 5 ; For compatibility .equ PORTD6 = 6 ; .equ PD6 = 6 ; For compatibility
; DDRD - Data Direction Register, Port D .equ DDD0 = 0 ; .equ DDD1 = 1 ; .equ DDD2 = 2 ; .equ DDD3 = 3 ; .equ DDD4 = 4 ; .equ DDD5 = 5 ; .equ DDD6 = 6 ;
; PIND - Input Pins, Port D .equ PIND0 = 0 ; .equ PIND1 = 1 ; .equ PIND2 = 2 ; .equ PIND3 = 3 ; .equ PIND4 = 4 ; .equ PIND5 = 5 ; .equ PIND6 = 6 ;
; ***** EEPROM *********************** ; EEAR - EEPROM Read/Write Access .equ EEARL = EEAR ; For compatibility .equ EEAR0 = 0 ; EEPROM Read/Write Access bit 0 .equ EEAR1 = 1 ; EEPROM Read/Write Access bit 1 .equ EEAR2 = 2 ; EEPROM Read/Write Access bit 2 .equ EEAR3 = 3 ; EEPROM Read/Write Access bit 3 .equ EEAR4 = 4 ; EEPROM Read/Write Access bit 4 .equ EEAR5 = 5 ; EEPROM Read/Write Access bit 5 .equ EEAR6 = 6 ; EEPROM Read/Write Access bit 6
; EEDR - EEPROM Data Register .equ EEDR0 = 0 ; EEPROM Data Register bit 0 .equ EEDR1 = 1 ; EEPROM Data Register bit 1 .equ EEDR2 = 2 ; EEPROM Data Register bit 2 .equ EEDR3 = 3 ; EEPROM Data Register bit 3 .equ EEDR4 = 4 ; EEPROM Data Register bit 4 .equ EEDR5 = 5 ; EEPROM Data Register bit 5 .equ EEDR6 = 6 ; EEPROM Data Register bit 6 .equ EEDR7 = 7 ; EEPROM Data Register bit 7
; EECR - EEPROM Control Register .equ EERE = 0 ; EEPROM Read Enable .equ EEPE = 1 ; EEPROM Write Enable .equ EEWE = EEPE ; For compatibility .equ EEMPE = 2 ; EEPROM Master Write Enable .equ EEMWE = EEMPE ; For compatibility .equ EERIE = 3 ; EEProm Ready Interrupt Enable .equ EEPM0 = 4 ; .equ EEPM1 = 5 ;
; ***** PORTA ************************ ; PORTA - Port A Data Register .equ PORTA0 = 0 ; Port A Data Register bit 0 .equ PA0 = 0 ; For compatibility .equ PORTA1 = 1 ; Port A Data Register bit 1 .equ PA1 = 1 ; For compatibility .equ PORTA2 = 2 ; Port A Data Register bit 2 .equ PA2 = 2 ; For compatibility
; DDRA - Port A Data Direction Register .equ DDA0 = 0 ; Data Direction Register, Port A, bit 0 .equ DDA1 = 1 ; Data Direction Register, Port A, bit 1 .equ DDA2 = 2 ; Data Direction Register, Port A, bit 2
; PINA - Port A Input Pins .equ PINA0 = 0 ; Input Pins, Port A bit 0 .equ PINA1 = 1 ; Input Pins, Port A bit 1 .equ PINA2 = 2 ; Input Pins, Port A bit 2
; ***** CPU ************************** ; SREG - Status Register .equ SREG_C = 0 ; Carry Flag .equ SREG_Z = 1 ; Zero Flag .equ SREG_N = 2 ; Negative Flag .equ SREG_V = 3 ; Two's Complement Overflow Flag .equ SREG_S = 4 ; Sign Bit .equ SREG_H = 5 ; Half Carry Flag .equ SREG_T = 6 ; Bit Copy Storage .equ SREG_I = 7 ; Global Interrupt Enable
; SPMCSR - Store Program Memory Control and Status register .equ SPMEN = 0 ; Store Program Memory Enable .equ PGERS = 1 ; Page Erase .equ PGWRT = 2 ; Page Write .equ RFLB = 3 ; Read Fuse and Lock Bits .equ CTPB = 4 ; Clear Temporary Page Buffer
; MCUCR - MCU Control Register .equ ISC00 = 0 ; Interrupt Sense Control 0 bit 0 .equ ISC01 = 1 ; Interrupt Sense Control 0 bit 1 .equ ISC10 = 2 ; Interrupt Sense Control 1 bit 0 .equ ISC11 = 3 ; Interrupt Sense Control 1 bit 1 .equ SM0 = 4 ; Sleep Mode Select Bit 0 .equ SM = SM0 ; For compatibility .equ SE = 5 ; Sleep Enable .equ SM1 = 6 ; Sleep Mode Select Bit 1 .equ PUD = 7 ; Pull-up Disable
; CLKPR - Clock Prescale Register .equ CLKPS0 = 0 ; Clock Prescaler Select Bit 0 .equ CLKPS1 = 1 ; Clock Prescaler Select Bit 1 .equ CLKPS2 = 2 ; Clock Prescaler Select Bit 2 .equ CLKPS3 = 3 ; Clock Prescaler Select Bit 3 .equ CLKPCE = 7 ; Clock Prescaler Change Enable
; MCUSR - MCU Status register .equ PORF = 0 ; Power-On Reset Flag .equ EXTRF = 1 ; External Reset Flag .equ BORF = 2 ; Brown-out Reset Flag .equ WDRF = 3 ; Watchdog Reset Flag
; OSCCAL - Oscillator Calibration Register .equ CAL0 = 0 ; Oscillatro Calibration Value Bit 0 .equ CAL1 = 1 ; Oscillatro Calibration Value Bit 1 .equ CAL2 = 2 ; Oscillatro Calibration Value Bit 2 .equ CAL3 = 3 ; Oscillatro Calibration Value Bit 3 .equ CAL4 = 4 ; Oscillatro Calibration Value Bit 4 .equ CAL5 = 5 ; Oscillatro Calibration Value Bit 5 .equ CAL6 = 6 ; Oscillatro Calibration Value Bit 6
; GTCCR - General Timer Counter Control Register .equ SFIOR = GTCCR ; For compatibility .equ PSR10 = 0 ;
; PCMSK - Pin-Change Mask register .equ PCINT0 = 0 ; Pin-Change Interrupt 0 .equ PCINT1 = 1 ; Pin-Change Interrupt 1 .equ PCINT2 = 2 ; Pin-Change Interrupt 2 .equ PCINT3 = 3 ; Pin-Change Interrupt 3 .equ PCINT4 = 4 ; Pin-Change Interrupt 4 .equ PCINT5 = 5 ; Pin-Change Interrupt 5 .equ PCINT6 = 6 ; Pin-Change Interrupt 6 .equ PCINT7 = 7 ; Pin-Change Interrupt 7
; GPIOR2 - General Purpose I/O Register 2 .equ GPIOR20 = 0 ; General Purpose I/O Register 2 bit 0 .equ GPIOR21 = 1 ; General Purpose I/O Register 2 bit 1 .equ GPIOR22 = 2 ; General Purpose I/O Register 2 bit 2 .equ GPIOR23 = 3 ; General Purpose I/O Register 2 bit 3 .equ GPIOR24 = 4 ; General Purpose I/O Register 2 bit 4 .equ GPIOR25 = 5 ; General Purpose I/O Register 2 bit 5 .equ GPIOR26 = 6 ; General Purpose I/O Register 2 bit 6 .equ GPIOR27 = 7 ; General Purpose I/O Register 2 bit 7
; GPIOR1 - General Purpose I/O Register 1 .equ GPIOR10 = 0 ; General Purpose I/O Register 1 bit 0 .equ GPIOR11 = 1 ; General Purpose I/O Register 1 bit 1 .equ GPIOR12 = 2 ; General Purpose I/O Register 1 bit 2 .equ GPIOR13 = 3 ; General Purpose I/O Register 1 bit 3 .equ GPIOR14 = 4 ; General Purpose I/O Register 1 bit 4 .equ GPIOR15 = 5 ; General Purpose I/O Register 1 bit 5 .equ GPIOR16 = 6 ; General Purpose I/O Register 1 bit 6 .equ GPIOR17 = 7 ; General Purpose I/O Register 1 bit 7
; GPIOR0 - General Purpose I/O Register 0 .equ GPIOR00 = 0 ; General Purpose I/O Register 0 bit 0 .equ GPIOR01 = 1 ; General Purpose I/O Register 0 bit 1 .equ GPIOR02 = 2 ; General Purpose I/O Register 0 bit 2 .equ GPIOR03 = 3 ; General Purpose I/O Register 0 bit 3 .equ GPIOR04 = 4 ; General Purpose I/O Register 0 bit 4 .equ GPIOR05 = 5 ; General Purpose I/O Register 0 bit 5 .equ GPIOR06 = 6 ; General Purpose I/O Register 0 bit 6 .equ GPIOR07 = 7 ; General Purpose I/O Register 0 bit 7
; ***** USI ************************** ; USIDR - USI Data Register .equ USIDR0 = 0 ; USI Data Register bit 0 .equ USIDR1 = 1 ; USI Data Register bit 1 .equ USIDR2 = 2 ; USI Data Register bit 2 .equ USIDR3 = 3 ; USI Data Register bit 3 .equ USIDR4 = 4 ; USI Data Register bit 4 .equ USIDR5 = 5 ; USI Data Register bit 5 .equ USIDR6 = 6 ; USI Data Register bit 6 .equ USIDR7 = 7 ; USI Data Register bit 7
; USISR - USI Status Register .equ USICNT0 = 0 ; USI Counter Value Bit 0 .equ USICNT1 = 1 ; USI Counter Value Bit 1 .equ USICNT2 = 2 ; USI Counter Value Bit 2 .equ USICNT3 = 3 ; USI Counter Value Bit 3 .equ USIDC = 4 ; Data Output Collision .equ USIPF = 5 ; Stop Condition Flag .equ USIOIF = 6 ; Counter Overflow Interrupt Flag .equ USISIF = 7 ; Start Condition Interrupt Flag
; USICR - USI Control Register .equ USITC = 0 ; Toggle Clock Port Pin .equ USICLK = 1 ; Clock Strobe .equ USICS0 = 2 ; USI Clock Source Select Bit 0 .equ USICS1 = 3 ; USI Clock Source Select Bit 1 .equ USIWM0 = 4 ; USI Wire Mode Bit 0 .equ USIWM1 = 5 ; USI Wire Mode Bit 1 .equ USIOIE = 6 ; Counter Overflow Interrupt Enable .equ USISIE = 7 ; Start Condition Interrupt Enable
; ***** LOCKSBITS ******************************************************** .equ LB1 = 0 ; Lockbit .equ LB2 = 1 ; Lockbit
; ***** FUSES ************************************************************ ; LOW fuse bits .equ CKSEL0 = 0 ; Select Clock Source .equ CKSEL1 = 1 ; Select Clock Source .equ CKSEL2 = 2 ; Select Clock Source .equ CKSEL3 = 3 ; Select Clock Source .equ SUT0 = 4 ; Select start-up time .equ SUT1 = 5 ; Select start-up time .equ CKOUT = 6 ; Clock output .equ CKDIV8 = 7 ; Divide clock by 8
; HIGH fuse bits .equ BODLEVEL0 = 0 ; Brown-out Detector trigger level .equ BODLEVEL1 = 1 ; Brown-out Detector trigger level .equ BODLEVEL2 = 2 ; Brown-out Detector trigger level .equ EESAVE = 3 ; EEPROM memory is preserved through chip erase .equ WDTON = 4 ; Watchdog Timer Always On .equ SPIEN = 5 ; Enable Serial programming and Data Downloading .equ DWEN = 6 ; debugWIRE Enable .equ RSTDISBL = 7 ; External reset disable
; EXTENDED fuse bits .equ SELFPRGEN = 0 ; Self Programming Enable
; ***** CPU REGISTER DEFINITIONS ***************************************** .def XH = r27 .def XL = r26 .def YH = r29 .def YL = r28 .def ZH = r31 .def ZL = r30
; ***** DATA MEMORY DECLARATIONS ***************************************** .equ FLASHEND = 0x03ff ; Note: Word address .equ IOEND = 0x003f .equ SRAM_START = 0x0060 .equ SRAM_SIZE = 128 .equ RAMEND = 0x00df .equ XRAMEND = 0x0000 .equ E2END = 0x007f .equ EEPROMEND = 0x007f .equ EEADRBITS = 7 #pragma AVRPART MEMORY PROG_FLASH 2048 #pragma AVRPART MEMORY EEPROM 128 #pragma AVRPART MEMORY INT_SRAM SIZE 128 #pragma AVRPART MEMORY INT_SRAM START_ADDR 0x60
; ***** BOOTLOADER DECLARATIONS ****************************************** .equ NRWW_START_ADDR = 0x0 .equ NRWW_STOP_ADDR = 0x3ff .equ RWW_START_ADDR = 0x0 .equ RWW_STOP_ADDR = 0x0 .equ PAGESIZE = 16
; ***** INTERRUPT VECTORS ************************************************ .equ INT0addr = 0x0001 ; External Interrupt Request 0 .equ INT1addr = 0x0002 ; External Interrupt Request 1 .equ ICP1addr = 0x0003 ; Timer/Counter1 Capture Event .equ OC1Aaddr = 0x0004 ; Timer/Counter1 Compare Match A .equ OC1addr = 0x0004 ; For compatibility .equ OVF1addr = 0x0005 ; Timer/Counter1 Overflow .equ OVF0addr = 0x0006 ; Timer/Counter0 Overflow .equ URXCaddr = 0x0007 ; USART, Rx Complete .equ URXC0addr = 0x0007 ; For compatibility .equ UDREaddr = 0x0008 ; USART Data Register Empty .equ UDRE0addr = 0x0008 ; For compatibility .equ UTXCaddr = 0x0009 ; USART, Tx Complete .equ UTXC0addr = 0x0009 ; For compatibility .equ ACIaddr = 0x000a ; Analog Comparator .equ PCIaddr = 0x000b ; .equ OC1Baddr = 0x000c ; .equ OC0Aaddr = 0x000d ; .equ OC0Baddr = 0x000e ; .equ USI_STARTaddr = 0x000f ; USI Start Condition .equ USI_OVFaddr = 0x0010 ; USI Overflow .equ ERDYaddr = 0x0011 ; .equ WDTaddr = 0x0012 ; Watchdog Timer Overflow
.equ INT_VECTORS_SIZE = 19 ; size in words
#endif /* _TN2313DEF_INC_ */
; ***** END OF FILE ******************************************************
|
/* Copyright (c) 2004, 2005, 2006 Bob Paddock All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holders nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* $Id: iotn2313.h,v 1.14.2.8 2009/02/11 18:44:42 arcanum Exp $ */
/* iotn2313.h derived from io2313.h by Bob Paddock.
The changes between the AT90S2313 and the ATtiny2313 are extensive.
Atmel has renamed several registers, and bits. See Atmel application note AVR091, as well as the errata at the end of the current ATtiny2313 data sheet. Some of the names have changed more than once during the sampling period of the ATtiny2313.
Where there is no conflict the new and old names are both supported.
In the case of a new feature in a register, only the new name is used. This intentionally breaks old code, so that there are no silent bugs. The source code must be updated to the new name in this case.
The hardware interrupt vector table has changed from that of the AT90S2313.
ATtiny2313 programs in page mode rather than the byte mode of the AT90S2313. Beware of programming the ATtiny2313 as a AT90S2313 device, when programming the Flash.
ATtiny2313 has Signature Bytes: 0x1E 0x91 0x0A.
Changes and/or additions are noted by "ATtiny" in the comments below. */
/* avr/iotn2313.h - definitions for ATtiny2313 */
#ifndef _AVR_IOTN2313_H_ #define _AVR_IOTN2313_H_ 1
/* This file should only be included from <avr/io.h>, never directly. */
#ifndef _AVR_IO_H_ # error "Include <avr/io.h> instead of this file." #endif
#ifndef _AVR_IOXXX_H_ # define _AVR_IOXXX_H_ "iotn2313.h" #else # error "Attempt to include more than one <avr/ioXXX.h> file." #endif
/* I/O registers */
/* * The Register Bit names are represented by their bit number (0-7). * Example: PORTB |= _BV(PORTB7); Set MSB of PORTB. */
/* 0x00 Reserved */
/* ATtiny Digital Input Disable Register DIDR */ #define DIDR _SFR_IO8(0x01)
#define AIN1D 1 #define AIN0D 0
/* ATtiny USART Baud Rate Register High UBBRH[11:8] */ #define UBRRH _SFR_IO8(0x02)
/* ATtiny USART Control and Status Register C UCSRC */ #define UCSRC _SFR_IO8(0x03)
#define UMSEL 6 #define UPM1 5 #define UPM0 4 #define USBS 3 #define UCSZ1 2 #define UCSZ0 1 #define UCPOL 0
/* 0x04 -> 0x07 Reserved */
/* ATtiny Analog Comparator Control and Status Register ACSR */ #define ACSR _SFR_IO8(0x08)
#define ACD 7 #define ACBG 6 #define ACO 5 #define ACI 4 #define ACIE 3 #define ACIC 2 #define ACIS1 1 #define ACIS0 0
/* USART Baud Rate Register Low UBBRL[7:0] */ #define UBRRL _SFR_IO8(0x09)
/* ATtiny USART Control Register UCSRB */ #define UCSRB _SFR_IO8(0x0A)
#define RXCIE 7 #define TXCIE 6 #define UDRIE 5 #define RXEN 4 #define TXEN 3 #define UCSZ2 2 #define RXB8 1 #define TXB8 0
/* ATtiny USART Status Register UCSRA */ #define UCSRA _SFR_IO8(0x0B)
#define RXC 7 #define TXC 6 #define UDRE 5 #define FE 4 #define DOR 3 #define UPE 2 #define U2X 1 #define MPCM 0
/* USART I/O Data Register UBR or RXB[7:0], TXB[7:0] */ #define UDR _SFR_IO8(0x0C) #define RXB _SFR_IO8(0x0C) #define TXB _SFR_IO8(0x0C)
/* ATtiny USI Control Register USICR */ #define USICR _SFR_IO8(0x0D)
#define USISIE 7 #define USIOIE 6 #define USIWM1 5 #define USIWM0 4 #define USICS1 3 #define USICS0 2 #define USICLK 1 #define USITC 0
/* ATtiny USI Status Register USISR */ #define USISR _SFR_IO8(0x0E)
#define USISIF 7 #define USIOIF 6 #define USIPF 5 #define USIDC 4 #define USICNT3 3 #define USICNT2 2 #define USICNT1 1 #define USICNT0 0
/* ATtiny USI Data Register USIDR[7:0] */ #define USIDR _SFR_IO8(0x0F)
/* Input Pins, Port D PIND[6:0] */ #define PIND _SFR_IO8(0x10)
#define PIND6 6 #define PIND5 5 #define PIND4 4 #define PIND3 3 #define PIND2 2 #define PIND1 1 #define PIND0 0
/* Data Direction Register, Port D DDRD[6:0] */ #define DDRD _SFR_IO8(0x11)
#define DDD6 6 #define DDD5 5 #define DDD4 4 #define DDD3 3 #define DDD2 2 #define DDD1 1 #define DDD0 0
/* Data Register, Port D PORTD[6:0] */ #define PORTD _SFR_IO8(0x12)
#define PD6 6 #define PD5 5 #define PD4 4 #define PD3 3 #define PD2 2 #define PD1 1 #define PD0 0
/* ATtiny General Purpose I/O Register Zero GPIOR0[7:0] */ #define GPIOR0 _SFR_IO8(0x13)
/* ATtiny General Purpose I/O Register One GPIOR1[7:0] */ #define GPIOR1 _SFR_IO8(0x14)
/* ATtiny General Purpose I/O Register Two One GPIOR2[7:0] */ #define GPIOR2 _SFR_IO8(0x15)
/* Input Pins, Port B PORTB[7:0] */ #define PINB _SFR_IO8(0x16)
#define PINB7 7 #define PINB6 6 #define PINB5 5 #define PINB4 4 #define PINB3 3 #define PINB2 2 #define PINB1 1 #define PINB0 0
/* Data Direction Register, Port B PORTB[7:0] */ #define DDRB _SFR_IO8(0x17)
#define DDB7 7 #define DDB6 6 #define DDB5 5 #define DDB4 4 #define DDB3 3 #define DDB2 2 #define DDB1 1 #define DDB0 0
/* Data Register, Port B PORTB[7:0] */ #define PORTB _SFR_IO8(0x18)
#define PB7 7 #define PB6 6 #define PB5 5 #define PB4 4 #define PB3 3 #define PB2 2 #define PB1 1 #define PB0 0
/* Port A Input Pins Address PINA[2:0] */ #define PINA _SFR_IO8(0x19)
#define PINA2 2 #define PINA1 1 #define PINA0 0
/* Port A Data Direction Register DDRA[2:0] */ #define DDRA _SFR_IO8(0x1A)
#define DDRA2 2 #define DDRA1 1 #define DDRA0 0
/* Port A Data Register PORTA[2:0] */ #define PORTA _SFR_IO8(0x1B)
#define PA2 2 #define PA1 1 #define PA0 0
/* ATtiny EEPROM Control Register EECR */ #define EECR _SFR_IO8(0x1C) #define EEPM1 5 #define EEPM0 4 #define EERIE 3 #define EEMPE 2 #define EEPE 1 #define EERE 0
/* EEPROM Data Register */ #define EEDR _SFR_IO8(0x1D)
/* The EEPROM Address Register EEAR[6:0] */ #define EEAR _SFR_IO8(0x1E) #define EEARL _SFR_IO8(0x1E) #define EEAR6 6 #define EEAR5 5 #define EEAR4 4 #define EEAR3 3 #define EEAR2 2 #define EEAR1 1 #define EEAR0 0
/* 0x1F Reserved */
/* ATtiny Pin Change Mask Register PCMSK PCINT[7:0] */ #define PCMSK _SFR_IO8(0x20)
#define PCINT7 7 #define PCINT6 6 #define PCINT5 5 #define PCINT4 4 #define PCINT3 3 #define PCINT2 2 #define PCINT1 1 #define PCINT0 0
/* ATtiny Watchdog Timer Control Register WDTCSR */ #define WDTCSR _SFR_IO8(0x21)
#define WDIF 7 #define WDIE 6 #define WDP3 5 #define WDCE 4 #define WDE 3 #define WDP2 2 #define WDP1 1 #define WDP0 0
/* ATtiny Timer/Counter1 Control Register C TCCR1C */ #define TCCR1C _SFR_IO8(0x22)
#define FOC1A 7 #define FOC1B 6
/* General Timer/Counter Control Register GTCCR */ #define GTCCR _SFR_IO8(0x23)
#define PSR10 0
/* T/C 1 Input Capture Register ICR1[15:0] */ #define ICR1 _SFR_IO16(0x24) #define ICR1L _SFR_IO8(0x24) #define ICR1H _SFR_IO8(0x25)
/* ATtiny Clock Prescale Register */ #define CLKPR _SFR_IO8(0x26)
#define CLKPCE 7 #define CLKPS3 3 #define CLKPS2 2 #define CLKPS1 1 #define CLKPS0 0
/* 0x27 Reserved */
/* ATtiny Output Compare Register 1 B OCR1B[15:0] */ #define OCR1B _SFR_IO16(0x28) #define OCR1BL _SFR_IO8(0x28) #define OCR1BH _SFR_IO8(0x29)
/* Output Compare Register 1 OCR1A[15:0] */ #define OCR1 _SFR_IO16(0x2A) #define OCR1L _SFR_IO8(0x2A) #define OCR1H _SFR_IO8(0x2B) #define OCR1A _SFR_IO16(0x2A) #define OCR1AL _SFR_IO8(0x2A) #define OCR1AH _SFR_IO8(0x2B)
/* Timer/Counter 1 TCNT1[15:0] */ #define TCNT1 _SFR_IO16(0x2C) #define TCNT1L _SFR_IO8(0x2C) #define TCNT1H _SFR_IO8(0x2D)
/* ATtiny Timer/Counter 1 Control and Status Register TCCR1B */ #define TCCR1B _SFR_IO8(0x2E)
#define ICNC1 7 #define ICES1 6 #define WGM13 4 #define WGM12 3 /* Was CTC1 in AT90S2313 */ #define CS12 2 #define CS11 1 #define CS10 0
/* ATtiny Timer/Counter 1 Control Register TCCR1A */ #define TCCR1A _SFR_IO8(0x2F)
#define COM1A1 7 #define COM1A0 6 #define COM1B1 5 #define COM1B0 4 #define WGM11 1 /* Was PWM11 in AT90S2313 */ #define WGM10 0 /* Was PWM10 in AT90S2313 */
/* ATtiny Timer/Counter Control Register A TCCR0A */ #define TCCR0A _SFR_IO8(0x30)
#define COM0A1 7 #define COM0A0 6 #define COM0B1 5 #define COM0B0 4 #define WGM01 1 #define WGM00 0
/* ATtiny Oscillator Calibration Register OSCCAL[6:0] */ #define OSCCAL _SFR_IO8(0x31)
#define CAL6 6 #define CAL5 5 #define CAL4 4 #define CAL3 3 #define CAL2 2 #define CAL1 1 #define CAL0 0
/* Timer/Counter 0 TCNT0[7:0] */ #define TCNT0 _SFR_IO8(0x32)
/* ATtiny Timer/Counter 0 Control Register TCCR0B */ #define TCCR0B _SFR_IO8(0x33)
#define FOC0A 7 #define FOC0B 6 #define WGM02 3 #define CS02 2 #define CS01 1 #define CS00 0
/* ATtiny MCU Status Register MCUSR */ #define MCUSR _SFR_IO8(0x34)
#define WDRF 3 #define BORF 2 #define EXTRF 1 #define PORF 0
/* ATtiny MCU general Control Register MCUCR */ #define MCUCR _SFR_IO8(0x35)
#define PUD 7 #define SM1 6 #define SE 5 #define SM0 4 /* Some preliminary ATtiny2313 data sheets incorrectly refer to this bit as SMD; was SM in AT90S2313. */ #define ISC11 3 #define ISC10 2 #define ISC01 1 #define ISC00 0
/* ATtiny Output Compare Register A OCR0A[7:0] */ #define OCR0A _SFR_IO8(0x36)
/* ATtiny Store Program Memory Control and Status Register SPMCSR */ #define SPMCSR _SFR_IO8(0x37)
#define CTPB 4 #define RFLB 3 #define PGWRT 2 #define PGERS 1 #define SPMEN 0 /* The name is used in ATtiny2313.xml file. */ #define SELFPRGEN 0 /* The name is used in datasheet. */ #define SELFPRGE 0 /* The name is left for compatibility. */
/* ATtiny Timer/Counter Interrupt Flag register TIFR */ #define TIFR _SFR_IO8(0x38)
#define TOV1 7 #define OCF1A 6 #define OCF1B 5 #define ICF1 3 #define OCF0B 2 #define TOV0 1 #define OCF0A 0
/* ATtiny Timer/Counter Interrupt MaSK register TIMSK */ #define TIMSK _SFR_IO8(0x39)
#define TOIE1 7 #define OCIE1A 6 #define OCIE1B 5 #define ICIE1 3 #define OCIE0B 2 #define TOIE0 1 #define OCIE0A 0
/* ATtiny External Interrupt Flag Register EIFR, was GIFR */ #define EIFR _SFR_IO8(0x3A)
#define INTF1 7 #define INTF0 6 #define PCIF 5
/* ATtiny General Interrupt MaSK register GIMSK */ #define GIMSK _SFR_IO8(0x3B)
#define INT1 7 #define INT0 6 #define PCIE 5
/* ATtiny Output Compare Register B OCR0B[7:0] */ #define OCR0B _SFR_IO8(0x3C)
/* Interrupt vectors: */
/* External Interrupt Request 0 */ #define INT0_vect _VECTOR(1) #define SIG_INTERRUPT0 _VECTOR(1) #define SIG_INT0 _VECTOR(1)
/* External Interrupt Request 1 */ #define INT1_vect _VECTOR(2) #define SIG_INTERRUPT1 _VECTOR(2) #define SIG_INT1 _VECTOR(2)
/* Timer/Counter1 Capture Event */ #define TIMER1_CAPT_vect _VECTOR(3) #define SIG_INPUT_CAPTURE1 _VECTOR(3) #define SIG_TIMER1_CAPT _VECTOR(3)
/* Timer/Counter1 Compare Match A */ #define TIMER1_COMPA_vect _VECTOR(4) #define SIG_OUTPUT_COMPARE1A _VECTOR(4) #define SIG_TIMER1_COMPA _VECTOR(4)
/* Timer/Counter1 Overflow */ #define TIMER1_OVF_vect _VECTOR(5) #define SIG_OVERFLOW1 _VECTOR(5) #define SIG_TIMER1_OVF _VECTOR(5)
/* Timer/Counter0 Overflow */ #define TIMER0_OVF_vect _VECTOR(6) #define SIG_OVERFLOW0 _VECTOR(6) #define SIG_TIMER0_OVF _VECTOR(6)
/* USART, Rx Complete */ #define USART_RX_vect _VECTOR(7) #define SIG_USART0_RECV _VECTOR(7) #define SIG_USART0_RX _VECTOR(7)
/* USART Data Register Empty */ #define USART_UDRE_vect _VECTOR(8) #define SIG_USART0_DATA _VECTOR(8) #define SIG_USART0_UDRE _VECTOR(8)
/* USART, Tx Complete */ #define USART_TX_vect _VECTOR(9) #define SIG_USART0_TRANS _VECTOR(9) #define SIG_USART0_TX _VECTOR(9)
/* Analog Comparator */ #define ANA_COMP_vect _VECTOR(10) #define SIG_COMPARATOR _VECTOR(10) #define SIG_ANALOG_COMP _VECTOR(10) #define PCINT_vect _VECTOR(11) #define SIG_PIN_CHANGE _VECTOR(11) #define SIG_PCINT _VECTOR(11) #define TIMER1_COMPB_vect _VECTOR(12) #define SIG_OUTPUT_COMPARE1B _VECTOR(12) #define SIG_TIMER1_COMPB _VECTOR(12) #define TIMER0_COMPA_vect _VECTOR(13) #define SIG_OUTPUT_COMPARE0A _VECTOR(13) #define SIG_TIMER0_COMPA _VECTOR(13) #define TIMER0_COMPB_vect _VECTOR(14) #define SIG_OUTPUT_COMPARE0B _VECTOR(14) #define SIG_TIMER0_COMPB _VECTOR(14)
/* USI Start Condition */ #define USI_START_vect _VECTOR(15) #define SIG_USI_START _VECTOR(15) #define SIG_USI_START _VECTOR(15)
/* USI Overflow */ #define USI_OVERFLOW_vect _VECTOR(16) #define SIG_USI_OVERFLOW _VECTOR(16) #define SIG_USI_OVERFLOW _VECTOR(16) #define EEPROM_READY_vect _VECTOR(17) #define SIG_EEPROM_READY _VECTOR(17) #define SIG_EE_READY _VECTOR(17)
/* Watchdog Timer Overflow */ #define WDT_OVERFLOW_vect _VECTOR(18) #define SIG_WATCHDOG_TIMEOUT _VECTOR(18) #define SIG_WDT_OVERFLOW _VECTOR(18)
/* 38 = (18*2)+2: Number of vectors times two, plus the reset vector */ #define _VECTORS_SIZE 38
/* Constants */ #define SPM_PAGESIZE 32 #define RAMEND 0xDF #define XRAMEND RAMEND #define E2END 0x7F #define E2PAGESIZE 4 #define FLASHEND 0x07FF
/* Fuses */ #define FUSE_MEMORY_SIZE 3
/* Low Fuse Byte */ #define FUSE_CKSEL0 (unsigned char)~_BV(0) #define FUSE_CKSEL1 (unsigned char)~_BV(1) #define FUSE_CKSEL2 (unsigned char)~_BV(2) #define FUSE_CKSEL3 (unsigned char)~_BV(3) #define FUSE_SUT0 (unsigned char)~_BV(4) #define FUSE_SUT1 (unsigned char)~_BV(5) #define FUSE_CKOUT (unsigned char)~_BV(6) #define FUSE_CKDIV8 (unsigned char)~_BV(7) #define LFUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL1 & FUSE_CKSEL3 & FUSE_SUT0 & FUSE_CKDIV8)
/* High Fuse Byte */ #define FUSE_RSTDISBL (unsigned char)~_BV(0) #define FUSE_BODLEVEL0 (unsigned char)~_BV(1) #define FUSE_BODLEVEL1 (unsigned char)~_BV(2) #define FUSE_BODLEVEL2 (unsigned char)~_BV(3) #define FUSE_WDTON (unsigned char)~_BV(4) #define FUSE_SPIEN (unsigned char)~_BV(5) #define FUSE_EESAVE (unsigned char)~_BV(6) #define FUSE_DWEN (unsigned char)~_BV(7) #define HFUSE_DEFAULT (FUSE_SPIEN)
/* Extended Fuse Byte */ #define FUSE_SELFPRGEN (unsigned char)~_BV(0) #define EFUSE_DEFAULT (0xFF)
/* Lock Bits */ #define __LOCK_BITS_EXIST
/* Signature */ #define SIGNATURE_0 0x1E #define SIGNATURE_1 0x91 #define SIGNATURE_2 0x0A
#endif /* _AVR_IOTN2313_H_ */
|