Shop OBEX P1 Docs P2 Docs Learn Events
How does one find out what program is loaded in a BS2? — Parallax Forums

How does one find out what program is loaded in a BS2?

JonmarJonmar Posts: 9
edited 2007-12-23 19:18 in BASIC Stamp
Howdy all,

Is there any way to read what is programmed into a BS2?

We have several automation boxes installed at one location and need to find out which version of code is installed in one of the boxes.

Thanks in advance.

Jonmar

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-12-21 01:41
    The only way to read the contents of a BS2 is to load a small program into it that will display the rest of the program memory. Unfortunately, this will overwrite part of the program. There is no practical way to externally read the contents of the memory where the program is stored. In the future, you might consider attaching an LED (and resistor) to an extra I/O pin and the initialization part of the program could blink the LED a number of times to indicate the version of the program that's installed.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-21 04:00
    Here's a thread that may help: http://forums.parallax.com/showthread.php?p=639883.

    -Phil
  • Andy FoxAndy Fox Posts: 46
    edited 2007-12-21 14:57
    You can dump the EEPROM as the article shows, but the downside is that the code itself is next to impossible to decipher (even string constants), so it may still be impossible for you to tell which version is loaded (unless you stored the version # as a string of ASCII bytes in EEPROM with a DATA statement, maybe something to think about).
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-12-21 15:46
    Personally, the first thing I put in any BS2 program is a SEROUT statement like:

    SEROUT 16, 16468, [noparse][[/noparse]"Program xyz, version 1.2, 12/18/2007", CR]

    This way, all I have to do is put the BS2 in the BOE, connect a PC to the DB-9, startup Hyperterm, hit RESET on the BOE, and voila, I know what's loaded.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-12-21 16:51
    Andy Fox said...
    You can dump the EEPROM as the article shows, but the downside is that the code itself is next to impossible to decipher (even string constants), so it may still be impossible for you to tell which version is loaded...
    You don't have to decipher anything to make the comparison. You just compare the hex dump with the hex memory map for each of the candidate versions and pick the one that matches.

    -Phil
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-12-21 17:18
    allanlane5
    ·Great · idea.gif

    Personally, the first thing I put in any BS2 program is a SEROUT statement like:

    SEROUT 16, 16468, [noparse][[/noparse]"Program xyz, version 1.2, 12/18/2007", CR]

    This way, all I have to do is put the BS2 in the BOE, connect a PC to the DB-9, startup Hyperterm, hit RESET on the BOE, and voila, I know what's loaded.


    I nerver thought of doing that Thanks for sharing this thought

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2007-12-23 05:09
    allanlane5

    Thank You for posting how to do this
    I try it and it works great

    Now when i write code that i am testing and· have to find a code routine that i·have used·for that completed project

    I had a little trouble setting up Hyperterminal but once i had it set up it work great



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • JDMJDM Posts: 1
    edited 2007-12-23 19:18
    Thank you all for the tips and recommendations.

    I will implement embedding a version number in future programming projects.

    Jonmar
Sign In or Register to comment.