.interchardelay Property

Function:

Sets/returns the maximum intercharacter delay for the selected serial port (selection is made through ser.num) in 10ms steps.

Type:

Byte

Value Range:

0-255, default = 0 (no delay)

See Also:

Three Modes of the Serial Port, Serial Settings


Details

For the UART mode (ser.mode = 0 — PL_SER_MODE_UART), this property specifies the time that needs to elapse since the arrival of the most recent serial character into the RX buffer to cause the data to be committed (and on_ser_data_arrival event generation). For the Wiegand and clock/data modes (ser.mode = 1 — PL_SER_MODE_WIEGAND or 2 — PL_SER_MODE_CLOCKDATA), the time since the most recent data bit (HIGH-to-LOW transition on the W0&1in/cin line) is counted.

In the UART mode, this property allows you to combine incoming serial data into larger "chunks," which typically improves performance. Note that the intercharacter gap is not counted when new data is not being received, because the serial port has set the RTS line to LOW (not ready). For this to happen, the serial port must be in the UART/full-duplex/flow control mode (ser.mode = 0 — PL_SER_MODE_UART, ser.interface= 0 — PL_SER_SI_FULLDUPLEX, and ser.flowcontrol = 1 — ENABLED) and the RX buffer must be getting nearly full (less than 64 bytes of free space left).

For the Wiegand and clock/data modes, counting the timeout since the last bit is the only way to determine the end of the data output. The suggested timeout is approximately 10 times the bit period of the data output by attached Wiegand or clock/data device.


.interchardelay Property

Details