Shop OBEX P1 Docs P2 Docs Learn Events
Debug not working! — Parallax Forums

Debug not working!

mountaineermountaineer Posts: 27
edited 2005-12-26 23:23 in BASIC Stamp
I was working on updating the basic stamp part of a project I'm working on and the debug command started behaving erratically. I'm using the basic stamp to red information from a playstation controller and then "serout" it as well as debug the information. The program works great when the serial cable is not plugged in, but when it is the program debugs the wrong things and stops working correctly. It used to work fine on an older version of the compiler I had, but it doesn't work anymore. I am running version 2.2.5 of the compiler on windows xp.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-12-24 22:23
    mountaineer -

    Which pin port are you using for your SEROUT command? If you are using pin port 16, use some other pin port, as DEBUG uses that pin port for its output.

    Regards,

    Bruce Bates
  • mountaineermountaineer Posts: 27
    edited 2005-12-25 03:10
    I'm using pin 0 as the output line with pin 1 on flow control. Is it possible I got a bad install of the ide and I just need to reinstall it?

    Thanks in Advance, mountainieer
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-25 07:07
    The DEBUG command always uses the on-board dedicated serial ports (virtually P16) and always at 9600 baud inverted on all BASIC Stamp 2 models except the BS2px.· So that might explain DEBUG not working for you if you're using P0 and P1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-12-25 08:09
    Chris -

    I'm missing something here. Unless there is something unique with the BS2px (and the user hasn't said that he's using same) what do p0 and p1 have to do with DEBUG?

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-25 13:38
    Moutaineer,

    If you can, post your code -- perhaps there's something one of us will see that will lead to a solution

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • mountaineermountaineer Posts: 27
    edited 2005-12-26 22:56
    here's the code

    it basically is Jon William's code for interfacing with the Playstation controller plus some data manipulation. Its suppossed to work for controlling a mobile robot by sending out a speed value, a turn value, and then the data for the majority of the buttons.

    Thanks for all the help, mountaineer
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-26 23:23
    Okay, I see what's happening here...It looks like you've added SEROUT commands next to each DEBUG statement.· The problem I see is that the DEBUG statements are using formatters, such as SDEC3 to provide the values in a readable format, whereas with your SEROUT statements you're sending the raw binary data.· Unless the receiving end reconstructs it and formats it for you, you're going to get garbage.· You should have the same formatters as the DEBUG statements if you're trying to display this information in a terminal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.