Shop OBEX P1 Docs P2 Docs Learn Events
Changing chips...serial not working — Parallax Forums

Changing chips...serial not working

docwisdomdocwisdom Posts: 28
edited 2009-10-21 18:10 in BASIC Stamp
Fairly new user to Stamp here, been using PIC for a while.

I had a project with a BS2 and ran into issues with it not being powerful enough. With feedback from the users here I purchased a BS2px to replace it. I changed the model # in my code and uploaded the program to the new chip. Unfortunately my serial communication doesnt seem to be working to my devices (serial computer, serial lcd, and serial dispensing unit) Are there differences in the chips that I need to take into account and change in my program?

Comments

  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2009-10-21 18:01
    The serial timing is different for various stamps. You can use conditional compile directives to handle the baudmode constants for each type of chip.
    #SELECT $STAMP                          ' Select Baud constants
      #CASE BS2, BS2E, BS2PE
        T1200       CON     813
        T2400       CON     396
        T4800       CON     188
        T9600       CON     84
        T19K2       CON     32
      #CASE BS2SX, BS2P
        T1200       CON     2063
        T2400       CON     1021
        T4800       CON     500
        T9600       CON     240
        T19K2       CON     110
      #CASE BS2PX
        T1200       CON     3313
        T2400       CON     1646
        T4800       CON     813
        T9600       CON     396
        T19K2       CON     188
    #ENDSELECT
    Inverted        CON     $4000           'Value for inverted serial format
    Baud            CON     T4800+Inverted  '4800 baud, 8,N,1 inverted
    
  • stamptrolstamptrol Posts: 1,731
    edited 2009-10-21 18:10
    The BS2px will require changes in most timing sensitive instructions ( serin, serout, etc). Its a great chip. Fast, flexible and lots of memory.

    When you say you changed the model number in the code, I assume its for the conditional compiling such as shown in the programming template. Make sure you're also using the code snippet that includes the BS2px. Some of the earlier examples just go up to the BS2p.

    Go to the HELP file in the editor and select SEROUT. Down at the bottom of the write up is the current full list for doing conditional compiiling. Copy and paste it into your code.

    Cheers,

    PS See previous post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
Sign In or Register to comment.