PSC Question
Kevin Harris
Posts: 15
I have recently bought a serial PSC. I am need to change the baud rate from the defaul 2400 to 38k4. I can successfully do this using the included code in the documentation, but the documentation never says how to send commands to the PSC in 38k4 mode, it only shows how to do it in 2400 mode. For example, to send a message to move a servo you would send SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SC" etc..., (baud = 396) from what I gather the Baud+$8000 is the part that says it is 2400 baud, how would I change a statement like that to indicate that I am sending at the higher baud rate? Any information would be helpful, thanks. -Kevin
Comments
I don't think you CAN send 38,000 Baud from a BS2. Maybe the BS2sx can do it.
What are you trying to accomplish by doing this?
·· You simply change the value for the Baud rate that you're using after you send the change command.· For example, the baud rate value for 2400 is 396 (For BS2).· The + $8000 is added to that.· You would start using: "6 + $8000" after that.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
·· The BS2 can do 38.4K.· The baud mode parameter is 6 for that baud rate.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813
··· T2400······ CON···· 396
··· T4800······ CON···· 188
··· T9600······ CON···· 84
··· T19K2······ CON···· 32
··· TMidi······ CON···· 12
··· T38K4······ CON···· 6
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063
··· T2400······ CON···· 1021
··· T4800······ CON···· 500
··· T9600······ CON···· 240
··· T19K2······ CON···· 110
··· TMidi······ CON···· 60
··· T38K4······ CON···· 45
· #CASE BS2PX
··· T1200······ CON···· 3313
··· T2400······ CON···· 1646
··· T4800······ CON···· 813
··· T9600······ CON···· 396
··· T19K2······ CON···· 188
··· TMidi······ CON···· 108
··· T38K4······ CON···· 84
#ENDSELECT
SevenBit······· CON···· $2000
Inverted······· CON···· $4000
Open··········· CON···· $8000
Baud··········· CON···· T9600
For the PSC, you might use these definitions:
BaudSlow······· CON··· ·T2400 + Open
BaudFast······ ·CON···· T38K4 + Open
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Kevin: You should know that the BS2 MUST be waiting in a SERIN statement if it is going to recieve data and act on it immediately. That could have been your delay.