Shop OBEX P1 Docs P2 Docs Learn Events
Different programming for bs2 and bs2p — Parallax Forums

Different programming for bs2 and bs2p

PatriciaPatricia Posts: 4
edited 2009-03-03 07:12 in BASIC Stamp
I have a system that runs with two bs2's and I tried to replace them with bs2p's.· The software seemed to write OK, but doesn't execute.· I am using PBasic 2.0.· I thought that the bs2p also used PBasic 2.0.· Am I wrong?· Are there some differences I am not aware of?· Also, I thought the pinouts are the same as well.· Any help would be appreciated!

Comments

  • achilles03achilles03 Posts: 247
    edited 2009-03-02 18:04
    Why do you think it is not executing? On the hardware side of things, what isn't working? An LED, writing to an eeprom, a servo motor, etc?

    On the code side, what are you trying to do? If you can paste your code that would help.

    Dave
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-03-02 18:06
    Hi, I recommend the latest version of the IDE software which is V 2.4 and implements Pbasic V2.5 at theis link http://www.parallax.com/tabid/441/Default.aspx

    The problem you are seeing though is more likely due to the fact that the BS2p operates at a different speed to the BS2 so any time sensitive instructions in your code will not work as they did before eg: SERIN/SEROUT . The Pbasic help files document the differences.

    Jeff T.
  • PatriciaPatricia Posts: 4
    edited 2009-03-02 18:25
    Thanks! I suspected that it might be timing but wasn't sure. My program starts with a SERIN command, so it must be the problem.
  • MrBi11MrBi11 Posts: 117
    edited 2009-03-03 07:12
    Patricia,
    If you start out your code with these compiler directives:

    #SELECT $STAMP
      #CASE BS2, BS2E, BS2PE
        T1200       CON     813
        T2400       CON     396
        T9600       CON     84
        T19K2       CON     32
        T38K4       CON     6
      #CASE BS2SX, BS2P
        T1200       CON     2063
        T2400       CON     1021
        T9600       CON     240
        T19K2       CON     110
        T38K4       CON     45
      #CASE BS2PX
        T1200       CON     3313
        T2400       CON     1646
        T9600       CON     396
        T19K2       CON     188
        T38K4       CON     84
    #ENDSELECT
    
    Inverted       CON     $4000
    Open            CON     $8000
    
    Baud            CON     T9600  + Inverted  ‘ NOTE: Select the Settings you need here
    
    SerRecv        PIN      0   ' Select your Serial Input pin here
    SerXmit         PIN      1   ' Select your Serial Output pin here
    
    
    



    then use SERIN SerRecv, Baud, [noparse][[/noparse]data2get...

    etc.

    This will automatically change based on your {Stamp} directive when you compile the program

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Smile ... It increases your face value!
Sign In or Register to comment.