Main Page   Compound List   File List   Compound Members   File Members  

iotn12.h

Go to the documentation of this file.
00001 /*
00002    iotn12.h - internal register definitions for ATtiny12
00003 
00004    Contributors:
00005      Created by Marek Michalkiewicz <marekm@linux.org.pl>
00006 
00007    THIS SOFTWARE IS NOT COPYRIGHTED
00008 
00009    This source code is offered for use in the public domain.  You may
00010    use, modify or distribute it freely.
00011 
00012    This code is distributed in the hope that it will be useful, but
00013    WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00014    DISCLAIMED.  This includes but is not limited to warranties of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017    Based on preliminary Atmel datasheet Rev. 1006B-10/99.
00018  */
00019 
00020 #ifndef __IOTN12
00021 #define __IOTN12 1
00022 
00023 #ifndef __ASSEMBLER__
00024 #  warning "MCU not supported by the C compiler"
00025 #endif
00026 
00027 /* I/O space addresses */
00028 
00029 /* 0x00..0x07 reserved */
00030 
00031 /* Analog Comparator Control and Status Register */
00032 #define ACSR    0x08
00033 
00034 /* 0x09..0x15 reserved */
00035 
00036 /* Input Pins, Port B */
00037 #define PINB    0x16
00038 
00039 /* Data Direction Register, Port B */
00040 #define DDRB    0x17
00041 
00042 /* Data Register, Port B */
00043 #define PORTB   0x18
00044 
00045 /* 0x19..0x1B reserved */
00046 
00047 /* EEPROM Control Register */
00048 #define EECR    0x1C
00049 
00050 /* EEPROM Data Register */
00051 #define EEDR    0x1D
00052 
00053 /* EEPROM Address Register */
00054 #define EEARL   0x1E
00055 
00056 /* 0x1F..0x20 reserved */
00057 
00058 /* Watchdog Timer Control Register */
00059 #define WDTCR   0x21
00060 
00061 /* 0x22..0x30 reserved */
00062 
00063 /* Oscillator Calibration Register */
00064 #define OSCCAL  0x31
00065 
00066 /* Timer/Counter0 (8-bit) */
00067 #define TCNT0   0x32
00068 
00069 /* Timer/Counter0 Control Register */
00070 #define TCCR0   0x33
00071 
00072 /* MCU general Status Register */
00073 #define MCUSR   0x34
00074 
00075 /* MCU general Control Register */
00076 #define MCUCR   0x35
00077 
00078 /* 0x36..0x37 reserved */
00079 
00080 /* Timer/Counter Interrupt Flag Register */
00081 #define TIFR    0x38
00082 
00083 /* Timer/Counter Interrupt MaSK Register */
00084 #define TIMSK   0x39
00085 
00086 /* General Interrupt Flag Register */
00087 #define GIFR    0x3A
00088 
00089 /* General Interrupt MaSK register */
00090 #define GIMSK   0x3B
00091 
00092 /* 0x3C..0x3E reserved */
00093 
00094 /* Status REGister */
00095 #define SREG    0x3F
00096 
00097 /* Interrupt vectors (byte addresses) */
00098 
00099 #define RESET_vect              (0x00)
00100 #define INT0_vect               (0x02)
00101 #define PIN_vect                (0x04)
00102 #define TIMER0_OVF_vect         (0x06)
00103 #define EE_RDY_vect             (0x08)
00104 #define ANA_COMP_vect           (0x0A)
00105 
00106 #define INT_VECT_SIZE (0x0C)
00107 
00108 /* Bit numbers */
00109 
00110 /* GIMSK */
00111 #define INT0    6
00112 #define PCIE    5
00113 
00114 /* GIFR */
00115 #define INTF0   6
00116 #define PCIF    5
00117 
00118 /* TIMSK */
00119 #define TOIE0   1
00120 
00121 /* TIFR */
00122 #define TOV0    1
00123 
00124 /* MCUCR */
00125 #define PUD     6
00126 #define SE      5
00127 #define SM      4
00128 #define ISC01   1
00129 #define ISC00   0
00130 
00131 /* TCCR0 */
00132 #define CS02    2
00133 #define CS01    1
00134 #define CS00    0
00135 
00136 /* WDTCR */
00137 #define WDTOE   4
00138 #define WDE     3
00139 #define WDP2    2
00140 #define WDP1    1
00141 #define WDP0    0
00142 
00143 /* EECR */
00144 #define EERIE   3
00145 #define EEMWE   2
00146 #define EEWE    1
00147 #define EERE    0
00148 
00149 /*
00150    PB5 = RESET#
00151    PB4 = XTAL2
00152    PB3 = XTAL1
00153    PB2 = T0 / SCK
00154    PB1 = INT0 / AIN1 / MISO
00155    PB0 = AIN0 / MOSI
00156  */
00157 
00158 /* PORTB */
00159 #define PB4     4
00160 #define PB3     3
00161 #define PB2     2
00162 #define PB1     1
00163 #define PB0     0
00164 
00165 /* DDRB */
00166 #define DDB5    5
00167 #define DDB4    4
00168 #define DDB3    3
00169 #define DDB2    2
00170 #define DDB1    1
00171 #define DDB0    0
00172 
00173 /* PINB */
00174 #define PINB5   5
00175 #define PINB4   4
00176 #define PINB3   3
00177 #define PINB2   2
00178 #define PINB1   1
00179 #define PINB0   0
00180 
00181 /* ACSR */
00182 #define ACD     7
00183 #define AINBG   6
00184 #define ACO     5
00185 #define ACI     4
00186 #define ACIE    3
00187 #define ACIS1   1
00188 #define ACIS0   0
00189 
00190 #define ZL r30
00191 #define ZH r31
00192 
00193 /* Last memory addresses */
00194 #define RAMEND          0x1F
00195 #define XRAMEND         0x0
00196 #define E2END           0x3F
00197 #define FLASHEND        0x3FF
00198 
00199 #endif  /* __IOTN12 */

Generated at Fri Jul 19 14:55:41 2002 for avrgcc by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001