Serial In buadrate properties
TimN
Posts: 32
When i use a baudrate of 188 in PBASIC coding for the SERIN command, i am able to seperate a serial string into individual variables of set digit lengths using the DEC formatter. for example, to seperate 10 digits of serial data into smaller variables, i would use the code SERIN 0, 188, [noparse][[/noparse]DEC1 var1, DEC1 var2, DEC2 var3, DEC1 var4, DEC2 var5, DEC3 var6]. this working fine when i am using 4800 baud. but when i try to do the same with 9600 baud with the PBASIC code of 84, instead of var1 getting digit 1, var2 getting digit 2, var3 getting digits 3 and 4, etc... (which is what i want to happen), var1 gets digit 1, var2 gets digit 1, var3 gets digits 1 and 2, var4 gets digit 1, var5 gets digits 1 and 2, and var6 gets digits 1, 2, and 3. any ideas of why this happens only at 9600 baud and any ideas on how to fix it so that the results i want that happen at 4800 also happen at 9600? i ask because i have a device that send data out via serial line to the basic stamp, but it's minimum baud rate is 9600.
thanks for the advice
thanks for the advice
Comments
A: SERIN pin,baud,[noparse][[/noparse]DEC variable]
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
The code fragment I posted does the conversion. I wrote it specifically for the format you showed for the 10 characters (1,1,2,1,2,3). Go through it step by step on a piece of paper and you'll see.
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 2/17/2007 6:51:43 PM GMT