Blame | Last modification | View Log | Download | RSS feed
ifndef __regm1284inc__regm1284inc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File REGM1284.INC *;* *;* Contains Bit & Register Definitions for ATmega1284 *;* *;****************************************************************************;----------------------------------------------------------------------------; Memory LimitsE2END equ 4095RAMSTART equ 0x100,dataRAMEND equ 0x40ff,dataFLASHEND label 0x1ffff;----------------------------------------------------------------------------; Chip ControlMCUCR port 0x35 ; MCU Control RegisterIVCE avrbit MCUCR,0 ; Interrupt Vector Change EnableIVSEL avrbit MCUCR,1 ; Interrupt Vector SelectMCUSR port 0x34 ; MCU Status RegisterPORF avrbit MCUSR,0 ; Power-On Reset OccuredEXTRF avrbit MCUSR,1 ; External Reset OccuredBORF avrbit MCUSR,2 ; Brown Out Reset OccuredWDRF avrbit MCUSR,3 ; watchdog Reset OccuredSMCR port 0x33 ; Sleep Mode Control RegisterSE avrbit SMCR,0 ; Sleep Mode EnableSM0 avrbit SMCR,1 ; Sleep Mode SelectSM1 avrbit SMCR,2SM2 avrbit SMCR,3PRR0 sfr 0x64 ; Power Reduction Register 0PRADC avrbit PRR0,0 ; Power Reduction ADCPRUSART0 avrbit PRR0,1 ; Power Reduction USART0PRSPI0 avrbit PRR0,2 ; Power Reduction Serial Peripheral Interface 0PRTIM1 avrbit PRR0,3 ; Power Reduction Timer/Counter 1PRUSART1 avrbit PRR0,4 ; Power Reduction USART1PRTIM0 avrbit PRR0,5 ; Power Reduction Timer/Counter 0PRTIM2 avrbit PRR0,6 ; Power Reduction Timer/Counter 2PRTWI avrbit PRR0,7 ; Power Reduction TWIPRR1 sfr 0x65 ; Power Reduction Register 1PRTIM3 avrbit PRR1,0 ; Power Reduction Timer/Counter 3OSCCAL sfr 0x66 ; Oscillator CalibrationCLKPR sfr 0x61 ; Clock Prescale RegisterCLKPS0 avrbit CLKPR,0 ; Clock Prescaler SelectCLKPS1 avrbit CLKPR,1CLKPS2 avrbit CLKPR,2CLKPS3 avrbit CLKPR,3CLKPCE avrbit CLKPR,7 ; Clock Prescaler Change Enable;----------------------------------------------------------------------------; EEPROM/Program Memory Accessinclude "eem2.inc"include "spmcsr37.inc"EEPM0 avrbit EECR,4 ; EEPROM Programming ModeEEPM1 avrbit EECR,5SIGRD avrbit SIGRD,5 ; Signature Row Read;----------------------------------------------------------------------------; JTAGJTD avrbit MCUCR,7 ; JTAG DisableJTRF avrbit MCUSR,4 ; JTAG Reset OccuredOCDR port 0x31 ; On-Chip Debug Register;----------------------------------------------------------------------------; GPIOPUD avrbit MCUCR,4 ; Pull Up DisablePINA port 0x00 ; Port A @ 0x00 (IO) ff.PINB port 0x03 ; Port B @ 0x03 (IO) ff.PINC port 0x06 ; Port C @ 0x03 (IO) ff.PIND port 0x09 ; Port D @ 0x09 (IO) ff.PCMSK0 sfr 0x6b ; Pin Change Mask Register 0PCMSK1 sfr 0x6c ; Pin Change Mask Register 1PCMSK2 sfr 0x6d ; Pin Change Mask Register 2PCMSK3 sfr 0x73 ; Pin Change Mask Register 3PCICR sfr 0x68 ; Pin Change Interrupt Control RegisterPCIFR port 0x1b ; Pin Change Interrupt Flag RegisterGPIOR0 port 0x1e ; General Purpose I/O RegistersGPIOR1 port 0x2aGPIOR2 port 0x2b;----------------------------------------------------------------------------; Interrupt Vectorsenumconf 2,codeenum INT0_vect=2 ; External Interrupt Request 0nextenum INT1_vect ; External Interrupt Request 1nextenum INT2_vect ; External Interrupt Request 2nextenum PCINT0_vect ; Pin Change Interrupt Request 0nextenum PCINT1_vect ; Pin Change Interrupt Request 1nextenum PCINT2_vect ; Pin Change Interrupt Request 2nextenum PCINT3_vect ; Pin Change Interrupt Request 3nextenum WDT_vect ; Watchdog Time-Out Interruptnextenum TIMER2_COMPA_vect ; Timer/Counter 2 Compare Match Anextenum TIMER2_COMPB_vect ; Timer/Counter 2 Compare Match Bnextenum TIMER2_OVF_vect ; Timer/Counter 2 Overflownextenum TIMER1_CAPT_vect ; Timer/Counter 1 Capture Eventnextenum TIMER1_COMPA_vect ; Timer/Counter 1 Compare Match Anextenum TIMER1_COMPB_vect ; Timer/Counter 1 Compare Match Bnextenum TIMER1_OVF_vect ; Timer/Counter 1 Overflownextenum TIMER0_COMPA_vect ; Timer/Counter 0 Compare Match Anextenum TIMER0_COMPB_vect ; Timer/Counter 0 Compare Match Bnextenum TIMER0_OVF_vect ; Timer/Counter 0 Overflownextenum SPI_STC_vect ; SPI Serial Transfer Completenextenum USART0_RX_vect ; USART0 Rx Completenextenum USART0_UDRE_vect ; USART0 Data Register Emptynextenum USART0_TX_vect ; USART0 Tx Completenextenum ANALOG_COMP_vect ; Analog Comparatornextenum ADC_vect ; ADC Conversion Completenextenum EE_READY_vect ; EEPROM Readynextenum TWI_vect ; Two-Wire Serial interfacenextenum SPM_READY_vect ; Store Program Memory Readynextenum USART1_RX_vect ; USART1 Rx Completenextenum USART1_UDRE_vect ; USART1 Data Register Emptynextenum USART1_TX_vect ; USART1 Tx Completenextenum TIMER3_CAPT_vect ; Timer/Counter 3 Capture Eventnextenum TIMER3_COMPA_vect ; Timer/Counter 3 Compare Match Anextenum TIMER3_COMPB_vect ; Timer/Counter 3 Compare Match Bnextenum TIMER3_OVF_vect ; Timer/Counter 3 Overflow;----------------------------------------------------------------------------; External InterruptsEICRA sfr 0x69 ; External Interrupt Control Register AISC00 avrbit EICRA,0 ; External Interrupt 0 Sense ControlISC01 avrbit EICRA,1ISC10 avrbit EICRA,2 ; External Interrupt 1 Sense ControlISC11 avrbit EICRA,3ISC20 avrbit EICRA,4 ; External Interrupt 2 Sense ControlISC21 avrbit EICRA,5EIMSK port 0x1d ; External Interrupt Mask RegisterINT0 avrbit EIMSK,0 ; Enable External Interrupt 0INT1 avrbit EIMSK,1 ; Enable External Interrupt 1INT2 avrbit EIMSK,2 ; Enable External Interrupt 2EIFR port 0x1c ; External Interrupt Flag RegisterINTF0 avrbit EIFR,0 ; External Interrupt 0 OccuredINTF1 avrbit EIFR,1 ; External Interrupt 1 OccuredINTF2 avrbit EIFR,2 ; External Interrupt 2 Occured;----------------------------------------------------------------------------; TimersGTCCR port 0x23 ; General Timer/Counter Control RegisterPSRSYNC avrbit GTCCR,0 ; Prescaler ResetTSM avrbit GTCCR,7 ; Timer/Counter Synchronization ModeTCCR0A port 0x24 ; Timer/Counter 0 Control Register AWGM00 avrbit TCCR0A,0 ; Timer/Counter 0 Waveform Generation ModeWGM01 avrbit TCCR0A,1COM0B0 avrbit TCCR0A,4 ; Timer/Counter 0 Compare Mode BCOM0B1 avrbit TCCR0A,5COM0A0 avrbit TCCR0A,6 ; Timer/Counter 0 Compare Mode ACOM0A1 avrbit TCCR0A,7TCCR0B port 0x25 ; Timer/Counter 0 Control Register BCS00 avrbit TCCR0B,0 ; Timer/Counter 0 Clock SelectCS01 avrbit TCCR0B,1CS02 avrbit TCCR0B,2WGM02 avrbit TCCR0B,3FOC0B avrbit TCCR0B,6 ; Timer/Counter 0 Force Output Compare Match BFOC0A avrbit TCCR0B,7 ; Timer/Counter 0 Force Output Compare Match ATCNT0 port 0x26 ; Timer/Counter 0 ValueOCR0A port 0x27 ; Timer/Counter 0 Output Compare Value AOCR0B port 0x28 ; Timer/Counter 0 Output Compare Value BTCCR1A sfr 0x80 ; Timer/Counter 1 Control Register AWGM10 avrbit TCCR1A,0 ; Timer/Counter 1 Waveform Generation ModeWGM11 avrbit TCCR1A,1COM1B0 avrbit TCCR1A,4 ; Timer/Counter 1 Compare Mode BCOM1B1 avrbit TCCR1A,5COM1A0 avrbit TCCR1A,6 ; Timer/Counter 1 Compare Mode ACOM1A1 avrbit TCCR1A,7TCCR1B sfr 0x81 ; Timer/Counter 1 Control Register BCS10 avrbit TCCR1B,0 ; Timer/Counter 1 Prescaler SettingCS11 avrbit TCCR1B,1CS12 avrbit TCCR1B,2WGM12 avrbit TCCR1B,3WGM13 avrbit TCCR1B,4ICES1 avrbit TCCR1B,6 ; Timer/Counter 1 Capture Slope SelectionICNC1 avrbit TCCR1B,7 ; Timer/Counter 1 Capture Noise FilterTCCR1C sfr 0x82 ; Timer/Counter 1 Control Register CFOC1B avrbit TCCR1C,6 ; Timer/Counter 1 Force Output Compare BFOC1A avrbit TCCR1C,7 ; Timer/Counter 1 Force Output Compare ATCNT1L sfr 0x84 ; Timer/Counter 1 Value LSBTCNT1H sfr 0x85 ; Timer/Counter 1 Value MSBOCR1AL sfr 0x88 ; Timer/Counter 1 Output Compare Value A LSBOCR1AH sfr 0x89 ; Timer/Counter 1 Output Compare Value A MSBOCR1BL sfr 0x8a ; Timer/Counter 1 Output Compare Value B LSBOCR1BH sfr 0x8b ; Timer/Counter 1 Output Compare Value B MSBICR1L sfr 0x86 ; Timer/Counter 1 Input Capture Value LSBICR1H sfr 0x87 ; Timer/Counter 1 Input Capture Value MSBTCCR2A sfr 0xb0 ; Timer/Counter 2 Control Register AWGM20 avrbit TCCR2A,0 ; Timer/Counter 2 Waveform Generation ModeWGM21 avrbit TCCR2A,1COM2B0 avrbit TCCR2A,4 ; Timer/Counter 2 Compare Mode BCOM2B1 avrbit TCCR2A,5COM2A0 avrbit TCCR2A,6 ; Timer/Counter 2 Compare Mode ACOM2A1 avrbit TCCR2A,7TCCR2B sfr 0xb1 ; Timer/Counter 2 Control Register BCS20 avrbit TCCR2B,0 ; Timer/Counter 2 Prescaler SettingCS21 avrbit TCCR2B,1CS22 avrbit TCCR2B,2WGM22 avrbit TCCR2B,3FOC2B avrbit TCCR2B,6 ; Timer/Counter 2 Force Output Compare BFOC2A avrbit TCCR2B,7 ; Timer/Counter 2 Force Output Compare ATCNT2 sfr 0xb2 ; Timer/Counter 2 ValueOCR2A sfr 0xb3 ; Timer/Counter 2 Output Compare Value AOCR2B sfr 0xb4 ; Timer/Counter 2 Output Compare Value BTCCR3A sfr 0x90 ; Timer/Counter 3 Control Register AWGM30 avrbit TCCR3A,0 ; Timer/Counter 3 Waveform Generation ModeWGM31 avrbit TCCR3A,1COM3B0 avrbit TCCR3A,4 ; Timer/Counter 3 Compare Mode BCOM3B1 avrbit TCCR3A,5COM3A0 avrbit TCCR3A,6 ; Timer/Counter 3 Compare Mode ACOM3A1 avrbit TCCR3A,7TCCR3B sfr 0x91 ; Timer/Counter 3 Control Register BCS30 avrbit TCCR3B,0 ; Timer/Counter 3 Prescaler SettingCS31 avrbit TCCR3B,1CS32 avrbit TCCR3B,2WGM32 avrbit TCCR3B,3WGM33 avrbit TCCR3B,4ICES3 avrbit TCCR3B,6 ; Timer/Counter 3 Capture Slope SelectionICNC3 avrbit TCCR3B,7 ; Timer/Counter 3 Capture Noise FilterTCCR3C sfr 0x92 ; Timer/Counter 3 Control Register CFOC3B avrbit TCCR3C,6 ; Timer/Counter 3 Force Output Compare BFOC3A avrbit TCCR3C,7 ; Timer/Counter 3 Force Output Compare ATCNT3L sfr 0x94 ; Timer/Counter 3 Value LSBTCNT3H sfr 0x95 ; Timer/Counter 3 Value MSBOCR3AL sfr 0x98 ; Timer/Counter 3 Output Compare Value A LSBOCR3AH sfr 0x99 ; Timer/Counter 3 Output Compare Value A MSBOCR3BL sfr 0x9a ; Timer/Counter 3 Output Compare Value B LSBOCR3BH sfr 0x9b ; Timer/Counter 3 Output Compare Value B MSBICR3L sfr 0x96 ; Timer/Counter 3 Input Capture Value LSBICR3H sfr 0x97 ; Timer/Counter 3 Input Capture Value MSBTIMSK0 sfr 0x6e ; Timer/Counter 0 Interrupt Mask RegisterTOIE0 avrbit TIMSK0,0 ; Timer/Counter 0 Overflow Interrupt EnableOCIE0A avrbit TIMSK0,1 ; Timer/Counter 0 Output Compare Interrupt Enable AOCIE0B avrbit TIMSK0,2 ; Timer/Counter 0 Output Compare Interrupt Enable BTIMSK1 sfr 0x6f ; Timer/Counter 1 Interrupt Mask RegisterTOIE1 avrbit TIMSK1,0 ; Timer/Counter 1 Overflow Interrupt EnableOCIE1A avrbit TIMSK1,1 ; Timer/Counter 1 Output Compare Interrupt Enable AOCIE1B avrbit TIMSK1,2 ; Timer/Counter 1 Output Compare Interrupt Enable BICIE1 avrbit TIMSK1,5 ; Timer/Counter 1 Input Capture EnableTIMSK2 sfr 0x70 ; Timer/Counter 2 Interrupt Mask RegisterTOIE2 avrbit TIMSK2,0 ; Timer/Counter 2 Overflow Interrupt EnableOCIE2A avrbit TIMSK2,1 ; Timer/Counter 2 Output Compare Interrupt Enable AOCIE2B avrbit TIMSK2,2 ; Timer/Counter 2 Output Compare Interrupt Enable BTIMSK3 sfr 0x71 ; Timer/Counter 3 Interrupt Mask RegisterTOIE3 avrbit TIMSK3,0 ; Timer/Counter 3 Overflow Interrupt EnableOCIE3A avrbit TIMSK3,1 ; Timer/Counter 3 Output Compare Interrupt Enable AOCIE3B avrbit TIMSK3,2 ; Timer/Counter 3 Output Compare Interrupt Enable BICIE3 avrbit TIMSK3,5 ; Timer/Counter 3 Input Capture EnableTIFR0 port 0x15 ; Timer/Counter 0 Interrupt Status RegisterTIFR1 port 0x16 ; Timer/Counter 1 Interrupt Status RegisterTIFR2 port 0x17 ; Timer/Counter 2 Interrupt Status RegisterTIFR3 port 0x18 ; Timer/Counter 3 Interrupt Status RegisterASSR sfr 0xb6 ; Asynchronous Status RegisterTCR2BUB avrbit ASSR,0 ; Timer/Counter Control Register 2 B Update BusyTCR2AUB avrbit ASSR,1 ; Timer/Counter Control Register 2 A Update BusyOCR2BUB avrbit ASSR,2 ; Output Compare Register 2 B Update BusyOCR2AUB avrbit ASSR,3 ; Output Compare Register 2 A Update BusyTCN2UB avrbit ASSR,4 ; Timer/Counter 2 Update BusyAS2 avrbit ASSR,5 ; Asynchronous Timer/Counter 2EXCLK avrbit ASSR,6 ; Enable External Clock Input;----------------------------------------------------------------------------; Watchdog Timerinclude "wdme.inc";----------------------------------------------------------------------------; USART__USART0_SPI__ equ 1include "usartc0.inc"__USART1_SPI__ equ 1include "usartc8.inc";----------------------------------------------------------------------------; SPIinclude "spim02c.inc";----------------------------------------------------------------------------; TWIinclude "twimb8.inc";----------------------------------------------------------------------------; A/D Converterinclude "adcm78.inc"MUX4 avrbit ADMUX,4;----------------------------------------------------------------------------; Analog Comparatorinclude "acm30.inc"restore ; re-enable listingendif ; __regm1284inc