You can directly access groups of 4 or 8 pins using names like OUTL/OUTH and the nibble equivalents. Look at the section of the PBasic manual that talks about memory for the BS2. It lists all of these special names (and suffixes) and gives examples of their use.
Hmmm,· Well, I thought I understood but I guess not.· My understanding is that if I use OUTD = 1, pins 12 thru 15 will output high.· But only pin 12 goes high.
I tried this little piece of test code with LEDs on pins 12 thru 15.· The HIGH commands work, OUTD does not.· Only pin 12 goes high with OUTD.
When you write "OUTD = 1", you're really writing "OUTD = %0001" which sets the pins the way you're seeing. If you want to set all of them high, you have to write "OUTD = %1111" or "OUTD = $F" or "OUTD = 15"
Comments
I tried this little piece of test code with LEDs on pins 12 thru 15.· The HIGH commands work, OUTD does not.· Only pin 12 goes high with OUTD.
'
[noparse][[/noparse] Initialization ]
DIRS = %1111000000000000
'
[noparse][[/noparse] Program Code ]
Main:
HIGH 12
PAUSE 1000
LOW 12
PAUSE 1000
HIGH 13
PAUSE 1000
LOW 13
PAUSE 1000
HIGH 14
PAUSE 1000
LOW 14
PAUSE 1000
HIGH 15
PAUSE 1000
LOW 15
PAUSE 1000
OUTD = 1
PAUSE 1000
OUTD = 0
PAUSE 1000
GOTO Main
It has to be something simple.· Any Guidance?
Thanks,
Chris I.
Thanks Mike.