Shop OBEX P1 Docs P2 Docs Learn Events
Debug problem (very strange) — Parallax Forums

Debug problem (very strange)

gc3076gc3076 Posts: 44
edited 2006-04-10 08:30 in BASIC Stamp
Ok, here is something really weird. I recently transferred working code from my BS2 BOE to a proto board.
My circuit basically takes the output from a Grayhill optical encoder and displays positive or negative counts from CW or CCW rotations on a serial LCD display. I have also incorporated a BS2 reset button, serial port, and counter reset button.
Here is the strange thing I download the enclosed code to my finished proto board and my reset button, encoder, and BS2 reset didn’t work. So while trying to trouble shoot I added a debug statement (line 69) downloaded it to the stamp and everything started working displaying counts, counter reset and BS2 reset. But if the debug statement is commented out then and code reloaded then everything stops working. The LCD freezes and can’t be cleared by reset or power cycle.
I emulated the BS2 schematic when adding the BS2 reset and serial port. I have checked and rechecked all the voltages, grounds, soldier joints etc. but always the same result.
The key seems to be the debug statement, any ideas.
·

Comments

  • SSteveSSteve Posts: 808
    edited 2006-04-08 01:43
    Could it be a timing issue? Maybe the LCD needs more time after the command and the DEBUG statement is supplying that time. Try replacing DEBUG with PAUSE 500. If that works, do some tests to see how low of a number you can use in the PAUSE statement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-08 03:23
    Steve may be on to something here...You don't have an initialization routine with a delay for setting up the I/O pin.· It looks like you're just outputting data right away.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Little BrotherLittle Brother Posts: 2
    edited 2006-04-08 14:59
    shouldn't the BS2 reset between RST and Vdd (with the 1000uf cap) still reset. I can't even notice the LCD flicker. However a reset is noticable when the debug is included.
  • gc3076gc3076 Posts: 44
    edited 2006-04-09 16:18
    what would the statement look like that would be used to nitialize·the·routine ?
  • FORDFORD Posts: 221
    edited 2006-04-10 08:30
    Try putting a 'pause 500' before the first line of code, which is a serout to the lcd.
    The LCD will likely need time to initialise first.



    Cheers,
    Chris
Sign In or Register to comment.