Shop OBEX P1 Docs P2 Docs Learn Events
warm up / burn in time for BS2? — Parallax Forums

warm up / burn in time for BS2?

electromanjelectromanj Posts: 270
edited 2006-12-18 14:21 in BASIC Stamp
Hello, I have a question. I have built a custom OEM BS2 board. The first three times I ran the program, it glitched. By glitched I mean that it was suppose to count cycles and if cycles were less than x cycles then end. It did end but, when cycles continued the program continued.After these first three tries with power still connected everything worked fine. Does the interpreter or eeprom chips require a burn in or warm up time?
Thanks for any help.
·

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-12-16 02:52
    No warm-ups,·man·-- it's all solid-state.· Better post your program, might have some hiccup in it.
  • electromanjelectromanj Posts: 270
    edited 2006-12-16 03:12
    This is the program im running


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}


    cycles VAR Word
    Counter VAR Byte
    main:
    DO
    COUNT 0,10000,cycles
    IF cycles>2 THEN HIGH 3
    IF cycles<2 THEN doublecheck:
    LOOP

    doublecheck:
    FOR Counter = 1 TO 3
    COUNT 0,10000,cycles
    IF cycles>2 THEN main:
    NEXT
    IF cycles<2 THEN LOW 3
    END
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-12-16 04:06
    I'm sorry, but... what are we trying to do?
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-12-16 07:55
    electromanj -

    If the routine doublecheck is supposed to return to the main part of the program and usually continue, that's NOT going to happen.

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 12/16/2006 11:44:19 AM GMT
  • FranklinFranklin Posts: 4,747
    edited 2006-12-16 08:02
    What happens if cycles = 2 ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-12-16 11:51
    electronmanj -

    Would you please explain, in a bit more detail, what you mean by the following, quoted fron your original post:

    "It did end but, when cycles continued the program continued.After these first three tries with power still connected everything worked fine."

    The program either ended or it didn't. there is no in between. There IS a situation where there will be certain output from the PBASIC Stamp after it hits an END statement, but I'm not sure yet if that's what you're seeing. You don't describe how you are discerning that the program may be continuing.

    Just one final note. If no pulse is seen, of the specified type, during the period specified by the DURATION parameter, variable_name can and will be ZERO. I just hope you kept that in mind, and planned for it. This could also occur with a loose or intermittant external connection. You didn't specify what the source of the pulses is, so it's difficult to say much more about it.

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 12/16/2006 12:01:46 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-12-16 11:56
    Stephen -

    If cycles = 2, and so long as it's 2, the routine doublecheck will NEVER be executed.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2006-12-16 17:44
    Hi electromanj, if this project is part of your learning curve and/or if it is not doing as expected try simplifying the program and see what results you are getting using the DEBUG screen. The following code will loop indefinately giving you the oportunity to monitor what is happening on Pin 0.

    cycles VAR Word
    main:
    DO
    COUNT 0,10000,cycles
    DEBUG DEC? cycles,CR
    LOOP

    ·When you are satisfied your frequency in is behaving as it should then design your conditional statements to catch every possibility that you require.

    doublecheck is a subroutine and should be called with GOSUB doublecheck·(don't forget the RETURN at the end of the subroutine). Is there really a need for the FOR NEXT loop?

    IF cycles <2 THEN GOSUB doublecheck

    doublecheck:
    FOR Counter = 1 TO 3
    COUNT 0,10000,cycles
    NEXT
    IF cycles<2 THEN····· 'program ends if cycles less than 2 on the·fourth count else returns to main loop
    LOW 3
    END
    ENDIF
    RETURN

    Jeff T.
  • electromanjelectromanj Posts: 270
    edited 2006-12-16 21:03
    Hello my computer wigged out on me last night. I'm going to sort through all this and get back to you. Thanks for all the responses!
  • Steve JoblinSteve Joblin Posts: 784
    edited 2006-12-18 14:21
    It seems that all "good practices" seem to include a small delay when starting up a program... I don't know if this is to let the other electrical components "settle", but start your program with a "Pause 100" and see if that helps...
Sign In or Register to comment.