1
/* Copyright (c) 2009 Atmel Corporation
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in
12
the documentation and/or other materials provided with the
15
* Neither the name of the copyright holders nor the names of
16
contributors may be used to endorse or promote products derived
17
from this software without specific prior written permission.
19
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
POSSIBILITY OF SUCH DAMAGE. */
31
/* $Id: iom64m1.h,v 1.1.2.2 2009/01/26 18:18:52 arcanum Exp $ */
33
/* avr/iom64m1.h - definitions for ATmega64M1 */
35
/* This file should only be included from <avr/io.h>, never directly. */
38
# error "Include <avr/io.h> instead of this file."
42
# define _AVR_IOXXX_H_ "iom64m1.h"
44
# error "Attempt to include more than one <avr/ioXXX.h> file."
48
#ifndef _AVR_ATmega64M1_H_
49
#define _AVR_ATmega64M1_H_ 1
52
/* Registers and associated bit numbers. */
54
#define PINB _SFR_IO8(0x03)
64
#define DDRB _SFR_IO8(0x04)
74
#define PORTB _SFR_IO8(0x05)
84
#define PINC _SFR_IO8(0x06)
94
#define DDRC _SFR_IO8(0x07)
104
#define PORTC _SFR_IO8(0x08)
114
#define PIND _SFR_IO8(0x09)
124
#define DDRD _SFR_IO8(0x0A)
134
#define PORTD _SFR_IO8(0x0B)
144
#define PINE _SFR_IO8(0x0C)
149
#define DDRE _SFR_IO8(0x0D)
154
#define PORTE _SFR_IO8(0x0E)
159
#define TIFR0 _SFR_IO8(0x15)
164
#define TIFR1 _SFR_IO8(0x16)
170
#define GPIOR1 _SFR_IO8(0x19)
180
#define GPIOR2 _SFR_IO8(0x1A)
190
#define PCIFR _SFR_IO8(0x1B)
196
#define EIFR _SFR_IO8(0x1C)
202
#define EIMSK _SFR_IO8(0x1D)
208
#define GPIOR0 _SFR_IO8(0x1E)
218
#define EECR _SFR_IO8(0x1F)
226
#define EEDR _SFR_IO8(0x20)
236
#define EEAR _SFR_IO16(0x21)
238
#define EEARL _SFR_IO8(0x21)
248
#define EEARH _SFR_IO8(0x22)
253
#define GTCCR _SFR_IO8(0x23)
259
#define TCCR0A _SFR_IO8(0x24)
267
#define TCCR0B _SFR_IO8(0x25)
275
#define TCNT0 _SFR_IO8(0x26)
285
#define OCR0A _SFR_IO8(0x27)
295
#define OCR0B _SFR_IO8(0x28)
305
#define PLLCSR _SFR_IO8(0x29)
310
#define SPCR _SFR_IO8(0x2C)
320
#define SPSR _SFR_IO8(0x2D)
325
#define SPDR _SFR_IO8(0x2E)
335
#define ACSR _SFR_IO8(0x30)
345
#define DWDR _SFR_IO8(0x31)
347
#define SMCR _SFR_IO8(0x33)
353
#define MCUSR _SFR_IO8(0x34)
359
#define MCUCR _SFR_IO8(0x35)
365
#define SPMCSR _SFR_IO8(0x37)
375
#define WDTCSR _SFR_MEM8(0x60)
385
#define CLKPR _SFR_MEM8(0x61)
392
#define PRR _SFR_MEM8(0x64)
401
#define OSCCAL _SFR_MEM8(0x66)
410
#define PCICR _SFR_MEM8(0x68)
416
#define EICRA _SFR_MEM8(0x69)
426
#define PCMSK0 _SFR_MEM8(0x6A)
436
#define PCMSK1 _SFR_MEM8(0x6B)
446
#define PCMSK2 _SFR_MEM8(0x6C)
456
#define PCMSK3 _SFR_MEM8(0x6D)
461
#define TIMSK0 _SFR_MEM8(0x6E)
466
#define TIMSK1 _SFR_MEM8(0x6F)
472
#define AMP0CSR _SFR_MEM8(0x75)
482
#define AMP1CSR _SFR_MEM8(0x76)
492
#define AMP2CSR _SFR_MEM8(0x77)
502
#ifndef __ASSEMBLER__
503
#define ADC _SFR_MEM16(0x78)
505
#define ADCW _SFR_MEM16(0x78)
507
#define ADCL _SFR_MEM8(0x78)
517
#define ADCH _SFR_MEM8(0x79)
527
#define ADCSRA _SFR_MEM8(0x7A)
537
#define ADCSRB _SFR_MEM8(0x7B)
546
#define ADMUX _SFR_MEM8(0x7C)
556
#define DIDR0 _SFR_MEM8(0x7E)
566
#define DIDR1 _SFR_MEM8(0x7F)
575
#define TCCR1A _SFR_MEM8(0x80)
583
#define TCCR1B _SFR_MEM8(0x81)
592
#define TCCR1C _SFR_MEM8(0x82)
596
#define TCNT1 _SFR_MEM16(0x84)
598
#define TCNT1L _SFR_MEM8(0x84)
608
#define TCNT1H _SFR_MEM8(0x85)
618
#define ICR1 _SFR_MEM16(0x86)
620
#define ICR1L _SFR_MEM8(0x86)
630
#define ICR1H _SFR_MEM8(0x87)
640
#define OCR1A _SFR_MEM16(0x88)
642
#define OCR1AL _SFR_MEM8(0x88)
652
#define OCR1AH _SFR_MEM8(0x89)
662
#define OCR1B _SFR_MEM16(0x8A)
664
#define OCR1BL _SFR_MEM8(0x8A)
674
#define OCR1BH _SFR_MEM8(0x8B)
684
#define DACON _SFR_MEM8(0x90)
692
#define DAC _SFR_MEM16(0x91)
694
#define DACL _SFR_MEM8(0x91)
704
#define DACH _SFR_MEM8(0x92)
714
#define AC0CON _SFR_MEM8(0x94)
724
#define AC1CON _SFR_MEM8(0x95)
734
#define AC2CON _SFR_MEM8(0x96)
743
#define AC3CON _SFR_MEM8(0x97)
752
#define POCR0SA _SFR_MEM16(0xA0)
754
#define POCR0SAL _SFR_MEM8(0xA0)
764
#define POCR0SAH _SFR_MEM8(0xA1)
770
#define POCR0RA _SFR_MEM16(0xA2)
772
#define POCR0RAL _SFR_MEM8(0xA2)
782
#define POCR0RAH _SFR_MEM8(0xA3)
788
#define POCR0SB _SFR_MEM16(0xA4)
790
#define POCR0SBL _SFR_MEM8(0xA4)
800
#define POCR0SBH _SFR_MEM8(0xA5)
806
#define POCR1SA _SFR_MEM16(0xA6)
808
#define POCR1SAL _SFR_MEM8(0xA6)
818
#define POCR1SAH _SFR_MEM8(0xA7)
824
#define POCR1RA _SFR_MEM16(0xA8)
826
#define POCR1RAL _SFR_MEM8(0xA8)
836
#define POCR1RAH _SFR_MEM8(0xA9)
842
#define POCR1SB _SFR_MEM16(0xAA)
844
#define POCR1SBL _SFR_MEM8(0xAA)
854
#define POCR1SBH _SFR_MEM8(0xAB)
860
#define POCR2SA _SFR_MEM16(0xAC)
862
#define POCR2SAL _SFR_MEM8(0xAC)
872
#define POCR2SAH _SFR_MEM8(0xAD)
878
#define POCR2RA _SFR_MEM16(0xAE)
880
#define POCR2RAL _SFR_MEM8(0xAE)
890
#define POCR2RAH _SFR_MEM8(0xAF)
896
#define POCR2SB _SFR_MEM16(0xB0)
898
#define POCR2SBL _SFR_MEM8(0xB0)
908
#define POCR2SBH _SFR_MEM8(0xB1)
914
#define POCR_RB _SFR_MEM16(0xB2)
916
#define POCR_RBL _SFR_MEM8(0xB2)
926
#define POCR_RBH _SFR_MEM8(0xB3)
932
#define PSYNC _SFR_MEM8(0xB4)
940
#define PCNF _SFR_MEM8(0xB5)
946
#define POC _SFR_MEM8(0xB6)
954
#define PCTL _SFR_MEM8(0xB7)
961
#define PMIC0 _SFR_MEM8(0xB8)
971
#define PMIC1 _SFR_MEM8(0xB9)
981
#define PMIC2 _SFR_MEM8(0xBA)
991
#define PIM _SFR_MEM8(0xBB)
997
#define PIFR _SFR_MEM8(0xBC)
1003
#define LINCR _SFR_MEM8(0xC8)
1013
#define LINSIR _SFR_MEM8(0xC9)
1023
#define LINENIR _SFR_MEM8(0xCA)
1029
#define LINERR _SFR_MEM8(0xCB)
1039
#define LINBTR _SFR_MEM8(0xCC)
1048
#define LINBRR _SFR_MEM16(0xCD)
1050
#define LINBRRL _SFR_MEM8(0xCD)
1060
#define LINBRRH _SFR_MEM8(0xCE)
1066
#define LINDLR _SFR_MEM8(0xCF)
1076
#define LINIDR _SFR_MEM8(0xD0)
1086
#define LINSEL _SFR_MEM8(0xD1)
1092
#define LINDAT _SFR_MEM8(0xD2)
1102
#define CANGCON _SFR_MEM8(0xD8)
1112
#define CANGSTA _SFR_MEM8(0xD9)
1120
#define CANGIT _SFR_MEM8(0xDA)
1130
#define CANGIE _SFR_MEM8(0xDB)
1140
#define CANEN2 _SFR_MEM8(0xDC)
1148
#define CANEN1 _SFR_MEM8(0xDD)
1150
#define CANIE2 _SFR_MEM8(0xDE)
1158
#define CANIE1 _SFR_MEM8(0xDF)
1160
#define CANSIT2 _SFR_MEM8(0xE0)
1168
#define CANSIT1 _SFR_MEM8(0xE1)
1170
#define CANBT1 _SFR_MEM8(0xE2)
1178
#define CANBT2 _SFR_MEM8(0xE3)
1185
#define CANBT3 _SFR_MEM8(0xE4)
1194
#define CANTCON _SFR_MEM8(0xE5)
1204
#define CANTIM _SFR_MEM16(0xE6)
1206
#define CANTIML _SFR_MEM8(0xE6)
1216
#define CANTIMH _SFR_MEM8(0xE7)
1226
#define CANTTC _SFR_MEM16(0xE8)
1228
#define CANTTCL _SFR_MEM8(0xE8)
1238
#define CANTTCH _SFR_MEM8(0xE9)
1248
#define CANTEC _SFR_MEM8(0xEA)
1258
#define CANREC _SFR_MEM8(0xEB)
1268
#define CANHPMOB _SFR_MEM8(0xEC)
1278
#define CANPAGE _SFR_MEM8(0xED)
1288
#define CANSTMOB _SFR_MEM8(0xEE)
1298
#define CANCDMOB _SFR_MEM8(0xEF)
1308
#define CANIDT4 _SFR_MEM8(0xF0)
1318
#define CANIDT3 _SFR_MEM8(0xF1)
1328
#define CANIDT2 _SFR_MEM8(0xF2)
1338
#define CANIDT1 _SFR_MEM8(0xF3)
1348
#define CANIDM4 _SFR_MEM8(0xF4)
1357
#define CANIDM3 _SFR_MEM8(0xF5)
1367
#define CANIDM2 _SFR_MEM8(0xF6)
1377
#define CANIDM1 _SFR_MEM8(0xF7)
1387
#define CANSTM _SFR_MEM16(0xF8)
1389
#define CANSTML _SFR_MEM8(0xF8)
1399
#define CANSTMH _SFR_MEM8(0xF9)
1409
#define CANMSG _SFR_MEM8(0xFA)
1420
/* Interrupt vectors */
1421
/* Vector 0 is the reset vector */
1422
#define ANACOMP0_vect_num 1
1423
#define ANACOMP0_vect _VECTOR(1) /* Analog Comparator 0 */
1424
#define ANACOMP1_vect_num 2
1425
#define ANACOMP1_vect _VECTOR(2) /* Analog Comparator 1 */
1426
#define ANACOMP2_vect_num 3
1427
#define ANACOMP2_vect _VECTOR(3) /* Analog Comparator 2 */
1428
#define ANACOMP3_vect_num 4
1429
#define ANACOMP3_vect _VECTOR(4) /* Analog Comparator 3 */
1430
#define PSC_FAULT_vect_num 5
1431
#define PSC_FAULT_vect _VECTOR(5) /* PSC Fault */
1432
#define PSC_EC_vect_num 6
1433
#define PSC_EC_vect _VECTOR(6) /* PSC End of Cycle */
1434
#define INT0_vect_num 7
1435
#define INT0_vect _VECTOR(7) /* External Interrupt Request 0 */
1436
#define INT1_vect_num 8
1437
#define INT1_vect _VECTOR(8) /* External Interrupt Request 1 */
1438
#define INT2_vect_num 9
1439
#define INT2_vect _VECTOR(9) /* External Interrupt Request 2 */
1440
#define INT3_vect_num 10
1441
#define INT3_vect _VECTOR(10) /* External Interrupt Request 3 */
1442
#define TIMER1_CAPT_vect_num 11
1443
#define TIMER1_CAPT_vect _VECTOR(11) /* Timer/Counter1 Capture Event */
1444
#define TIMER1_COMPA_vect_num 12
1445
#define TIMER1_COMPA_vect _VECTOR(12) /* Timer/Counter1 Compare Match A */
1446
#define TIMER1_COMPB_vect_num 13
1447
#define TIMER1_COMPB_vect _VECTOR(13) /* Timer/Counter1 Compare Match B */
1448
#define TIMER1_OVF_vect_num 14
1449
#define TIMER1_OVF_vect _VECTOR(14) /* Timer1/Counter1 Overflow */
1450
#define TIMER0_COMPA_vect_num 15
1451
#define TIMER0_COMPA_vect _VECTOR(15) /* Timer/Counter0 Compare Match A */
1452
#define TIMER0_COMPB_vect_num 16
1453
#define TIMER0_COMPB_vect _VECTOR(16) /* Timer/Counter0 Compare Match B */
1454
#define TIMER0_OVF_vect_num 17
1455
#define TIMER0_OVF_vect _VECTOR(17) /* Timer/Counter0 Overflow */
1456
#define CAN_INT_vect_num 18
1457
#define CAN_INT_vect _VECTOR(18) /* CAN MOB, Burst, General Errors */
1458
#define CAN_TOVF_vect_num 19
1459
#define CAN_TOVF_vect _VECTOR(19) /* CAN Timer Overflow */
1460
#define LIN_TC_vect_num 20
1461
#define LIN_TC_vect _VECTOR(20) /* LIN Transfer Complete */
1462
#define LIN_ERR_vect_num 21
1463
#define LIN_ERR_vect _VECTOR(21) /* LIN Error */
1464
#define PCINT0_vect_num 22
1465
#define PCINT0_vect _VECTOR(22) /* Pin Change Interrupt Request 0 */
1466
#define PCINT1_vect_num 23
1467
#define PCINT1_vect _VECTOR(23) /* Pin Change Interrupt Request 1 */
1468
#define PCINT2_vect_num 24
1469
#define PCINT2_vect _VECTOR(24) /* Pin Change Interrupt Request 2 */
1470
#define PCINT3_vect_num 25
1471
#define PCINT3_vect _VECTOR(25) /* Pin Change Interrupt Request 3 */
1472
#define SPI_STC_vect_num 26
1473
#define SPI_STC_vect _VECTOR(26) /* SPI Serial Transfer Complete */
1474
#define ADC_vect_num 27
1475
#define ADC_vect _VECTOR(27) /* ADC Conversion Complete */
1476
#define WDT_vect_num 28
1477
#define WDT_vect _VECTOR(28) /* Watchdog Time-Out Interrupt */
1478
#define EE_READY_vect_num 29
1479
#define EE_READY_vect _VECTOR(29) /* EEPROM Ready */
1480
#define SPM_READY_vect_num 30
1481
#define SPM_READY_vect _VECTOR(30) /* Store Program Memory Read */
1483
#define _VECTOR_SIZE 4 /* Size of individual vector. */
1484
#define _VECTORS_SIZE (31 * _VECTOR_SIZE)
1488
#define SPM_PAGESIZE (256)
1489
#define RAMSTART (0x0100)
1490
#define RAMSIZE (4096)
1491
#define RAMEND (RAMSTART + RAMSIZE - 1)
1492
#define XRAMSTART (0x0)
1493
#define XRAMSIZE (0)
1494
#define XRAMEND (RAMEND)
1495
#define E2END (0x7FF)
1496
#define E2PAGESIZE (8)
1497
#define FLASHEND (0xFFFF)
1501
#define FUSE_MEMORY_SIZE 3
1504
#define FUSE_CKSEL0 (unsigned char)~_BV(0) /* Select Clock Source */
1505
#define FUSE_CKSEL1 (unsigned char)~_BV(1) /* Select Clock Source */
1506
#define FUSE_CKSEL2 (unsigned char)~_BV(2) /* Select Clock Source */
1507
#define FUSE_CKSEL3 (unsigned char)~_BV(3) /* Select Clock Source */
1508
#define FUSE_SUT0 (unsigned char)~_BV(4) /* Select start-up time */
1509
#define FUSE_SUT1 (unsigned char)~_BV(5) /* Select start-up time */
1510
#define FUSE_CKOUT (unsigned char)~_BV(6) /* Oscillator output option */
1511
#define FUSE_CKDIV8 (unsigned char)~_BV(7) /* Divide clock by 8 */
1512
#define LFUSE_DEFAULT (FUSE_CKDIV8 & FUSE_SUT1 & FUSE_SUT0 & FUSE_CKSEL3 & FUSE_CKSEL2 & FUSE_CKSEL1)
1514
/* High Fuse Byte */
1515
#define FUSE_BOOTRST (unsigned char)~_BV(0) /* Select Reset Vector */
1516
#define FUSE_BOOTSZ0 (unsigned char)~_BV(1) /* Select Boot Size */
1517
#define FUSE_BOOTSZ1 (unsigned char)~_BV(2) /* Select Boot Size */
1518
#define FUSE_EESAVE (unsigned char)~_BV(3) /* EEPROM memory is preserved through chip erase */
1519
#define FUSE_WDTON (unsigned char)~_BV(4) /* Watchdog timer always on */
1520
#define FUSE_SPIEN (unsigned char)~_BV(5) /* Enable Serial programming and Data Downloading */
1521
#define FUSE_DWEN (unsigned char)~_BV(6) /* DebugWIRE Enable */
1522
#define FUSE_RSTDISBL (unsigned char)~_BV(7) /* External Reset Disable */
1523
#define HFUSE_DEFAULT (FUSE_SPIEN & FUSE_BOOTSZ1 & FUSE_BOOTSZ0)
1525
/* Extended Fuse Byte */
1526
#define FUSE_BODLEVEL0 (unsigned char)~_BV(0) /* Brown-out Detector Trigger Level */
1527
#define FUSE_BODLEVEL1 (unsigned char)~_BV(1) /* Brown-out Detector Trigger Level */
1528
#define FUSE_BODLEVEL2 (unsigned char)~_BV(2) /* Brown-out Detector Trigger Level */
1529
#define FUSE_PSCRVB (unsigned char)~_BV(3) /* PSC Outputs xB Reset Value */
1530
#define FUSE_PSCRVA (unsigned char)~_BV(4) /* PSC Outputs xA Reset Value */
1531
#define FUSE_PSCRB (unsigned char)~_BV(5) /* PSC Reset Behavior */
1532
#define EFUSE_DEFAULT (FUSE_BODLEVEL2 & FUSE_BODLEVEL1)
1536
#define __LOCK_BITS_EXIST
1537
#define __BOOT_LOCK_BITS_0_EXIST
1538
#define __BOOT_LOCK_BITS_1_EXIST
1542
#define SIGNATURE_0 0x1E
1543
#define SIGNATURE_1 0x96
1544
#define SIGNATURE_2 0x84
1547
#endif /* _AVR_ATmega64M1_H_ */