PDA

View Full Version : Changing chips...serial not working



docwisdom
10-22-2009, 01:52 AM
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?

Ron Czapala
10-22-2009, 02:01 AM
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

stamptrol
10-22-2009, 02:10 AM
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