Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1186 | savelij | 1 | ifndef __regf0822inc |
2 | __regf0822inc equ 1 |
||
3 | save |
||
4 | listing off ; no listing over this file |
||
5 | |||
6 | ;**************************************************************************** |
||
7 | ;* * |
||
8 | ;* AS 1.42 - File F0822.INC * |
||
9 | ;* * |
||
10 | ;* Contains Bit & Register Definitions for Z8encore F0822 * |
||
11 | ;* Source: Z8 Encore! XP F0822 Series Product Specification, PS022518-1011* |
||
12 | ;* * |
||
13 | ;**************************************************************************** |
||
14 | |||
15 | include "ez8com.inc" |
||
16 | |||
17 | ;---------------------------------------------------------------------------- |
||
18 | ; System Control |
||
19 | |||
20 | |||
21 | ;---------------------------------------------------------------------------- |
||
22 | ; Flash Options |
||
23 | |||
24 | OPTIONS0 label 0000h |
||
25 | WDT_RES __z8cbit OPTIONS0,7 ; Watchdog Timer Reset |
||
26 | WDT_AO __z8cbit OPTIONS0,6 ; Watchdog Timer Always On |
||
27 | OSC_SEL __z8cbfield OPTIONS0,4,2 ; Oscillator Mode Selection |
||
28 | VBO_AO __z8cbit OPTIONS0,3 ; Voltage Brown-Out Protection Always On |
||
29 | FRP __z8cbit OPTIONS0,2 ; (Flash) Read Protect |
||
30 | FWP __z8cbit OPTIONS0,0 ; Flash Write Protect |
||
31 | OPTIONS1 label 0001h |
||
32 | |||
33 | ;---------------------------------------------------------------------------- |
||
34 | ; Interrupts Vectors |
||
35 | |||
36 | RESET_vect label 0002h ; Reset (not an interrupt) |
||
37 | WDT_vect label 0004h ; Watchdog Timer |
||
38 | ILL_INST_vect label 0006h ; Illegal Instruction Trap (not an interrupt) |
||
39 | TIMER1_vect label 000ah ; Timer 1 |
||
40 | TIMER0_vect label 000ch ; Timer 0 |
||
41 | UART_RX_vect label 000eh ; UART Receiver |
||
42 | UART_TX_vect label 0010h ; UART Transmitter |
||
43 | I2C_vect label 0012h ; I2C |
||
44 | SPI_vect label 0014h ; SPI |
||
45 | if __hasadc |
||
46 | ADC_vect label 0016h ; ADC |
||
47 | endif |
||
48 | A7_vect label 0018h ; Port A7, selectable rising or falling input edge |
||
49 | A6_vect label 001ah ; Port A6, selectable rising or falling input edge or Comparator Output |
||
50 | A5_vect label 001ch ; Port A5, selectable rising or falling input edge |
||
51 | A4_vect label 001eh ; Port A4, selectable rising or falling input edge |
||
52 | A3_vect label 0020h ; Port A3 or Port D3, selectable rising or falling input edge |
||
53 | A2_vect label 0022h ; Port A2 or Port D2, selectable rising or falling input edge |
||
54 | A1_vect label 0024h ; Port A1, selectable rising or falling input edge |
||
55 | A0_vect label 0026h ; Port A0, selectable rising or falling input edge |
||
56 | C3_vect label 0030h ; Port C3, both input edges |
||
57 | C2_vect label 0032h ; Port C2, both input edges |
||
58 | C1_vect label 0034h ; Port C1, both input edges |
||
59 | C0_vect label 0036h ; Port C0, both input edges |
||
60 | |||
61 | ;---------------------------------------------------------------------------- |
||
62 | ; Interrupts |
||
63 | |||
64 | __defirq macro NUM,Base |
||
65 | IRQ{NUM} sfr Base+0 ; Interrupt Request n |
||
66 | IRQ{NUM}ENH sfr Base+1 ; IRQn Enable High Bit |
||
67 | IRQ{NUM}ENL sfr Base+2 ; IRQn Enable Low Bit |
||
68 | endm |
||
69 | |||
70 | __defirq "0",0fc0h |
||
71 | __defirq "1",0fc3h |
||
72 | __defirq "2",0fc6h |
||
73 | |||
74 | T1I __z8bit IRQ0,6 ; Timer 1 Interrupt Request |
||
75 | T0I __z8bit IRQ0,5 ; Timer 0 Interrupt Request |
||
76 | U0RXI __z8bit IRQ0,4 ; UART 0 Receiver Interrupt Request |
||
77 | U0TXI __z8bit IRQ0,3 ; UART 0 Transmitter Interrupt Request |
||
78 | I2CI __z8bit IRQ0,2 ; I2C Interrupt Request |
||
79 | SPII __z8bit IRQ0,1 ; SPI Interrupt Request |
||
80 | if __hasadc |
||
81 | ADCI __z8bit IRQ0,0 ; ADC Interrupt Request |
||
82 | endif |
||
83 | |||
84 | T1ENH __z8bit IRQ0ENH,6 ; Timer 1 Interrupt Enable & Priority |
||
85 | T1ENL __z8bit IRQ0ENL,6 |
||
86 | T0ENH __z8bit IRQ0ENH,5 ; Timer 0 Interrupt Enable & Priority |
||
87 | T0ENL __z8bit IRQ0ENL,5 |
||
88 | U0RENH __z8bit IRQ0ENH,4 ; UART 0 Receive Interrupt Enable & Priority |
||
89 | U0RENL __z8bit IRQ0ENL,4 |
||
90 | U0TENH __z8bit IRQ0ENH,3 ; UART 0 Transmit Interrupt Enable & Priority |
||
91 | U0TENL __z8bit IRQ0ENL,3 |
||
92 | I2CENH __z8bit IRQ0ENH,2 ; I2C Interrupt Enable & Priority |
||
93 | I2CENL __z8bit IRQ0ENL,2 |
||
94 | SPIENH __z8bit IRQ0ENH,1 ; SPI Interrupt Enable & Priority |
||
95 | SPIENL __z8bit IRQ0ENL,1 |
||
96 | if __hasadc |
||
97 | ADCENH __z8bit IRQ0ENH,0 ; ADC Interrupt Enable & Priority |
||
98 | ADCENL __z8bit IRQ0ENL,0 |
||
99 | endif |
||
100 | |||
101 | PA7I __z8bit IRQ1,7 ; Port A7 Interrupt Request |
||
102 | PA6I __z8bit IRQ1,6 ; Port A6 Interrupt Request |
||
103 | PA5I __z8bit IRQ1,5 ; Port A5 Interrupt Request |
||
104 | PA4I __z8bit IRQ1,4 ; Port A4 Interrupt Request |
||
105 | PA3I __z8bit IRQ1,3 ; Port A3 Interrupt Request |
||
106 | PA2I __z8bit IRQ1,2 ; Port A2 Interrupt Request |
||
107 | PA1I __z8bit IRQ1,1 ; Port A1 Interrupt Request |
||
108 | PA0I __z8bit IRQ1,0 ; Port A0 Interrupt Request |
||
109 | |||
110 | PA7ENH __z8bit IRQ1ENH,7 ; Port A7 Interrupt Enable & Priority |
||
111 | PA7ENL __z8bit IRQ1ENL,7 |
||
112 | PA6ENH __z8bit IRQ1ENH,6 ; Port A6 Interrupt Enable & Priority |
||
113 | PA6ENL __z8bit IRQ1ENL,6 |
||
114 | PA5ENH __z8bit IRQ1ENH,5 ; Port A5 Interrupt Enable & Priority |
||
115 | PA5ENL __z8bit IRQ1ENL,5 |
||
116 | PA4ENH __z8bit IRQ1ENH,4 ; Port A4 Interrupt Enable & Priority |
||
117 | PA4ENL __z8bit IRQ1ENL,4 |
||
118 | PA3ENH __z8bit IRQ1ENH,3 ; Port A3 Interrupt Enable & Priority |
||
119 | PA3ENL __z8bit IRQ1ENL,3 |
||
120 | PA2ENH __z8bit IRQ1ENH,2 ; Port A2 Interrupt Enable & Priority |
||
121 | PA2ENL __z8bit IRQ1ENL,2 |
||
122 | PA1ENH __z8bit IRQ1ENH,1 ; Port A1 Interrupt Enable & Priority |
||
123 | PA1ENL __z8bit IRQ1ENL,1 |
||
124 | PA0ENH __z8bit IRQ1ENH,0 ; Port A0 Interrupt Enable & Priority |
||
125 | PA0ENL __z8bit IRQ1ENL,0 |
||
126 | |||
127 | PC3I __z8bit IRQ2,3 ; Port C3 Interrupt Request |
||
128 | PC2I __z8bit IRQ2,2 ; Port C2 Interrupt Request |
||
129 | PC1I __z8bit IRQ2,1 ; Port C1 Interrupt Request |
||
130 | PC0I __z8bit IRQ2,0 ; Port C0 Interrupt Request |
||
131 | |||
132 | C3ENH __z8bit IRQ2ENH,3 ; Port C3 Interrupt Enable & Priority |
||
133 | C3ENL __z8bit IRQ2ENL,3 |
||
134 | C2ENH __z8bit IRQ2ENH,2 ; Port C2 Interrupt Enable & Priority |
||
135 | C2ENL __z8bit IRQ2ENL,2 |
||
136 | C1ENH __z8bit IRQ2ENH,1 ; Port C1 Interrupt Enable & Priority |
||
137 | C1ENL __z8bit IRQ2ENL,1 |
||
138 | C0ENH __z8bit IRQ2ENH,0 ; Port C0 Interrupt Enable & Priority |
||
139 | C0ENL __z8bit IRQ2ENL,0 |
||
140 | |||
141 | IRQES sfr 0fcdh ; Interrupt Edge Select |
||
142 | IRQCTL sfr 0fcfh ; Interrupt Control |
||
143 | IRQE __z8bit IRQCTL,7 ; Interrupt Request Enable |
||
144 | |||
145 | ;---------------------------------------------------------------------------- |
||
146 | ; Flash Memory Control |
||
147 | |||
148 | FCTL sfr 0ff8h ; Flash Control |
||
149 | FCMD __z8bfield FCTL,0,8 ; Flash Command |
||
150 | FSTAT sfr 0ff8h ; Flash Status |
||
151 | FPS sfr 0ff9h ; Flash Page Select |
||
152 | INFO_EN __z8bit FPS,7 ; Information Area Enable |
||
153 | PAGE __z8bfield FPS,0,7 ; Page Select |
||
154 | FPROT sfr 0ff9h ; Flash Sector Protect |
||
155 | FFREQH sfr 0ffah ; Flash Programming Frequency High Byte |
||
156 | FFREQL sfr 0ffbh ; Flash Programming Frequency Low Byte |
||
157 | FFREQ sfr FFREQH |
||
158 | |||
159 | ;---------------------------------------------------------------------------- |
||
160 | ; GPIO |
||
161 | |||
162 | __defgpio "A",0fd0h |
||
163 | __defgpio "B",0fd4h |
||
164 | __defgpio "C",0fd8h |
||
165 | |||
166 | ;---------------------------------------------------------------------------- |
||
167 | ; Timer |
||
168 | |||
169 | __deftimer "0",0f00h,0,1 |
||
170 | __deftimer "1",0f08h,0,1 |
||
171 | |||
172 | ;---------------------------------------------------------------------------- |
||
173 | ; UART |
||
174 | |||
175 | __defuart "0",0f40h |
||
176 | |||
177 | ;---------------------------------------------------------------------------- |
||
178 | ; I2C |
||
179 | |||
180 | __defi2c 0f50h |
||
181 | |||
182 | ;---------------------------------------------------------------------------- |
||
183 | ; SPI |
||
184 | |||
185 | __defspi 0f60h |
||
186 | |||
187 | ;---------------------------------------------------------------------------- |
||
188 | ; Analog/Digital Converter |
||
189 | |||
190 | if __hasadc |
||
191 | ADCCTL sfr 0f70h ; ADC Control 0 |
||
192 | CEN __z8bit ADCCTL,7 ; Conversion Enable |
||
193 | VREF __z8bit ADCCTL,5 ; Voltage Reference |
||
194 | CONT __z8bit ADCCTL,4 ; Continuous Conversion |
||
195 | ANAIN __z8bfield ADCCTL,0,3 ; Analog Input Select |
||
196 | ADCD_H sfr 0f72h ; ADC Data High Byte |
||
197 | ADCD_L sfr 0f73h ; ADC Data Low Bits |
||
198 | OVF __z8bit ADCD_L,0 ; Overflow Status |
||
199 | ADCD sfr ADCD_H |
||
200 | ADCSST sfr 0f74h ; ADC Sample Settling Time |
||
201 | SST __z8bfield ADCSST,0,3 ; Sample Settling Time |
||
202 | ADCST sfr 0f75h ; ADC sample time |
||
203 | ST __z8bfield ADCST,0,6 ; Sample Time |
||
204 | endif ; __hasadc |
||
205 | |||
206 | ;---------------------------------------------------------------------------- |
||
207 | ; Watchdog Timer |
||
208 | |||
209 | WDTCTL sfr 0ff0h ; Watchdog Timer Control |
||
210 | WDTU sfr 0ff1h ; Watchdog Timer Reload Upper Byte |
||
211 | WDTH sfr 0ff2h ; Watchdog Timer Reload High Byte |
||
212 | WDTL sfr 0ff3h ; Watchdog Timer Reload Low Byte |
||
213 | |||
214 | ;---------------------------------------------------------------------------- |
||
215 | |||
216 | restore |
||
217 | |||
218 | endif ; __regf0822inc |