1
/* Copyright (c) 2007 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.
32
/* $Id: io90pwm3b.h,v 1.1.2.2 2007/10/19 23:16:31 arcanum Exp $ */
34
/* avr/io90pwm3b.h - definitions for AT90PWM3B */
36
/* This file should only be included from <avr/io.h>, never directly. */
39
# error "Include <avr/io.h> instead of this file."
43
# define _AVR_IOXXX_H_ "io90pwm3b.h"
45
# error "Attempt to include more than one <avr/ioXXX.h> file."
49
#ifndef _AVR_IO90PWM3B_H_
50
#define _AVR_IO90PWM3B_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 GPIOR3 _SFR_IO8(0x1B)
200
#define EIFR _SFR_IO8(0x1C)
205
#define EIMSK _SFR_IO8(0x1D)
210
#define GPIOR0 _SFR_IO8(0x1E)
220
#define EECR _SFR_IO8(0x1F)
228
#define EEDR _SFR_IO8(0x20)
238
#define EEARL _SFR_IO8(0x21)
248
#define EEARH _SFR_IO8(0x22)
254
#define GTCCR _SFR_IO8(0x23)
260
#define TCCR0A _SFR_IO8(0x24)
268
#define TCCR0B _SFR_IO8(0x25)
276
#define TCNT0 _SFR_IO8(0x26)
286
#define OCR0A _SFR_IO8(0x27)
296
#define OCR0B _SFR_IO8(0x28)
306
#define PLLCSR _SFR_IO8(0x29)
311
#define SPCR _SFR_IO8(0x2C)
321
#define SPSR _SFR_IO8(0x2D)
326
#define SPDR _SFR_IO8(0x2E)
336
#define ACSR _SFR_IO8(0x30)
345
#define SMCR _SFR_IO8(0x33)
351
#define MCUSR _SFR_IO8(0x34)
357
#define MCUCR _SFR_IO8(0x35)
363
#define SPMCSR _SFR_IO8(0x37)
372
#define WDTCSR _SFR_MEM8(0x60)
382
#define CLKPR _SFR_MEM8(0x61)
389
#define PRR _SFR_MEM8(0x64)
400
#define OSCCAL _SFR_MEM8(0x66)
409
#define EICRA _SFR_MEM8(0x69)
417
#define TIMSK0 _SFR_MEM8(0x6E)
422
#define TIMSK1 _SFR_MEM8(0x6F)
428
#define AMP0CSR _SFR_MEM8(0x76)
436
#define AMP1CSR _SFR_MEM8(0x77)
444
#define ADC _SFR_MEM16(0x78)
446
#define ADCL _SFR_MEM8(0x78)
456
#define ADCH _SFR_MEM8(0x79)
466
#define ADCSRA _SFR_MEM8(0x7A)
476
#define ADCSRB _SFR_MEM8(0x7B)
484
#define ADMUX _SFR_MEM8(0x7C)
493
#define DIDR0 _SFR_MEM8(0x7E)
503
#define DIDR1 _SFR_MEM8(0x7F)
511
#define TCCR1A _SFR_MEM8(0x80)
519
#define TCCR1B _SFR_MEM8(0x81)
528
#define TCCR1C _SFR_MEM8(0x82)
532
#define TCNT1 _SFR_MEM16(0x84)
534
#define TCNT1L _SFR_MEM8(0x84)
544
#define TCNT1H _SFR_MEM8(0x85)
554
#define ICR1 _SFR_MEM8(0x86)
556
#define ICR1L _SFR_MEM8(0x86)
566
#define ICR1H _SFR_MEM8(0x87)
576
#define OCR1A _SFR_MEM16(0x88)
578
#define OCR1AL _SFR_MEM8(0x88)
588
#define OCR1AH _SFR_MEM8(0x89)
598
#define OCR1B _SFR_MEM16(0x8A)
600
#define OCR1BL _SFR_MEM8(0x8A)
610
#define OCR1BH _SFR_MEM8(0x8B)
620
#define PIFR0 _SFR_MEM8(0xA0)
630
#define PIM0 _SFR_MEM8(0xA1)
636
#define PIFR1 _SFR_MEM8(0xA2)
646
#define PIM1 _SFR_MEM8(0xA3)
652
#define PIFR2 _SFR_MEM8(0xA4)
662
#define PIM2 _SFR_MEM8(0xA5)
668
#define DACON _SFR_MEM8(0xAA)
677
#define DAC _SFR_MEM16(0xAB)
679
#define DACL _SFR_MEM8(0xAB)
689
#define DACH _SFR_MEM8(0xAC)
699
#define AC0CON _SFR_MEM8(0xAD)
708
#define AC1CON _SFR_MEM8(0xAE)
718
#define AC2CON _SFR_MEM8(0xAF)
727
#define UCSRA _SFR_MEM8(0xC0)
737
#define UCSRB _SFR_MEM8(0xC1)
747
#define UCSRC _SFR_MEM8(0xC2)
756
#define UBRR _SFR_MEM16(0xC4)
758
#define UBRRL _SFR_MEM8(0xC4)
768
#define UBRRH _SFR_MEM8(0xC5)
774
#define UDR _SFR_MEM8(0xC6)
784
#define EUCSRA _SFR_MEM8(0xC8)
794
#define EUCSRB _SFR_MEM8(0xC9)
800
#define EUCSRC _SFR_MEM8(0xCA)
806
#define MUBRR _SFR_MEM16(0xCC)
808
#define MUBRRL _SFR_MEM8(0xCC)
818
#define MUBRRH _SFR_MEM8(0xCD)
828
#define EUDR _SFR_MEM8(0xCE)
838
#define PSOC0 _SFR_MEM8(0xD0)
844
#define OCR0SA _SFR_MEM16(0xD2)
846
#define OCR0SAL _SFR_MEM8(0xD2)
856
#define OCR0SAH _SFR_MEM8(0xD3)
862
#define OCR0RA _SFR_MEM16(0xD4)
864
#define OCR0RAL _SFR_MEM8(0xD4)
874
#define OCR0RAH _SFR_MEM8(0xD5)
880
#define OCR0SB _SFR_MEM16(0xD6)
882
#define OCR0SBL _SFR_MEM8(0xD6)
892
#define OCR0SBH _SFR_MEM8(0xD7)
898
#define OCR0RB _SFR_MEM16(0xD8)
900
#define OCR0RBL _SFR_MEM8(0xD8)
910
#define OCR0RBH _SFR_MEM8(0xD9)
920
#define PCNF0 _SFR_MEM8(0xDA)
929
#define PCTL0 _SFR_MEM8(0xDB)
939
#define PFRC0A _SFR_MEM8(0xDC)
949
#define PFRC0B _SFR_MEM8(0xDD)
959
#define PICR0 _SFR_MEM16(0xDE)
961
#define PICR0L _SFR_MEM8(0xDE)
971
#define PICR0H _SFR_MEM8(0xDF)
978
#define PSOC1 _SFR_MEM8(0xE0)
984
#define OCR1SA _SFR_MEM16(0xE2)
986
#define OCR1SAL _SFR_MEM8(0xE2)
996
#define OCR1SAH _SFR_MEM8(0xE3)
1002
#define OCR1RA _SFR_MEM16(0xE4)
1004
#define OCR1RAL _SFR_MEM8(0xE4)
1014
#define OCR1RAH _SFR_MEM8(0xE5)
1020
#define OCR1SB _SFR_MEM16(0xE6)
1022
#define OCR1SBL _SFR_MEM8(0xE6)
1032
#define OCR1SBH _SFR_MEM8(0xE7)
1038
#define OCR1RB _SFR_MEM16(0xE8)
1040
#define OCR1RBL _SFR_MEM8(0xE8)
1050
#define OCR1RBH _SFR_MEM8(0xE9)
1060
#define PCNF1 _SFR_MEM8(0xEA)
1069
#define PCTL1 _SFR_MEM8(0xEB)
1079
#define PFRC1A _SFR_MEM8(0xEC)
1089
#define PFRC1B _SFR_MEM8(0xED)
1099
#define PICR1 _SFR_MEM16(0xEE)
1101
#define PICR1L _SFR_MEM8(0xEE)
1111
#define PICR1H _SFR_MEM8(0xEF)
1119
#define PSOC2 _SFR_MEM8(0xF0)
1129
#define POM2 _SFR_MEM8(0xF1)
1139
#define OCR2SA _SFR_MEM16(0xF2)
1141
#define OCR2SAL _SFR_MEM8(0xF2)
1151
#define OCR2SAH _SFR_MEM8(0xF3)
1157
#define OCR2RA _SFR_MEM16(0xF4)
1159
#define OCR2RAL _SFR_MEM8(0xF4)
1164
#define OCR2RA_4 4#define OCR2RA_5 5
1168
#define OCR2RAH _SFR_MEM8(0xF5)
1174
#define OCR2SB _SFR_MEM16(0xF6)
1176
#define OCR2SBL _SFR_MEM8(0xF6)
1186
#define OCR2SBH _SFR_MEM8(0xF7)
1192
#define OCR2RB _SFR_MEM16(0xF8)
1194
#define OCR2RBL _SFR_MEM8(0xF8)
1204
#define OCR2RBH _SFR_MEM8(0xF9)
1214
#define PCNF2 _SFR_MEM8(0xFA)
1224
#define PCTL2 _SFR_MEM8(0xFB)
1234
#define PFRC2A _SFR_MEM8(0xFC)
1244
#define PFRC2B _SFR_MEM8(0xFD)
1254
#define PICR2 _SFR_MEM16(0xFE)
1256
#define PICR2L _SFR_MEM8(0xFE)
1266
#define PICR2H _SFR_MEM8(0xFF)
1275
/* Interrupt Vectors */
1276
/* Interrupt vector 0 is the reset vector. */
1277
#define PSC2_CAPT_vect _VECTOR(1) /* PSC2 Capture Event */
1278
#define PSC2_EC_vect _VECTOR(2) /* PSC2 End Cycle */
1279
#define PSC1_CAPT_vect _VECTOR(3) /* PSC1 Capture Event */
1280
#define PSC1_EC_vect _VECTOR(4) /* PSC1 End Cycle */
1281
#define PSC0_CAPT_vect _VECTOR(5) /* PSC0 Capture Event */
1282
#define PSC0_EC_vect _VECTOR(6) /* PSC0 End Cycle */
1283
#define ANALOG_COMP_0_vect _VECTOR(7) /* Analog Comparator 0 */
1284
#define ANALOG_COMP_1_vect _VECTOR(8) /* Analog Comparator 1 */
1285
#define ANALOG_COMP_2_vect _VECTOR(9) /* Analog Comparator 2 */
1286
#define INT0_vect _VECTOR(10) /* External Interrupt Request 0 */
1287
#define TIMER1_CAPT_vect _VECTOR(11) /* Timer/Counter1 Capture Event */
1288
#define TIMER1_COMPA_vect _VECTOR(12) /* Timer/Counter1 Compare Match A */
1289
#define TIMER1_COMPB_vect _VECTOR(13) /* Timer/Counter Compare Match B */
1290
/* Vector 14, Reserved */
1291
#define TIMER1_OVF_vect _VECTOR(15) /* Timer/Counter1 Overflow */
1292
#define TIMER0_COMP A_vect _VECTOR(16) /* Timer/Counter0 Compare Match A */
1293
#define TIMER0_OVF_vect _VECTOR(17) /* Timer/Counter0 Overflow */
1294
#define ADC_vect _VECTOR(18) /* ADC Conversion Complete */
1295
#define INT1_vect _VECTOR(19) /* External Interrupt Request 1 */
1296
#define SPI_STC_vect _VECTOR(20) /* SPI Serial Transfer Complete */
1297
#define USART_RX_vect _VECTOR(21) /* USART, Rx Complete */
1298
#define USART_UDRE_vect _VECTOR(22) /* USART Data Register Empty */
1299
#define USART_TX_vect _VECTOR(23) /* USART, Tx Complete */
1300
#define INT2_vect _VECTOR(24) /* External Interrupt Request 2 */
1301
#define WDT_vect _VECTOR(25) /* Watchdog Timeout Interrupt */
1302
#define EE_READY_vect _VECTOR(26) /* EEPROM Ready */
1303
#define TIMER0_COMPB_vect _VECTOR(27) /* Timer Counter 0 Compare Match B */
1304
#define INT3_vect _VECTOR(28) /* External Interrupt Request 3 */
1305
/* Vector 29, Reserved */
1306
/* Vector 30, Reserved */
1307
#define SPM_READY_vect _VECTOR(31) /* Store Program Memory Read */
1309
#define _VECTORS_SIZE 64
1314
#define RAMEND 0x1FF
1315
#define XRAMEND 0x00
1317
#define FLASHEND 0x1FFF
1318
#define SPM_PAGESIZE 32
1322
/* Fuse Information */
1324
#define FUSE_MEMORY_SIZE 3
1327
#define CKSEL0 ~_BV(0) /* Select Clock Source */
1328
#define CKSEL1 ~_BV(1) /* Select Clock Source */
1329
#define CKSEL2 ~_BV(2) /* Select Clock Source */
1330
#define CKSEL3 ~_BV(3) /* Select Clock Source */
1331
#define SUT0 ~_BV(4) /* Select start-up time */
1332
#define SUT1 ~_BV(5) /* Select start-up time */
1333
#define CKOUT ~_BV(6) /* Oscillator output option */
1334
#define CLKDIV8 ~_BV(7) /* Divide clock by 8 */
1335
#define LFUSE_DEFAULT (CKSEL1 & CKSEL2 & CKSEL3 & SUT0 & SUT1 & CKDIV8)
1338
/* High Fuse Byte */
1339
#define BODLEVEL0 ~_BV(0) /* Brown-out Detector trigger level */
1340
#define BODLEVEL1 ~_BV(1) /* Brown-out Detector trigger level */
1341
#define BODLEVEL2 ~_BV(2) /* Brown out detector trigger level */
1342
#define EESAVE ~_BV(3) /* EEPROM memory is preserved through chip erase */
1343
#define WDTON ~_BV(4) /* Watchdog timer always on */
1344
#define SPIEN ~_BV(5) /* Enable Serial programming and Data Downloading */
1345
#define DWEN ~_BV(6) /* debugWIRE Enable */
1346
#define RSTDISBL ~_BV(7) /* External Reset Disable */
1347
#define HFUSE_DEFAULT (SPIEN)
1350
/* Extended Fuse Byte */
1351
#define BOOTRST ~_BV(0) /* Select Reset Vector */
1352
#define BOOTSZ0 ~_BV(1) /* Select Boot Size */
1353
#define BOOTSZ1 ~_BV(2) /* Select Boot Size */
1354
#define PSCRV ~_BV(4) /* PSCOUT Reset Value */
1355
#define PSC0RB ~_BV(5) /* PSC0 Reset Behaviour */
1356
#define PSC1RB ~_BV(6) /* PSC1 Reset Behaviour */
1357
#define PSC2RB ~_BV(7) /* PSC2 Reset Behaviour */
1358
#define EFUSE_DEFAULT (BOOTSZ0 & BOOTSZ1)
1361
#endif /* _AVR_IO90PWM3B_H_ */