\ sfr120.fs -- 120 SFR assignments 13Aug07rjn

$84 constant SFRPAGE  \ all
$0f constant CONFIG_PAGE
:m SFR-0 $00 # SFRPAGE #! m;
:m SFR-1 $01 # SFRPAGE #! m;
:m SFR-2 $02 # SFRPAGE #! m;
:m SFR-3 $03 # SFRPAGE #! m;  \ 30Jul06 rjn
:m SFR-f CONFIG_PAGE # SFRPAGE #! m;  \ 09Oct07 rjn

$ff constant WDTCN  \ all watch dog timmer
$8e constant CKCON  \ 0
$8c constant OSCXCN \ SFR-f
$91 constant SSTA0  \ 0
$a1 constant EMIOTC \ 0 ext ram accesss timing setup values reset $ff
$a2 constant EMIOCN \ 0 xram access high byte for 8 bit movx reset $00
$a3 constant EMIOCF \ 0 ext vs int ram setup values reset $03

$b7 constant FLSCL  \ 0 flash memory control reset $80
$8f constant PSCTL  \ 0 program store rd/wr control reset $00

$b1 constant PSBANK  \ all
$e6 constant EIE1    \ all
$e7 constant EIE2    \ all
$f6 constant EIP1    \ all
$f7 constant EIP2    \ all

$BC constant ADC0CF  \ 0 ADC0 configuration
$E8 constant ADC0CN  \ 0 ADC0 control
$C5 constant ADC0GTH \ 0 ADC0 greater than high byte
$C4 constant ADC0GTL \ 0 ADC0 greater than low byte
$BF constant ADC0H   \ 0 ADC0 data word high byte
$BE constant ADC0L   \ 0 ADC0 data word low byte
$C7 constant ADC0LTH \ 0 ADC0 less than high byte
$C6 constant ADC0LTL \ 0 ADC0 less than low byte
[ : .ADC0CN ADC0CN + ; ]

$BE constant ADC2    \ 2 ADC2 data word
$BC constant ADC2CF  \ 2 ADC2 configuration
$E8 constant ADC2CN  \ 2 ADC2 control
$C4 constant ADC2GT  \ 2 ADC2 greater than
$C6 constant ADC2LT  \ 2 ADC2 less than

$BA constant AMX0CF  \ 0 ADC0 Multiplex configuration
$BB constant AMX0SL  \ 0 ADC0 Multiplexer channel select
$BA constant AMX2CF  \ 2 ADC2 Multiplexer configuration
$BB constant AMX2SL  \ 2 ADC2 Multiplexer channel select

$d2 constant DAC0L   \ 0
$d3 constant DAC0H   \ 0
$d4 constant DAC0CN  \ 0

$d2 constant DAC1L   \ 1
$d3 constant DAC1H   \ 1
$d4 constant DAC1CN  \ 1

$d1 constant REF0CN  \ 0

\ defined in misc8051
\ $a8 constant IE      \ all 
\ $b8 constant IP      \ all
\ $88 constant TCON    \ 0
\ $89 constant TMOD    \ 0
\ $8a constant TL0     \ 0
\ $8b constant TL1     \ 0
\ $8c constant TH0     \ 0
\ $8d constant TH1     \ 0

$c8 constant TMR2CN  \ 0
:m .TMR3CN [ TMR2CN + ] m;
$c9 constant TMR2CF  \ 0
$ca constant RCAP2L  \ 0
$cb constant RCAP2H  \ 0
$cc constant TMR2L   \ 0
$cd constant TMR2H   \ 0

$c8 constant TMR3CN  \ 1
:m .TMR3CN [ TMR3CN + ] m;
$c9 constant TMR3CF  \ 1
$ca constant RCAP3L  \ 1
$cb constant RCAP3H  \ 1
$cc constant TMR3L   \ 1
$cd constant TMR3H   \ 1

$c8 constant TMR4CN  \ 2
:m .TMR3CN [ TMR4CN + ] m;
$c9 constant TMR4CF  \ 2
$ca constant RCAP4L  \ 2
$cb constant RCAP4H  \ 2
$cc constant TMR4L   \ 2
$cd constant TMR4H   \ 2

\ SFR definitions.
$e1 constant XBR0  \ $0f
$e2 constant XBR1  \ $0f
$e3 constant XBR2  \ $0f
$a4 constant P0MDOUT  \ $0f
$a5 constant P1MDOUT  \ $0f
$a6 constant P2MDOUT  \ $0f
$8a constant OSCICN  \ 0f
$b7 constant FLSCL   \ $00
$89 constant PLL0CN  \ $0f
$8d constant PLL0DIV  \ $0f
$8e constant PLL0MUL  \ $0f
$8f constant PLL0FLT  \ $0f
$97 constant CLKSEL  \ $0f
$9a constant SPI0CFG  \ $00
$f8 constant SPI0CN  \ $00
$9d constant SPI0CKR  \ $00
$9b constant SPI0DAT  \ $00
[ : .SPI0CN SPI0CN + ;
  : .SPI0DAT SPI0DAT + ; ]

\ Multiply and Accumulate.
$c0 constant MAC0STA  \ $03
$c1 constant MAC0AL   \ $03
$c2 constant MAC0AH   \ $03
$c3 constant MAC0CF   \ $03
$91 constant MAC0BL   \ $03
$92 constant MAC0BH   \ $03
$93 constant MAC0ACC0 \ $03
$94 constant MAC0ACC1 \ $03
$95 constant MAC0ACC2 \ $03
$96 constant MAC0ACC3 \ $03
$97 constant MAC0OVR  \ $03
$ce constant MAC0RNDL \ $03
$cf constant MAC0RNDH \ $03

$d8 constant PCA0CN   \ $00
$d9 constant PCA0MD   \ $00
$da constant PCA0CPM0 \ $00
$db constant PCA0CPM1 \ $00
$dc constant PCA0CPM2 \ $00
$dd constant PCA0CPM3 \ $00
$de constant PCA0CPM4 \ $00
$df constant PCA0CPM5 \ $00
$f9 constant PCA0L    \ $00
$fa constant PCA0H    \ $00
$fb constant PCA0CPL0 \ $00
$fc constant PCA0CPH0 \ $00

\ Additional i/o ports
$a7 constant P3MDOUT    \ $0f   13Aug07rjn
$c8 constant P4       	\ $0f
$9c constant P4MDOUT  	\ $0f
$d8 constant P5       	\ $0f
$9d constant P5MDOUT  	\ $0f
$e8 constant P6       	\ $0f
$9e constant P6MDOUT  	\ $0f
$f8 constant P7       	\ $0f   13Aug07rjn 
$9f constant P7MDOUT  	\ $0f   13Aug07rjn  
[ : .P4 P4 + ; ]      	\ $0f 
[ : .P5 P5 + ; ]    	\ $0f 
[ : .P6 P6 + ; ]	\ $0f 
[ : .P7 P7 + ; ]	\ $0f   13Aug07rjn 
\ 
0 [if] -------------------------------[ Notes ]--------------------------------
1. Added port 3 and 7 definitions 13Aug07rjn
2. Added ADC definitions for temperature 20Aug07 bdk
------------------------------------------------------------------------ [then] 
 
