Knowledge Base

# User(BaudRate, Bits, Parity) hash function

This hash function sets the serial port up for use with the “user protocol”. The user protocol is whatever you program yourself.

Parameters
ParameterOptionDescription
BaudRateMandatoryThe baudrate to be used. Legal values are:
300 (not for F4 ARM boards)
600 (not for F4 ARM boards)
1200 (not for F4 ARM boards)
2400
4800
9600
19200
38400
57600
76800
115200
230400 (ARM boards only)
460800 (ARM boards only)
BitsMandatoryThe number of data bits in each character. Legal values are 7 and 8.
ParityMandatoryn = none
e = Even parity
o = Odd parity

You should set these to match the device you are communicating with.

Note that 7 bit communication is only legal if the parity is set to odd or even.  7-bit communication with No parity will result in an error.

Example

Open the primary serial port for user comms @ 38400 baud, 8 bits, no parity.

   #Open_Serial User( 38400, 8, n )

Open the second serial port @ 9600, 8 bits, no parity:

   #Open_Serial Port( 252 ) User( 9600, 8, n )