Shop OBEX P1 Docs P2 Docs Learn Events
"simulate" multi-thread on the BS2E — Parallax Forums

"simulate" multi-thread on the BS2E

Jack JordanJack Jordan Posts: 24
edited 2008-09-09 02:05 in BASIC Stamp
Is it possibly to "simulate" a multithread output on the BS2e with the OUTL, OUTH command ?

variable_1·· VAR··· OUTL····[noparse]:D[/noparse]IRL %11111111
variable_2·· VAR·· ·OUTH··· [noparse]:D[/noparse]IRH %11111111

outData_1·· DATA··········· %10000001
outData_2·· DATA··········· %01000010
.... etc.

DO
··· READ Location, {Word} Variable {, {Word} Variable, ...}············· ' outData_1
·· READ Location, {Word} Variable {, {Word} Variable, ...}············· ' outData_2
LOOP

Thanks
Jack

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-09 01:47
    It's certainly possible to input or output several bits at the same time. You can use the READ statement to read a word at a time into a word variable which can be OUTS. I'm not sure whether the word READ works on a BS2e or you need a BS2p/pe/px for that. In any event, you can do two byte READs to OUTL then OUTH to do the same thing a little bit slower.

    What are you trying to do?
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-09 01:50
    Let me check my code. Be right back
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-09 02:05
    What I can share at this time - careful who you ask for what.

    One 8 bit port can run two sepper motors in the same direction or +/- fortyfive, ninty degrees from the same data set, nest FOR...NEXT_Forward, FOR...NEXT_Reverse. It can also hold one motor and step the other.

    The code at this time is cumbersum at best.

    Jack
Sign In or Register to comment.