Shop OBEX P1 Docs P2 Docs Learn Events
BS1 Detect Lost Connection — Parallax Forums

BS1 Detect Lost Connection

cfarandacfaranda Posts: 8
edited 2009-03-10 23:21 in BASIC Stamp
Does any one have a snippet of code to demonstrated how to make·the BS1 detect lost serial communication then have it perform a task?

Thanks,
Chuck

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-03-09 02:04
    Could you explain in more detail?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • cfarandacfaranda Posts: 8
    edited 2009-03-09 02:20
    Sure, my software sends a serial command to BS1 then polls for·responses to different tasks.· Obviously, it's easy to know when the BSI stops sending data back to the software, but how do I detect in the BS! firmware code·that the software has stopped sending data to the BSI.· I guess I needed·watch dog like code that will detect no activity (like a computer crash) and then take an action like trip a relay.· Make sense?

    Chuck
  • FranklinFranklin Posts: 4,747
    edited 2009-03-09 02:28
    Sounds like a plan. It would work best if the PC sends something every cycle even if it does not need changes. Then if the bs1 misses say four in a row it considers the connection broken.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • cfarandacfaranda Posts: 8
    edited 2009-03-09 02:31
    And it's that code on the BS1 end that is giving me trouble, do you have an example please?

    Chuck
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-10 22:03
    If you post the code you have it may be possible to suggest changes that will accomplish this task. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • cfarandacfaranda Posts: 8
    edited 2009-03-10 23:21
    Thanks Chris, but I think I'm just up against the·BS1's inability to timeout or wait for serial input.··Simply disbaling the the SERIN line allows the program to cycle and update the counter.· As long as Serin is not commented and no serial connection is made things freeze on it.· I will redesign to use the BS2 and make my life easier :-)

    Chuck
Sign In or Register to comment.