BasicX multitasking, serial networking

Started by wizzawho November 22, 2006
I'm researching the BasicX controller for a project and am not sure
it's capable of doing what I need it to. Maybe someone in this
group can help me out. Can I look at the state of 16 input pins as
an integer? Or 2 groups of 8 I/O as two bytes? Basic Stamp has INS
(for 8 pins) and OOPic has oDIO16 to read multiple I/O. The
BasicX "getPin" command only looks at one pin at a time. Is there a
memory location for I/O that I can use?

The state of the pins is the first priority. If all pins are 1 I
turn on an output, if all are 0 I turn on a different output. Kind
of like a 16 input AND and NOR, this needs to be almost hardware
fast.

In the background I need to monitor serial commands from a master
controller that will send mask bytes to ignore certain pins. The
Basic Stamp doesn't have an input buffer to store incoming serial
data and the OOPic is too slow with the serial comms. There will be
8 slaves linked to one master.

thanks,
Geoff
> ... Or 2 groups of 8 I/O as two bytes?

Yes. BX-24 pins 5 through 12 are in Register.PortC and pins 13 through
20 can be read in Register.PortA. The values are bytes; simply use them
like any byte variable:
bA = register.PortA
bC = register.PortC
If (register.PortC and bx00100000)

All pins in each byte will be sampled simultaneously, but you can't get
simultaneous data from both ports. There will be something on the order
of 50uS between two successive port reads in BasicX.
Tom
COM1 is a hardware UART, so you will be able to capture any serial commands from the computer. Additionally, Pin 26 and 27 are available as outputs. If you plan on having an output, but have used all 16 pins for your input, you can use Pin26 & 27. Both of these are connected to the Red and Green LED on the BX24. If you use them, remember that when the pin is HIGH (or input), the LED is OFF. When it is LOW, the LED is ON.

Thad

wizzawho wrote:
The state of the pins is the first priority. If all pins are 1 I
turn on an output, if all are 0 I turn on a different output.

In the background I need to monitor serial commands from a master
controller
Recent Activity

2
New Members

Visit Your Group
SPONSORED LINKS

Microprocessor
Microprocessor architecture
Microcontrollers

Yahoo! News
Fashion News
What's the word on
fashion and style?

Y! GeoCities
Be Vocal
Publish your opi-
nions with a blog.

Sitebuilder
Build a web site
quickly & easily
with Sitebuilder.

.

---------------------------------
Sponsored Link

Want a degree but can't afford to quit? Online degrees from top schools - in as fast as 1 year
> ... Pin 26 and 27 are available as outputs.

Actually, pins 25, 26 and 27 are available. Pin 25 controls the red
LED, as Thad describes correctly except for the pin numbers, 26
controls the green LED, and 27 is free. All three of these pins are
timer outputs that can be used like any other logic pin. Since 25 and
26 have LEDs connected to them, high logic level on those pins will
not be the same as an empty pin, though.
Tom