Shop OBEX P1 Docs P2 Docs Learn Events
Stamp Identify Sequence & documentation.... — Parallax Forums

Stamp Identify Sequence & documentation....

SamMSamM Posts: 24
edited 2007-09-18 05:11 in General Discussion
I have code that can successfully identify a BS2 Stamp using the "identify sequence" documented on page 6 of the "Basic Stamp Programming Protocol" manual. I am now attempting to identify the various other available stamps (BS2p24, BS2p40, BS2e, BS2sx, BS2pe & BS2px24).

In examining the documentation, it appears that the method of identifying the BS2e (the second stamp I'm attempting to identify) is a quite a bit more simple than the method of identifying the BS2. Where the BS2 requires sending/discard echo/receiving 2's-complement of each letter of it's name ('B', then 'S', then '2') before confirmation, the BS2e *only requires* sending/discard echo/receiving of the character 'e'. Other stamps appears to use this simplified method of identification.

Is this correct? I would have guessed that it would be similiar to the BS2 (using 2's complement) and send/discard echo/receive 2's-complement of all characters in the name ('B', then 'S', then '2', then 'e').

Is the documentation correct, or is the method that different between BS2 and all other stamps?

The reason I ask is that when I attempt to identify a BS2e as documented, my return character (after sending an 'e' and discarding the echo) is a 102 (when it should be a 101).

Comments

  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-09-17 20:47
    Yes, the BS2 is the only one that uses the fancier protocol. The BS2e responds to "e" ascii 101, and version 1.0 of the chip returns an "e". If it is a version 1.1 BS2e, it would return "f" instead of "e" -- I didn't realize the 2e had its version bumped up. In any case, that is how the Stamps after the BS2 handles version control. For example, the BS2p responds to the "P" ping, but it returns a letter in the set, {pPqQrRsStTuUvV...} depending on the version. A response in the set {pPqQ} leads to an error message from the IDE, because versions 1.0 and 1.1 of the BS2p are no longer supported and should be returned to Parallax for an upgrade. A capital letter means a 32 i/o chip, while lower case indicates a 16 i/o chip.

    There is additional info you might find helpful at www.emesystems.com/BS2clone.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SamMSamM Posts: 24
    edited 2007-09-17 21:13
    Wow. It sounds like something that was started with the BS2, then never "unified" across the product line. It also leaves itself wide open to errors such as mine (returning a number that isn't mentioned in the docs for a version that wasn't documented when printed).

    It also makes it much more difficult to identify a chip. A lot of trial and error as opposed to ask and response. Waiting for return values to timeout is not very elegant in some cases.

    I'd like to suggest that in the future, this is more unified: Something alongs the lines of a command byte for "What type of chip are you?" and a response of 1,2,3,4,5,6, etc, then a command byte for "What version are you?" and a BCD response (ala the BS2) of 123 for 1.23.

    With the current system, identifying a chip means checking for (in the case of the e-series) an e (in case it's one version), an f (for another) etc.....if I want the version number, I have to keep trying other letters until it fails. It is conceivable that no return value is present.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-09-17 21:50
    The ping that is transmitted from the PC does not change with version number. To identify a BS2e for example the PC still transmits an "e", and any response at all (beyond the passive echo) means there is a BS2e there. The character that is returned, gives the version number immediately, as in "f" - "e" = 1. A check to be sure it is a valid version is probably a good idea, or for furture developements just allow it to be in the range of 0 to 9.

    The IDE checks for Stamps by pinging first for the type of Stamp that is in the active window, and then the others in sequence. It only take 6 pings and even with the timeouts it does not take long. The method you are suggesting does make sense, but Parallax is religious about not breaking established protocols. In my opinion that is even more important than having an optimal protocol!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SamMSamM Posts: 24
    edited 2007-09-18 02:29
    The Parallax documentation appears to be missing the protocol for the BS2px24. Any idea what it might be?
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2007-09-18 05:11
    Programming the 'px takes place at 19200 baud (instead of 9600 as in the other stamps). Send "T" from the PC, and it responds with "t" (24 pin) or an "T" (40 pin oem only), for version 1.0, with subsequent versions from the set {uUvV...}.



    P.S., I went back to my notes, and I see that as of 2005, the BS2e was in fact up to rev 1.1, which would echo an "f".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 9/18/2007 8:02:04 PM GMT
Sign In or Register to comment.