Main Page   Compound List   File List   Compound Members   File Members  

iotn11.h

Go to the documentation of this file.
00001 /*
00002    iotn11.h - internal register definitions for ATtiny10/11
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    ATtiny10 is a QuickFlash(tm) OTP version of ATtiny11.
00019  */
00020 
00021 #ifndef __IOTN11
00022 #define __IOTN11 1
00023 
00024 #ifndef __ASSEMBLER__
00025 #  warning "MCU not supported by the C compiler"
00026 #endif
00027 
00028 /* I/O space addresses */
00029 
00030 /* 0x00..0x07 reserved */
00031 
00032 /* Analog Comparator Control and Status Register */
00033 #define ACSR    0x08
00034 
00035 /* 0x09..0x15 reserved */
00036 
00037 /* Input Pins, Port B */
00038 #define PINB    0x16
00039 
00040 /* Data Direction Register, Port B */
00041 #define DDRB    0x17
00042 
00043 /* Data Register, Port B */
00044 #define PORTB   0x18
00045 
00046 /* 0x19..0x20 reserved */
00047 
00048 /* Watchdog Timer Control Register */
00049 #define WDTCR   0x21
00050 
00051 /* 0x22..0x31 reserved */
00052 
00053 /* Timer/Counter0 (8-bit) */
00054 #define TCNT0   0x32
00055 
00056 /* Timer/Counter0 Control Register */
00057 #define TCCR0   0x33
00058 
00059 /* MCU general Status Register */
00060 #define MCUSR   0x34
00061 
00062 /* MCU general Control Register */
00063 #define MCUCR   0x35
00064 
00065 /* 0x36..0x37 reserved */
00066 
00067 /* Timer/Counter Interrupt Flag Register */
00068 #define TIFR    0x38
00069 
00070 /* Timer/Counter Interrupt MaSK Register */
00071 #define TIMSK   0x39
00072 
00073 /* General Interrupt Flag Register */
00074 #define GIFR    0x3A
00075 
00076 /* General Interrupt MaSK register */
00077 #define GIMSK   0x3B
00078 
00079 /* 0x3C..0x3E reserved */
00080 
00081 /* Status REGister */
00082 #define SREG    0x3F
00083 
00084 /* Interrupt vectors (byte addresses) */
00085 
00086 #define RESET_vect              (0x00)
00087 #define INT0_vect               (0x02)
00088 #define PIN_vect                (0x04)
00089 #define TIMER0_OVF_vect         (0x06)
00090 #define ANA_COMP_vect           (0x08)
00091 
00092 #define INT_VECT_SIZE (0x0A)
00093 
00094 /* Bit numbers */
00095 
00096 /* GIMSK */
00097 #define INT0    6
00098 #define PCIE    5
00099 
00100 /* GIFR */
00101 #define INTF0   6
00102 #define PCIF    5
00103 
00104 /* TIMSK */
00105 #define TOIE0   1
00106 
00107 /* TIFR */
00108 #define TOV0    1
00109 
00110 /* MCUCR */
00111 #define SE      5
00112 #define SM      4
00113 #define ISC01   1
00114 #define ISC00   0
00115 
00116 /* TCCR0 */
00117 #define CS02    2
00118 #define CS01    1
00119 #define CS00    0
00120 
00121 /* WDTCR */
00122 #define WDTOE   4
00123 #define WDE     3
00124 #define WDP2    2
00125 #define WDP1    1
00126 #define WDP0    0
00127 
00128 /*
00129    PB5 = RESET#
00130    PB4 = XTAL2
00131    PB3 = XTAL1
00132    PB2 = T0
00133    PB1 = INT0 / AIN1
00134    PB0 = AIN0
00135  */
00136 
00137 /* PORTB */
00138 #define PB4     4
00139 #define PB3     3
00140 #define PB2     2
00141 #define PB1     1
00142 #define PB0     0
00143 
00144 /* DDRB */
00145 #define DDB4    4
00146 #define DDB3    3
00147 #define DDB2    2
00148 #define DDB1    1
00149 #define DDB0    0
00150 
00151 /* PINB */
00152 #define PINB5   5
00153 #define PINB4   4
00154 #define PINB3   3
00155 #define PINB2   2
00156 #define PINB1   1
00157 #define PINB0   0
00158 
00159 /* ACSR */
00160 #define ACD     7
00161 #define ACO     5
00162 #define ACI     4
00163 #define ACIE    3
00164 #define ACIS1   1
00165 #define ACIS0   0
00166 
00167 #define ZL r30
00168 #define ZH r31
00169 
00170 /* Last memory addresses */
00171 #define RAMEND          0x1F
00172 #define XRAMEND         0x0
00173 #define E2END           0x0
00174 #define FLASHEND        0x3FF
00175 
00176 #endif  /* __IOTN11 */

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