UART
SPI Pin control Programming Debugging C Interface Reference Platform Notes Release Notes DownloadUART Sessions
NSDSP-1 and NSDSP-2 have dedicated UART pin, however UART communications cannot be performed in parallel with other tasks. They require a dedicated UART session.
To start UART communications you need to do the following:
When the UART communications are finished, you need to end the session and free NSDSP. When you end the session, the library will automatically wait for the completion of all the pending UART communications.
The following pseudo-code shows the required procedure
NSDSP.create(serial)
NSDSP.rate = 115200
NSDSP.flowControl = false
Session = NSDSP.startUARTSession
// Communications here
NSDSP.endSession
NSDSP.free
The baud rate must be specified exactly and must be one of the pre-defined values listed here.
Data is transferred to NSDSP in packets. Therefore sending single bytes or short messages is inefficient. Consequently, try to avoid protocols that use short messages and depend on the responses to continue.
Reception is independent of the transmission. You do not have any control on how much data is going to be received - this depends on the UART transmitter at the other end. To prevent data loss you need to read the received data. The library input buffer can hold approximately 250k characters. If more data is received before you get a chance to read it, some data will be lost.
© 2007-2025 Northern Software Inc. All Rights Reserved.