Data Sheet
dScript
dScript User Manual v2.15
Baud rate
The default serial parameters are 9600, no parity, 2 stop bits. The baud rate can be changed
with serialport.BaudRate = <new baud rate>
serialport RS485 2 100 200
RS485.BaudRate = baud34800 ; change baud rate to 34800
baud38400 is a predefined baud rate. The full list of predefined common baud
rates are:
baud1200 (16666) 1200 baud
baud2400 (8332)
baud4800 (4166)
baud9600 (2082)
baud31250 (639)
baud34800 (520)
baud57600 (346)
baud115200 (173)
baud250k (79) 250000 baud
baud500k (39)
baud1M (19) 1000000 baud
baud2M (9)
baud4M (4)
baud5M (3)
baud10M (1)
The numbers in brackets are the actual divisor values used to control the baud rate. If you
need a special baud rate within the above range you can calculate this using the formula:
divisor = (20000000/<baud rate> )-1
solving for 9600 baud:
divisor = (20000000/9600)-1 = 2082.333 (2082 with an error of 0.016%)
If you needed 62500 baud:
divisor = (20000000/62500)-1 = 319 (with an error of 0%)
RS485.BaudRate = 319; sets 62500 baud
The baud rate can also be read back.
Baud = RS485.BaudRate
The value read back is the divisor value (the numbers in brackets in the above definitions).
Copyright © 2016, Devantech Ltd.
All rights reserved.
www.robot-electronics.co.uk
32