Shop OBEX P1 Docs P2 Docs Learn Events
OEM BS_SX with 20MHZ Or 50MHZ — Parallax Forums

OEM BS_SX with 20MHZ Or 50MHZ

Sutton MurraySutton Murray Posts: 88
edited 2007-09-26 14:43 in BASIC Stamp
I have recently build a circuit using the OEM BS_SX 'http://www.parallax.com/detail.asp?product_id=PBASIC2SX/P'.
The schematics for this IC stated to use a 50 MHZ resonator.
After soldering all items to the board, i got stuck, i didn't had a 50 MHZ resonator with me. Having a 20MHZ on hand, i fitted it hoping i could start up the circuit.
The stamp editor came up showing the circuit as a BS2e module. All seems functional ling correct. Is this the only difference between the BS2e and The BS2_sx, the clock speed? Will i have any trouble with the circuit module as is fitted with the 20MHZ resonator in the future.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-09-22 19:22
    Sutton -

    No, there are many differences between those two platforms, and it's mainly in the hardware architecture. You will probably find that the internal timing of the instructions is way off, and it would be very difficult, if not impossible, to do any serial communications with it.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Sutton MurraySutton Murray Posts: 88
    edited 2007-09-22 19:54
    Bruce Serial communications like?
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2007-09-22 21:29
    Sutton -

    Calculating the baudmode for SEROUT may be a very difficult proposition. Numerous PBASIC commands depend on the speed of the processor for proper usage. All I'm saying is that you'd have to do a bit of re-calculatig I'd think. The data given in the PBASIC Manual and PBASIC Help File is based on having the proper resonator in place.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Sutton MurraySutton Murray Posts: 88
    edited 2007-09-22 22:18
    Bruce
    I guess it will be the easiest just fitting the correct resonator.
    It's just hard siting around only aloud to look at your project that you have spend weeks on to complete. That, just because of one only small part.
    Where i live you aren't gone buy any resonators on a weekend.
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-09-23 10:34
    The Basic Stamp 2 uses a 20 MHz resonator so coding as if you have one of those should work. Look in the editor help file under SEROUT and you will see what Bruce is talking about.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-09-24 00:18
    RDL is incorrect. Each BS2 'flavor' uses the resonator as the basis for SERIN/SEROUT baud rates, measureing PULSIN, setting PULSOUT. It is hard-coded into the run-time engine.

    Thus, even though the BS2 'plain' uses a 20 MHz resonator, that doesn't mean the BS2sx will give you correct baud rates if you replace its 50 Mhz with a 20 Mhz resonator.
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-09-24 14:01
    It is interesting to note that the Stamp Editor idenitifies it as a BS2e, however. The BS2e uses the SX28 programmed with the interpreter code, as does the BS2sx - the only *hardware* difference is the resonator (20MHz vs 50MHz). If the Stamp Editor is idenitifying the OEM BS2sx interpreter as a BS2e when you connect a 20MHz resonator to it, it might really behave like a BS2e. I understand the concerns with timing, but the best thing to do is to try it - maybe use FREQOUT and see if the resulting output really is what it says it is.

    Another idea - since the Stamp Editor identifies it as a BS2e, there might be some editor-side routine that can detect the oscillator rate of the Stamp that's connected and adjust the values for time-sensitive instructions accordingly, before programming the Stamp. This would make sense why it would need to identify it as a BS2e instead of a BS2sx.

    I was ordering some OEM BS2e and BS2sx chips, and decided to call up the tech support (the guy I talked to was great, btw) and ask what the difference was. He concluded that there isn't any difference, other than the ordering part number and the frequency of the resonator to be used. So, I ordered both anyway. Guess what! They came in the same piece of antistatic foam - and there's no way to tell them apart! So I guess I will be finding out for myself before too long.
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-09-25 18:39
    I've done some testing, and I have some interesting observations to share.

    I recently ordered some BS2e and BS2sx interpreter chips from Parallax. They came in the same package, and other than the two different date codes there was no way to tell them apart visually.

    However, I wired them up in a circuit, and swapped crystals in and out. There *IS* a difference - but it is slight.

    -The BS2e and BS2sx interpreter will both run the same code (that is tokenized for a BS2e) with a 20MHz resonator correctly. HOWEVER, the Stamp Editor will not properly ID the circuit with a BS2sx interpreter. Strangely, though, DEBUG commands work correctly, possibly other timing-sensitive commands as well.

    -The BS2sx interpreter would not be properly identified until I ran it at 50MHz. Running the code for a BS2e (I had not reprogrammed the EEPROM yet) resulted in DEBUG commands looking like garbage. As soon as I changed the STAMP directive to BS2sx, and reprogrammed the EEPROM, it was fine.

    From this information I can gather a few things.

    -The timing-sensitive commands probably contain their timing information in the tokens downloaded to the EEPROM. So when you execute FREQOUT 1000 on a BS2 or BS2e, the token has some value that is specific to an interpreter running at 20MHz; for a BS2sx, the timing information in the token is different (probably has a timing value that is 2.5 times larger to account for the frequency difference).

    -The identification routine in the Stamp Editor relies on both some information that is hard-programmed into the interpreter chip, as well as the actual timing of the interpreter chip.

    -Parallax should include better labelling of their parts when they package them to ship to you! Maybe use a different color of paint to dot the chips with....
  • Sutton MurraySutton Murray Posts: 88
    edited 2007-09-26 14:43
    Thanks for the input. I wouldn't have done the tests my self, currently i am only interested in completing my project.

    The verdict: Don't waist your time with modifications just keep to the original.
Sign In or Register to comment.