;---------------------------------------------------------------------------
; 
; 
;
;
; FILE NAME: C8051F350.INC
; TARGET MCUs: C8051F350, F350, F351, F352, F353
; DESCRIPTION: Register/bit definitions for the C8051F350 product family.
;
; REVISION 1.1
;
;---------------------------------------------------------------------------

;REGISTER DEFINITIONS
;
P0             DATA 080H    ; PORT 0 LATCH
SP             DATA 081H    ; STACK POINTER
DPL            DATA 082H    ; DATA POINTER LOW
DPH            DATA 083H    ; DATA POINTER HIGH
PCON           DATA 087H    ; POWER CONTROL
TCON           DATA 088H    ; TIMER/COUNTER CONTROL
TMOD           DATA 089H    ; TIMER/COUNTER MODE
TL0            DATA 08AH    ; TIMER/COUNTER 0 LOW
TL1            DATA 08BH    ; TIMER/COUNTER 1 LOW
TH0            DATA 08CH    ; TIMER/COUNTER 0 HIGH
TH1            DATA 08DH    ; TIMER/COUNTER 1 HIGH
CKCON          DATA 08EH    ; CLOCK CONTROL
PSCTL          DATA 08FH    ; PROGRAM STORE R/W CONTROL
P1             DATA 090H    ; PORT 1 LATCH
TMR3CN         DATA 091H    ; TIMER/COUNTER 3CONTROL
TMR3RLL        DATA 092H    ; TIMER/COUNTER 3 RELOAD LOW
TMR3RLH        DATA 093H    ; TIMER/COUNTER 3 RELOAD HIGH
TMR3L          DATA 094H    ; TIMER/COUNTER 3 LOW
TMR3H          DATA 095H    ; TIMER/COUNTER 3 HIGH
IDA0           DATA 096H    ; CURRENT MODE DAC0 LOW
SCON0          DATA 098H    ; UART0 CONTROL
SBUF0          DATA 099H    ; UART0 DATA BUFFER
ADC0DECL       DATA 09AH    ; ADC0 DECIMATION LOW
ADC0DECH       DATA 09BH    ; ADC0 DECIMATION HIGH
CPT0CN         DATA 09CH    ; COMPARATOR0 CONTROL
CPT0MD         DATA 09DH    ; COMPARATOR0 MODE SELECTION
CPT0MX         DATA 09FH    ; COMPARATOR0 MUX SELECTION
P2             DATA 0A0H    ; PORT 2 LATCH
SPI0CFG        DATA 0A1H    ; SPI CONFIGURATION
SPI0CKR        DATA 0A2H    ; SPI CLOCK RATE CONTROL
SPI0DAT        DATA 0A3H    ; SPI DATA
P0MDOUT        DATA 0A4H    ; PORT 0 OUTPUT MODE CONFIGURATION
P1MDOUT        DATA 0A5H    ; PORT 1 OUTPUT MODE CONFIGURATION
P2MDOUT        DATA 0A6H    ; PORT 2 OUTPUT MODE CONFIGURATION
IE             DATA 0A8H    ; INTERRUPT ENABLE
CLKSEL         DATA 0A9H    ; CLOCK SELECT
EMI0CN         DATA 0AAH    ; EXTERNAL MEMORY INTERFACE CONTROL
ADC0CGL        DATA 0ABH    ; ADC0 GAIN CALIBRATION LOW
ADC0CGM        DATA 0ACH    ; ADC0 GAIN CALIBRATION MIDDLE
ADC0CGH        DATA 0ADH    ; ADC0 GAIN CALIBRATION HIGH
OSCXCN         DATA 0B1H    ; EXTERNAL OSCILLATOR CONTROL
OSCICN         DATA 0B2H    ; INTERNAL OSCILLATOR CONTROL
OSCICL         DATA 0B3H    ; INTERNAL OSCILLATOR CALIBRATION
FLSCL          DATA 0B6H    ; FLASH SCALE
FLKEY          DATA 0B7H    ; FLASH LOCK AND KEY
IP             DATA 0B8H    ; INTERRUPT PRIORITY
IDA0CN         DATA 0B9H    ; CURRENT MODE DAC0 CONTROL
ADC0COL        DATA 0BAH    ; ADC0 OFFSET CALIBRATION LOW
ADC0COM        DATA 0BBH    ; ADC0 OFFSET CALIBRATION MIDDLE
ADC0COH        DATA 0BCH    ; ADC0 OFFSET CALIBRATION HIGH
ADC0BUF        DATA 0BDH    ; ADC0 BUFFER CONTROL
CLKMUL         DATA 0BEH    ; CLOCK MULTIPLIER
ADC0DAC        DATA 0BFH    ; ADC0 OFFSET DAC
SMB0CN         DATA 0C0H    ; SMBUS CONTROL
SMB0CF         DATA 0C1H    ; SMBUS CONFIGURATION
SMB0DAT        DATA 0C2H    ; SMBUS DATA
ADC0L          DATA 0C3H    ; ADC0 OUTPUT LOW
ADC0M          DATA 0C4H    ; ADC0 OUTPUT MIDDLE
ADC0H          DATA 0C5H    ; ADC0 OUTPUT HIGH
ADC0MUX        DATA 0C6H    ; ADC0 MULTIPLEXER
TMR2CN         DATA 0C8H    ; TIMER/COUNTER 2 CONTROL
TMR2RLL        DATA 0CAH    ; TIMER/COUNTER 2 RELOAD LOW
TMR2RLH        DATA 0CBH    ; TIMER/COUNTER 2 RELOAD HIGH
TMR2L          DATA 0CCH    ; TIMER/COUNTER 2 LOW
TMR2H          DATA 0CDH    ; TIMER/COUNTER 2 HIGH
PSW            DATA 0D0H    ; PROGRAM STATUS WORD
REF0CN         DATA 0D1H    ; VOLTAGE REFERENCE CONTROL
P0SKIP         DATA 0D4H    ; PORT 0 SKIP
P1SKIP         DATA 0D5H    ; PORT 1 SKIP
IDA1CN         DATA 0D7H    ; CURRENT MODE DAC1 CONTROL
PCA0CN         DATA 0D8H    ; PCA CONTROL
PCA0MD         DATA 0D9H    ; PCA MODE
PCA0CPM0       DATA 0DAH    ; PCA MODULE 0 MODE
PCA0CPM1       DATA 0DBH    ; PCA MODULE 1 MODE
PCA0CPM2       DATA 0DCH    ; PCA MODULE 2 MODE
IDA1           DATA 0DDH    ; CURRENT MODE DAC1 LOW
ACC            DATA 0E0H    ; ACCUMULATOR
XBR0           DATA 0E1H    ; PORT I/O CROSSBAR CONTROL 0
XBR1           DATA 0E2H    ; PORT I/O CROSSBAR CONTROL 1
PFE0CN         DATA 0E3H    ; PREFETCH ENGINE CONTROL
IT01CF         DATA 0E4H    ; INT0/INT1 CONFIGURATION
EIE1           DATA 0E6H    ; EXTENDED INTERRUPT ENABLE 1
ADC0STA        DATA 0E8H    ; ADC0 STATUS
PCA0CPL0       DATA 0E9H    ; PCA CAPTURE 0 LOW
PCA0CPH0       DATA 0EAH    ; PCA CAPTURE 0 HIGH
PCA0CPL1       DATA 0EBH    ; PCA CAPTURE 1 LOW
PCA0CPH1       DATA 0ECH    ; PCA CAPTURE 1 HIGH
PCA0CPL2       DATA 0EDH    ; PCA CAPTURE 2 LOW
PCA0CPH2       DATA 0EEH    ; PCA CAPTURE 2 HIGH
B              DATA 0F0H    ; B REGISTER
RSTSRC         DATA 0EFH    ; RESET SOURCE CONFIGURATION/STATUS
P0MDIN         DATA 0F1H    ; PORT 0 INPUT MODE CONFIGURATION
P1MDIN         DATA 0F2H    ; PORT 1 INPUT MODE CONFIGURATION
ADC0MD         DATA 0F3H    ; ADC0 MODE
ADC0CN         DATA 0F4H    ; ADC0 CONTROL
EIP1           DATA 0F6H    ; EXTENDED INTERRUPT PRIORITY 1
ADC0CLK        DATA 0F7H    ; ADC0 CLOCK
SPI0CN         DATA 0F8H    ; SPI CONTROL
PCA0L          DATA 0F9H    ; PCA COUNTER LOW
PCA0H          DATA 0FAH    ; PCA COUNTER HIGH
ADC0CF         DATA 0FBH    ; ADC0 CONFIGURATION
ADC0FL         DATA 0FCH    ; ADC0 FAST FILTER OUTPUT LOW
ADC0FM         DATA 0FDH    ; ADC0 FAST FILTER OUTPUT MIDDLE
ADC0FH         DATA 0FEH    ; ADC0 FAST FILTER OUTPUT HIGH
VDM0CN         DATA 0FFH    ; VDD MONITOR CONTROL

;
;------------------------------------------------------------------------------
;BIT DEFINITIONS
;
; TCON 088H
TF1            BIT 08FH     ; TIMER 1 OVERFLOW FLAG
TR1            BIT 08EH     ; TIMER 1 ON/OFF CONTROL
TF0            BIT 08DH     ; TIMER 0 OVERFLOW FLAG
TR0            BIT 08CH     ; TIMER 0 ON/OFF CONTROL
IE1            BIT 08BH     ; EXT. INTERRUPT 1 EDGE FLAG
IT1            BIT 08AH     ; EXT. INTERRUPT 1 TYPE
IE0            BIT 089H     ; EXT. INTERRUPT 0 EDGE FLAG
IT0            BIT 088H     ; EXT. INTERRUPT 0 TYPE

; SCON0 098H
S0MODE         BIT 09FH     ; UART 0 MODE
MCE0           BIT 09DH     ; UART 0 MCE
REN0           BIT 09CH     ; UART 0 RX ENABLE
TB80           BIT 09BH     ; UART 0 TX BIT 8
RB80           BIT 09AH     ; UART 0 RX BIT 8
TI0            BIT 099H     ; UART 0 TX INTERRUPT FLAG
RI0            BIT 098H     ; UART 0 RX INTERRUPT FLAG

; IE 0A8H
EA             BIT 0AFH     ; GLOBAL INTERRUPT ENABLE
ESPI0          BIT 0AEH     ; SPI0 INTERRUPT ENABLE
ET2            BIT 0ADH     ; TIMER 2 INTERRUPT ENABLE
ES0            BIT 0ACH     ; UART0 INTERRUPT ENABLE
ET1            BIT 0ABH     ; TIMER 1 INTERRUPT ENABLE
EX1            BIT 0AAH     ; EXTERNAL INTERRUPT 1 ENABLE
ET0            BIT 0A9H     ; TIMER 0 INTERRUPT ENABLE
EX0            BIT 0A8H     ; EXTERNAL INTERRUPT 0 ENABLE

; IP 0B8H
PSPI0          BIT 0BEH     ; SPI0 PRIORITY
PT2            BIT 0BDH     ; TIMER 2 PRIORITY
PS0            BIT 0BCH     ; UART0 PRIORITY
PT1            BIT 0BBH     ; TIMER 1 PRIORITY
PX1            BIT 0BAH     ; EXTERNAL INTERRUPT 1 PRIORITY
PT0            BIT 0B9H     ; TIMER 0 PRIORITY
PX0            BIT 0B8H     ; EXTERNAL INTERRUPT 0 PRIORITY

; SMB0CN 0C0H
MASTER         BIT 0C7H     ; SMBUS 0 MASTER/SLAVE
TXMODE         BIT 0C6H     ; SMBUS 0 TRANSMIT MODE
STA            BIT 0C5H     ; SMBUS 0 START FLAG
STO            BIT 0C4H     ; SMBUS 0 STOP FLAG
ACKRQ          BIT 0C3H     ; SMBUS 0 ACKNOWLEDGE REQUEST
ARBLOST        BIT 0C2H     ; SMBUS 0 ARBITRATION LOST
ACK            BIT 0C1H     ; SMBUS 0 ACKNOWLEDGE FLAG
SI             BIT 0C0H     ; SMBUS 0 INTERRUPT PENDING FLAG

; TMR2CN 0C8H
TF2H           BIT 0CFH     ; TIMER 2 HIGH BYTE OVERFLOW FLAG
TF2L           BIT 0CEH     ; TIMER 2 LOW BYTE OVERFLOW FLAG
TF2LEN         BIT 0CDH     ; TIMER 2 LOW BYTE INTERRUPT ENABLE
T2SPLIT        BIT 0CBH     ; TIMER 2 SPLIT MODE ENABLE
TR2            BIT 0CAH     ; TIMER 2 ON/OFF CONTROL
T2XCLK         BIT 0C8H     ; TIMER 2 EXTERNAL CLOCK SELECT

; PSW 0D0H
CY             BIT 0D7H     ; CARRY FLAG
AC             BIT 0D6H     ; AUXILIARY CARRY FLAG
F0             BIT 0D5H     ; USER FLAG 0
RS1            BIT 0D4H     ; REGISTER BANK SELECT 1
RS0            BIT 0D3H     ; REGISTER BANK SELECT 0
OV             BIT 0D2H     ; OVERFLOW FLAG
F1             BIT 0D1H     ; USER FLAG 1
P              BIT 0D0H     ; ACCUMULATOR PARITY FLAG

; PCA0CN 0D8H
CF             BIT 0DFH     ; PCA 0 COUNTER OVERFLOW FLAG
CR             BIT 0DEH     ; PCA 0 COUNTER RUN CONTROL BIT
CCF2           BIT 0DAH     ; PCA 0 MODULE 2 INTERRUPT FLAG
CCF1           BIT 0D9H     ; PCA 0 MODULE 1 INTERRUPT FLAG
CCF0           BIT 0D8H     ; PCA 0 MODULE 0 INTERRUPT FLAG
                            ; ADC 0 WINDOW INTERRUPT FLAG
; ADC0STA 0E8H
AD0BUSY        BIT 0EFH     ; ADC 0 CONVERSION IN PROGRESS FLAG
AD0CBSY        BIT 0EEH     ; ADC 0 CALIBRATION IN PROGRESS FLAG
AD0INT         BIT 0EDH     ; ADC 0 CONVERSION COMPLETE FLAG
AD0S3C         BIT 0ECH     ; ADC 0 SINC3 FILTER ERROR FLAG
AD0FFC         BIT 0EBH     ; ADC 0 FAST FILTER ERROR FLAG
AD0CALC        BIT 0EAH     ; ADC 0 CALIBRATION COMPLETE FLAG
AD0ERR         BIT 0E9H     ; ADC 0 ERROR FLAG
AD0OVR         BIT 0E8H     ; ADC 0 OVERRUN FLAG

; SPI0CN 0F8H
SPIF           BIT 0FFH     ; SPI 0 INTERRUPT FLAG
WCOL           BIT 0FEH     ; SPI 0 WRITE COLLISION FLAG
MODF           BIT 0FDH     ; SPI 0 MODE FAULT FLAG
RXOVRN         BIT 0FCH     ; SPI 0 RX OVERRUN FLAG
NSSMD1         BIT 0FBH     ; SPI 0 SLAVE SELECT MODE 1
NSSMD0         BIT 0FAH     ; SPI 0 SLAVE SELECT MODE 0
TXBMT          BIT 0F9H     ; SPI 0 TX BUFFER EMPTY FLAG
SPIEN          BIT 0F8H     ; SPI 0 SPI ENABLE
