Shop OBEX P1 Docs P2 Docs Learn Events
Noob question — Parallax Forums

Noob question

bpislifebpislife Posts: 10
edited 2010-05-12 01:14 in Propeller 1
This is my first post to this forum so please go easy. Before you ask, I did spend about 10 minutes searching the forum and couldn't find anything.

I am putting a program together that requires the use of two of the same objects and I just want to make sure it is possible.

1)The object I am referring to is the MMBE object from the exchange.
2)The second object is the FullSerielDuplex.spin. This is used for the MMBE spin as well as the Xbee object.

I just want to know if I can run these without a problem of them stepping all over each other.

In the OBJ section I have:
          XB : "XBee_Object"  
    MMBE1   : "MMBE"
    MMBE2   : "MMBE"




in the pub section I have
MMBE1.start(18,19,2400)               'start(txPin, rxPin, baud)
    MMBE2.start(20,21,2400)               'start(txPin, rxPin, baud)




So again, to try to be as clear as I can, the MMBE object uses the FullSerielDuplex.spin object. XBee_Object also uses this object. Is this ok?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-11 02:13
    Yes, it's ok. Each instance of MMBE has its own private data area and the instances of FullDuplexSerial used by each MMBE and by XBee_Object are all distinct. All have their own buffers and variables. As you can imagine, each instance of FullDuplexSerial has to use a separate pair of I/O pins (as you're doing). You'll be using 4 cogs, 3 for each of the FullDuplexSerial instances and 1 for the main cog that runs everything else.
  • bpislifebpislife Posts: 10
    edited 2010-05-12 01:14
    Thank you for you response! I wasn't completely sure.
Sign In or Register to comment.