SX28 Port IO
Hi, I'm trying to write a simple test to verify the IO ports on the SX. I have initialized the rb ports as outputs and the rc ports as inputs. I have a connector that will reroute the rb outputs to rc. I'm getting an error trying to use the WATCH directive for rc. Is there another way I can check if rc is getting what rb is sending out?
Here is the code:
;
INITIALIZATION ROUTINE
Initialize
;Port Direction Configuration
MODE W, #$0F ;Set Mode to allow Direction Configuration
mov M,W
mov !ra,#%0000 ;Set port A low, output
mov !rb,#%00000000 ;Set port B low, output
mov !rc,#%11111111 ;Set port C bit, input
;
MAIN PROGRAM
Main
setb rb.0
WATCH rb.0, 1, UBIN
WATCH rc.0, 1, UBIN
jmp Main
thanks!
Here is the code:
;
INITIALIZATION ROUTINE
Initialize
;Port Direction Configuration
MODE W, #$0F ;Set Mode to allow Direction Configuration
mov M,W
mov !ra,#%0000 ;Set port A low, output
mov !rb,#%00000000 ;Set port B low, output
mov !rc,#%11111111 ;Set port C bit, input
;
MAIN PROGRAM
Main
setb rb.0
WATCH rb.0, 1, UBIN
WATCH rc.0, 1, UBIN
jmp Main
thanks!
Comments
That is strange...WATCH gives an error if the symbol is not used in the program.
Just add a line that does something with RC and it will work. Something like "SETB rc.0".
P.S. "MODE W,#$0F" should be "MOV W,#$0F"
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?
www.iElectronicDesigns.com
·
THANKS!!
Lily