BAUD
PFloyd36069
Posts: 135
Hi,
Will the BS2 go down to 160 Baud or is 300 actually as low as it will go?
Thanks,
Bryan
Will the BS2 go down to 160 Baud or is 300 actually as low as it will go?
Thanks,
Bryan
Comments
BS2, BS2e, and BS2pe = INT(1,000,000
Now, you do have to run a ground wire, as well as the serial wire. And I don't know what device you have that actually talks at 160 baud -- that's a weird rate.
Usual rates are 50, 110, 300, 600, 1200 (VERY common), 2400, 4800, 9600 (1 mSec per byte, also common), 19200, 38400.
You may have to add 16384 to the value, to set the "inverted" flag, depending on if you have a Max232 in the circuit or not.
Post Edited (allanlane5) : 4/30/2008 8:27:00 PM GMT
'{$STAMP BS2}
'{$PBASIC 2.5}
A···· VAR···· Word
B···· VAR···· Bit
FOR A = 0 TO 161
··· IF A = 161 THEN
····· END
··· ENDIF
··· SERIN 8, 14422, [noparse][[/noparse]B]
··· WRITE A, B
··· DEBUG DEC B
· NEXT
END
MyBuf BYTE(20)
SERIN <SerPin>, <baudmode>, [noparse][[/noparse]STR MyBuf\20]
Something like that. This will take 20 of your available 26 bytes of RAM, but you only need it for a little bit.
··· IF A = 161 THEN
····· END
··· ENDIF
to check the loop as it will branch out when it comes to the end of the loop. If you wanted to branch out early then a conditional would be needed.