1 /*-------------------------------------------------------------------------
2 Register Declarations for the Atmel AT89S53 Processor
4 Written By - Jesus Calvino-Fraga / jesusc at ece.ubc.ca (March 2005)
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 In other words, you are welcome to use, share and improve this program.
21 You are forbidden to forbid anyone else to use, share and improve
22 what you give them. Help stamp out software-hoarding!
23 -------------------------------------------------------------------------*/
28 #include <8052.h> /* load difinitions for the 8052 core */
34 /* define AT89S53 specific registers only */
35 __sfr __at (0x84) DP1L; /* Data Pointer 1 Low Byte */
36 __sfr __at (0x85) DP1H; /* Data Pointer 1 High Byte */
37 __sfr __at (0x86) SPDR; /* SPI Data Register */
38 __sfr __at (0xAA) SPSR; /* SPI Status Register */
39 __sfr __at (0x96) WMCON; /* Watchdog and Memory Control Register */
40 __sfr __at (0xD5) SPCR; /* SPI Control Register */
42 /*------------------------------------------------
43 SPSR (0xAA) Bit Values - Reset Value = 0000.0000
44 ------------------------------------------------*/
45 #define WCOL_ 0x40 /* SPI Write Collision Flag: 1=Collision */
46 #define SPIF_ 0x80 /* SPI Interrupt Flag */
48 /*------------------------------------------------
49 WMCON (0x96) Bit Values
50 ------------------------------------------------*/
53 #define WDTRST_ 0x02 /* Watchdog Timer Reset and EEPROM Ready,/Busy Flag*/
54 #define EERDY_ 0x02 /* Watchdog Timer Reset and EEPROM Ready,/Busy Flag */
56 #define DPS_ 0x04 /* Data Pointer Select: 0=DP0, 1=DP1 */
57 #define EEMEN_ 0x08 /* Internal EEPROM Access Enable: 1=Enabled */
58 #define EEMWE_ 0x10 /* Internal EEPROM Write Enable: 1=Enabled */
59 #define PS0_ 0x20 /* Prescaler bit 0 for the Watchdog Timer */
60 #define PS1_ 0x40 /* Prescaler bit 1 for the Watchdog Timer */
61 #define PS2_ 0x80 /* Prescaler bit 2 for the Watchdog Timer */
62 /* 000 = 16ms Timeout */
63 /* 001 = 32ms Timeout */
64 /* 010 = 64ms Timeout */
65 /* 011 = 128ms Timeout */
66 /* 100 = 256ms Timeout */
67 /* 101 = 512ms Timeout */
68 /* 110 = 1024ms Timeout */
69 /* 111 = 2048ms Timeout */
71 /*------------------------------------------------
72 SPCR (0xD5) Bit Values - Reset Value = 0000.01XX
73 ------------------------------------------------*/
74 #define SPR0_ 0x01 /* SPI Clock Rate Select bit 0 */
75 #define SPR1_ 0x02 /* SPI Clock Rate Select bit 1 */
81 #define CPHA_ 0x04 /* SPI Clock Phase */
82 #define CPOL_ 0x08 /* SPI Clock Polarity */
83 #define MSTR_ 0x10 /* SPI Master/Slave Select: 0=Slave, 1=Master */
84 #define DORD_ 0x20 /* SPI Data Order: 0=MSB First, 1=LSB First */
85 #define SPE_ 0x40 /* SPI Enable: 0=Disabled, 1=Enabled */
86 #define SPIE_ 0x80 /* SPI Interrupt Enable: 0=Disabled, 1=Enabled */
88 #endif /*REG_AT89S53_H*/