DIRS for BS2P40??
Donalbane
Posts: 11
Is there a way to set the directions of all the pins (IN or OUT) in one place for the BS2P40? For the regular basic stamp, DIRS is a 16-bit number, but there are more than 16 I/O ports for the BS2P40. Is there an analogous variable to DIRS?
Thanks in advance,
Don
dtucker@arlut.utexas.edu
Thanks in advance,
Don
dtucker@arlut.utexas.edu
Comments
·· You can only set the DIRS for one bank of pins at a time.· In between you must use the MAINIO, AUXIO or IOTERM commands to switch between them.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
SPI_CLOCK······· CON··· 03· ' P04 - Clock line for SPI comms
POT_DOUT······· CON··· 01· ' X02 - Digital Pot Output
Potval·· VAR· Byte
Potval = 125
SHIFTOUT POT_DOUT, SPI_CLOCK, MSBPOST, [noparse][[/noparse]Potval \8]
How do I call the SHIFTOUT line which uses both ports from the MAINIO and the AUXIO side of the chip?
Don
· If you connected the pins for a synchronous serial device to different I/O ports on the BS2P40, it's not going to work, since you can only access one group at a time.· You will need to keep pins for similar devices on the same group (MAIN/AUX).··In fact, what is happening here is that the commands are trying to access those pins on the same group.· Both 1 and 3.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (Chris Savage (Parallax)) : 4/30/2005 12:00:23 AM GMT
Don
·· If you mean have the MAINIO and AUXIO pins connected together, I'm not sure that would be a good idea.· I suppose you could if you made sure the unused one was an input, but I certainly wouldn't recommend it.· It certainly isn't a conventional idea.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com