Shop OBEX P1 Docs P2 Docs Learn Events
Diagnostic output with FullDuplexSerial — Parallax Forums

Diagnostic output with FullDuplexSerial

RogerInHawaiiRogerInHawaii Posts: 87
edited 2009-05-05 22:07 in Propeller 1
I'm writing a program that has several objects. I want to be able to output diagnostic information to the Parallax Serial Terminal using the FullDuplexSerial object. This works fine when I have a single FullDuplexSerial object in ONE of the objects that I am debugging, but if I want to have diagnostic output produced by two or more of my objects I can't seem to get it to work. If I place a separate FullDuplexSerial object inside each of my to-be-debugged objects I end up getting garbage text, or nothing at all, in the Serial Terminal. Apparently the several FullDuplexSerial objects are interfering with one another.

So,how can I do diagnostic output from several objects at the same time?

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-05-05 19:24
    Parallax is starting work on your problem. Check this thread: http://forums.parallax.com/forums/default.aspx?f=25&m=348893

    You can use locks to prevent the several FullDuplexSerial objects from interfering with one another. Check locknew, lockclr, lockset and lockret in the Propeller manual.

    John Abshier
  • jazzedjazzed Posts: 11,803
    edited 2009-05-05 19:26
    Having multiple cogs send output to one serial output pin will cause garbage because the pin is a "wire or" of the cog outputs.
    You should modify the FullDuplexSerial object VAR section variables to be DAT and "start" the FullDuplexSerial object just one time. This way one set of variables is used for the FIFO and any spin object that uses the object will talk to the one FIFO.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve


    Propalyzer: Propeller PC Logic Analyzer
    http://forums.parallax.com/showthread.php?p=788230
  • simonlsimonl Posts: 866
    edited 2009-05-05 19:59
    I think you'll find what you're looking for in the "SerialMirror" object (obex.parallax.com/objects/189/). This has done what jazzed suggests (VAR now DAT) and has been written specifically for the task you enquire about.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    “Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2009-05-05 20:33
    I took Jazzed's suggestion and modified FullDuplexSerialPlus so it uses DAT instead of VAR for its variables and it works like a charm.

    It was only after I did that that I saw the subsequent posting about SerialMirror.

    Is there a section on the Parallax website that categorizes the various objects that are posted there? Something like a category of "Diagnostic Aids" or "Diagnostic Output to the Serial terminal" would have been a big help in this situation, which I'm guessing is fairly common for developers.
  • simonlsimonl Posts: 866
    edited 2009-05-05 22:07
    @Roger: Darn; I'm just too slow - LOL.

    The object exchange (obex) is somewhat categorised, but SerialMirror is under "Protocols", which may not have been obvious. Unfortunately, it's near-on impossible to get categoristion right for everyone (I've gone through that pain as a web developer!), so Obex is probably as good as we can get.

    Glad you're sorted tho' smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    “Before you criticize someone, you should walk a mile in their shoes. That way when you criticize them, you are a mile away from them and you have their shoes.” - Jack Handey.
Sign In or Register to comment.