ef25cf06aabcb4f8966c59b65eaa30fcea54ca9b
[fw/sdcc] / device / include / ds80c390.h
1 /*-------------------------------------------------------------------------
2   Register Declarations for the DALLAS DS80C390 Processor
3   far from complete, e.g. no CAN
4   
5    Written By - Johan Knol, johan.knol@iduna.nl
6     
7    This program is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published by the
9    Free Software Foundation; either version 2, or (at your option) any
10    later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20    
21    In other words, you are welcome to use, share and improve this program.
22    You are forbidden to forbid anyone else to use, share and improve
23    what you give them.   Help stamp out software-hoarding!  
24 -------------------------------------------------------------------------*/
25
26 #ifndef DS80C390_H
27 #define DS80C390_H
28
29 sfr at 0x80 P4; // ce3..ce0, a19..a16
30 sfr at 0x81 SP; // stack pointer
31 sfr at 0x82 DPL; // data pointer 0 lsb
32 sfr at 0x83 DPH; // data pointer 0 msb
33 sfr at 0x84 DPL1; // data pointer 1 lsb
34 sfr at 0x85 DPH1; // data pointer 1 msb
35 sfr at 0x86 DPS; // data pointer select
36 sfr at 0x87 PCON; // power control
37 sfr at 0x88 TCON; // timer/counter control
38   sbit at 0x88 IT0;
39   sbit at 0x89 IE0;
40   sbit at 0x8a IT1;
41   sbit at 0x8b IE1;
42   sbit at 0x8c TR0;
43   sbit at 0x8d TF0;
44   sbit at 0x8e TR1;
45   sbit at 0x8f TF1;
46 sfr at 0x89 TMOD; // timer mode control
47 sfr at 0x8a TL0; // timer 0 lsb
48 sfr at 0x8b TL1; // timer 1 msb
49 sfr at 0x8c TH0; // timer 0 msb
50 sfr at 0x8d TH1; // timer 1 msb
51 sfr at 0x8e CKCON; // clock control
52 sfr at 0x90 P1;
53   sbit at 0x90 T2;
54   sbit at 0x91 T2EX;
55   sbit at 0x92 RXD1;
56   sbit at 0x93 TXD1;
57   sbit at 0x94 INT2;
58   sbit at 0x95 INT3;
59   sbit at 0x96 INT4;
60   sbit at 0x97 INT5;
61 sfr at 0x91 EXIF; // external interrupt flag
62 sfr at 0x92 P4CNT;
63 sfr at 0x93 DPX; // extended datapointer 0
64 sfr at 0x95 DPX1; // extended datapointer 1
65 sfr at 0x98 SCON0; // serial 0 control
66   sbit at 0x98 RI_0;
67   sbit at 0x99 TI_0;
68   sbit at 0x9a RB8_0;
69   sbit at 0x9b TB8_0;
70   sbit at 0x9c REN_0;
71   sbit at 0x9d SM2_0;
72   sbit at 0x9e SM1_0;
73   sbit at 0x9f SM0_0;
74   sbit at 0x9f FE_0; // depending on SMOD0
75 sfr at 0x99 SBUF0; // serial 0 data buffer
76 sfr at 0x9b ESP; // extended stack pointer
77 sfr at 0x9c AP; // address page
78 sfr at 0x9d ACON; // address control
79 sfr at 0xa0 P2; // never mind the sbits
80 sfr at 0xa1 P5;
81 sfr at 0xa2 P5CNT;
82 sfr at 0xa8 IE; // interrupt enable
83   sbit at 0xa8 EX0;
84   sbit at 0xa9 ET0;
85   sbit at 0xaa EX1;
86   sbit at 0xab ET1;
87   sbit at 0xac ES0;
88   sbit at 0xad ET2;
89   sbit at 0xae ES1;
90   sbit at 0xaf EA;
91 sfr at 0xb0 P3;
92   sbit at 0xb0 RXD0;
93   sbit at 0xb1 TXD0;
94   sbit at 0xb2 INT0;
95   sbit at 0xb3 INT1;
96   sbit at 0xb4 T0;
97   sbit at 0xb5 T1;
98   sbit at 0xb6 WR;
99   sbit at 0xb7 RD;
100 sfr at 0xb8 IP; // interupt priority 
101   sbit at 0xb8 PX0; // external 0
102   sbit at 0xb9 PT0; // timer 0
103   sbit at 0xba PX1; // external 1
104   sbit at 0xbb PT1; // timer 1
105   sbit at 0xbc PS0; // serial port 0
106   sbit at 0xbd PT2; // timer 2
107   sbit at 0xbe PS1; // serial port 1
108 sfr at 0xc0 SCON1; // serial 1 control
109   sbit at 0xc0 RI_1;
110   sbit at 0xc1 TI_1;
111   sbit at 0xc2 RB8_1;
112   sbit at 0xc3 TB8_1;
113   sbit at 0xc4 REN_1;
114   sbit at 0xc5 SM2_1;
115   sbit at 0xc6 SM1_1;
116   sbit at 0xc7 SM0_1;
117   sbit at 0xc7 FE_1; // depending on SMOD0
118 sfr at 0xc1 SBUF1; // serial 1 data buffer
119 sfr at 0xc4 PMR; // power managment
120 sfr at 0xc6 MCON; // memory control register
121 sfr at 0xc7 TA; // timed access register
122 sfr at 0xc8 T2CON; // timer 2 control
123   sbit at 0xc8 CP_RL; // capture/reload
124   sbit at 0xc9 C_T; // count/timer
125   sbit at 0xca TR2; // stop/run
126   sbit at 0xcb EXEN2;
127   sbit at 0xcc TCLK;
128   sbit at 0xcd RCLK;
129   sbit at 0xce EXF2;
130   sbit at 0xcf TF2; // overflow flag
131 sfr at 0xc9 T2MOD; // timer 2 mode
132 sfr at 0xca RCAP2L; // timer 2 capture/reload
133 sfr at 0xca RTL2; // depends on CP_RL
134 sfr at 0xcb RCAP2H;
135 sfr at 0xcb RTH2;
136 sfr at 0xcc TL2; // timer 2 lsb
137 sfr at 0xcd TH2; // timer 2 msb
138 sfr at 0xd0 PSW; // program status word (byte actually)
139   sbit at 0xd0 P; // parity
140   sbit at 0xd1 F1; // user flag 1
141   sbit at 0xd2 OV; // overflow flag
142   sbit at 0xd3 RS0; // register select l
143   sbit at 0xd4 RS1; // register select h
144   sbit at 0xd5 F0; // user flag 0
145   sbit at 0xd6 AC; // auxiliary carry flag
146   sbit at 0xd7 CY; // carry flag
147 sfr at 0xd1 MCNT0; // arithmetic accellerator
148 sfr at 0xd2 MCNT1;
149 sfr at 0xd3 MA;
150 sfr at 0xd4 MB;
151 sfr at 0xd5 MC;
152 sfr at 0xd8 WDCON; // watch dog
153   sbit at 0xd8 RWT;
154   sbit at 0xd9 EWT;
155   sbit at 0xda WDRF;
156   sbit at 0xdb WDIF;
157   sbit at 0xdc PFI;
158   sbit at 0xdd EPFI;
159   sbit at 0xde POR;
160   sbit at 0xdf SMOD_1;
161 sfr at 0xe0 ACC; // accumulator
162 sfr at 0xe8 EIE; // extended interrupt enable
163   sbit at 0xe8 EX2;
164   sbit at 0xe9 EX3;
165   sbit at 0xea EX4;
166   sbit at 0xeb EX5;
167   sbit at 0xec EWDI;
168   sbit at 0xed C1IE;
169   sbit at 0xee C0IE;
170   sbit at 0xef CANBIE;
171 sfr at 0xea MXAX; // extended address register
172 sfr at 0xf0 B; // aux accumulator
173 sfr at 0xf8 EIP; // extended interrupt priority
174   sbit at 0xf8 PX2;
175   sbit at 0xf9 PX3;
176   sbit at 0xfa PX4;
177   sbit at 0xfb PX5;
178   sbit at 0xfc PWDI;
179   sbit at 0xfd C1IP;
180   sbit at 0xfe C0IP;
181   sbit at 0xff CANBIP;
182
183 #endif /* DS80C390_H */