Difference between revisions of "Component: UART (RS232) (Comms: Interface)"
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {| style="width:50%" | |
− | |||
− | {| | ||
|- | |- | ||
− | | width="20%" style="color: gray;" | Author | + | | width="20%" style="color:gray;" | Author |
| Matrix Ltd | | Matrix Ltd | ||
|- | |- | ||
− | | width="20%" style="color: gray;" | Version | + | | width="20%" style="color:gray;" | Version |
− | | | + | | 3.0 |
|- | |- | ||
− | | width="20%" style="color: gray;" | Category | + | | width="20%" style="color:gray;" | Category |
| Comms: Interface | | Comms: Interface | ||
|} | |} | ||
+ | ==UART (RS232) component== | ||
+ | Low level routines for controlling or interacting with a standard asyncronous serial interface. On a microcontroller the interface will be the onboard UART which will need voltage level shifting using a max2323 to become RS232 compatible. See the EB015 RS232 E-block for details. | ||
+ | |||
+ | ==Component Source Code== | ||
+ | |||
+ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_RS232.fcfx FC_Comp_Source_RS232.fcfx] | ||
− | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RS232.fcfx FC_Comp_Source_RS232.fcfx] | |
− | |||
− | |||
− | |||
==Detailed description== | ==Detailed description== | ||
Line 52: | Line 53: | ||
Some devices feature an auto baud functionality and is commonly triggered by sending a known data byte to the device before any other data is sent allowing the correct baud to be worked out. | Some devices feature an auto baud functionality and is commonly triggered by sending a known data byte to the device before any other data is sent allowing the correct baud to be worked out. | ||
+ | |||
+ | ==Examples== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
− | |||
− | |||
− | |||
===Transmit=== | ===Transmit=== | ||
Line 111: | Line 131: | ||
There are other pre-made injectors to allow you to do various aspects from simulating a generic AT terminal to simulating a specific remote device. | There are other pre-made injectors to allow you to do various aspects from simulating a generic AT terminal to simulating a specific remote device. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==Macro reference== | |
− | |||
− | :[[ | + | ===ChangeHWBaud=== |
− | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangeHWBaud''' | ||
+ | |- | ||
+ | | colspan="2" | Changes the hardware UART baud rate allowing for dynamic speed changes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NewBaud | ||
+ | |- | ||
+ | | colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200, 8=250000 | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | :[[ | + | ===Initialise=== |
− | :: | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
+ | |- | ||
+ | | colspan="2" | Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | ''' | + | ===ReceiveBinary16Bit=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveBinary16Bit''' | ||
+ | |- | ||
+ | | colspan="2" | Receives a binary 16-bit value split across two bytes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max amount of time in ms to wait between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
+ | ===ReceiveBinary32Bit=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveBinary32Bit''' | ||
+ | |- | ||
+ | | colspan="2" | Receives a binary 32-bit value split across four bytes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max amount of time in ms to wait between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | ''' | + | ===ReceiveBinaryFloat=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveBinaryFloat''' | ||
+ | |- | ||
+ | | colspan="2" | Receives a binary 32-bit floating point value split across four bytes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max amount of time in ms to wait between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | :[[ | + | ===ReceiveByteArray=== |
− | :: | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByteArray''' | ||
+ | |- | ||
+ | | colspan="2" | Receives an array of bytes and returns the number of bytes received. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Array to store the incoming data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NumBytes | ||
+ | |- | ||
+ | | colspan="2" | Maximum number of bytes to try and receive | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max amount of time in ms to wait between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | '''Return | + | ===ReceiveChar=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveChar''' | ||
+ | |- | ||
+ | | colspan="2" | Attempts to receive a single packet from the UART interface. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever. | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
+ | ===ReceiveFloat=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveFloat''' | ||
+ | |- | ||
+ | | colspan="2" | Attempts to receive a floating point number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max time in ms to wait in between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | IgnoreData | ||
+ | |- | ||
+ | | colspan="2" | 0=Dont ignore any data, 1=Ignore any initial none numeric data | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | ''' | + | ===ReceiveHexNumber=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveHexNumber''' | ||
+ | |- | ||
+ | | colspan="2" | Attempts to receive a hex number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none hexadecimal char is received, the none numeric char will be lost. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max time in ms to wait in between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | IgnoreData | ||
+ | |- | ||
+ | | colspan="2" | 0=Dont ignore any data, 1=Ignore any initial none numeric data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | Prefix | ||
+ | |- | ||
+ | | colspan="2" | Look for prefix before receiving, 1=0xFF, 0=FF | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | :[[ | + | ===ReceiveINTArray=== |
− | ::0=Least significant byte first, 1=Most significant byte first | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveINTArray''' | ||
+ | |- | ||
+ | | colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Array to store the incoming data | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NumValues | ||
+ | |- | ||
+ | | colspan="2" | Maximum number of values to try and receive | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max amount of time in ms to wait between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | ''' | + | ===ReceiveNumber=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveNumber''' | ||
+ | |- | ||
+ | | colspan="2" | Attempts to receive a number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max time in ms to wait in between bytes | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | IgnoreData | ||
+ | |- | ||
+ | | colspan="2" | 0=Dont ignore any data, 1=Ignore any initial none numeric data | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s32-icon.png]] - LONG | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
+ | ===ReceiveString=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString''' | ||
+ | |- | ||
+ | | colspan="2" | Attempts to receive a string of bytes from the UART interface. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | NumBytes | ||
+ | |- | ||
+ | | colspan="2" | The number of bytes to try and receive, ideally your string variable should have at least 1 more byte to store the null termination byte | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | ''' | + | ===SendBinary16Bit=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBinary16Bit''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a 16-bit binary value split across two bytes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Value | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | :[[ | + | ===SendBinary32Bit=== |
− | :: | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBinary32Bit''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a 32-bit binary value split across four bytes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Value | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
+ | ===SendBinaryFloat=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBinaryFloat''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Value | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | :'' | + | ===SendByteArray=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByteArray''' | ||
+ | |- | ||
+ | | colspan="2" | Transmits an array of bytes via the UART peripheral | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data to transmit | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NumBytes | ||
+ | |- | ||
+ | | colspan="2" | Number of bytes to send from the array | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | === | + | ===SendChar=== |
− | Sends out a | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendChar''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a single packet from the UART interface. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT | ||
+ | | width="90%" | Char | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | :[[ | + | ===SendFloat=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendFloat''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a floating point number as an ASCII String from the UART interface. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | Number | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | '''Return | + | ===SendHexNumber=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendHexNumber''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a number as an ASCII hexadecimal String from the UART interface. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Number | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NumChars | ||
+ | |- | ||
+ | | colspan="2" | Number of characters in the string data, 0 for auto, 2 for 0x00, 4 for 0x0000 | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | Prefix | ||
+ | |- | ||
+ | | colspan="2" | Generate hexadecimal prefix 0x e.g. 1= 0xFF, 0= FF | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
+ | ===SendINTArray=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendINTArray''' | ||
+ | |- | ||
+ | | colspan="2" | Transmits an array of 16-bit INT/UINT values via the UART peripheral | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | Data to transmit | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | NumValues | ||
+ | |- | ||
+ | | colspan="2" | Number of 16-bit values to send from the array | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" | MSBfirst | ||
+ | |- | ||
+ | | colspan="2" | 0=Least significant byte first, 1=Most significant byte first | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | ''' | + | ===SendNumber=== |
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendNumber''' | ||
+ | |- | ||
+ | | colspan="2" | Sends out a number as an ASCII String from the UART interface. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-s32-icon.png]] - LONG | ||
+ | | width="90%" | Number | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | |||
− | |||
− | + | ===SendString=== | |
− | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |
− | + | |- | |
− | + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |
− | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString''' | |
− | + | |- | |
− | + | | colspan="2" | Sends out a string of bytes from the UART interface. | |
− | + | |- | |
− | + | |- | |
− | === | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
− | + | | width="90%" | Data | |
− | + | |- | |
− | + | | colspan="2" | | |
− | + | |- | |
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |
− | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | |
− | + | |} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | : | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | : | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Sends out a | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | : | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==Property reference== | ==Property reference== | ||
− | |||
− | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |
− | + | |- | |
− | UART Channel selector | + | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] |
− | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | |
− | Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. | + | |- |
− | + | |- | |
− | Hardware channels use the selected peripheral on-board the target microcontroller. | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
− | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Comms Settings | |
− | + | |- | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Channel | |
− | Baud rate option selector | + | |- |
− | + | | colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Baud Options | |
− | + | |- | |
− | + | | colspan="2" | Baud rate option selector | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | |
− | + | | width="90%" | Baud Rate | |
− | + | |- | |
− | + | | colspan="2" | | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | Number of data bits | + | | width="90%" | Data Bits |
− | + | |- | |
− | + | | colspan="2" | Number of data bits | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Return | |
− | Return data width from Receive macro. | + | |- |
− | + | | colspan="2" | Return data width from Receive macro. 8-bit data mode always returns a byte ranging from 0-255, 255 could mean a timeout or could be a valid data. 16-bit data mode rereturns 0-255 for valid data, 256 for a timeout, return data must be stored into an INT or UINT variable. | |
− | 8-bit data mode always returns a byte ranging from 0-255, 255 could mean a timeout or could be a valid data. | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | 16-bit data mode rereturns 0-255 for valid data, 256 for a timeout, return data must be stored into an INT or UINT variable. | + | | width="90%" | Echo |
− | + | |- | |
− | + | | colspan="2" | Automatically echoes back any received data when enabled by re-transmitting the received byte. | |
− | + | |- | |
− | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | |
− | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | |
− | Automatically echoes back any received data when enabled by re-transmitting the received byte. | + | |- |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | + | | width="90%" | Use TX | |
− | + | |- | |
− | + | | colspan="2" | Selects if the Transmit pin is used by the component. Yes: The TX pin is active and used to transmit data for the UART. No: The TX pin is disabled and free to be used as general I/O. | |
− | Selects if the Transmit pin is used by the component. | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | |
− | Yes: The TX pin is active and used to transmit data for the UART. | + | | width="90%" | TX |
− | + | |- | |
− | No: The TX pin is disabled and free to be used as general I/O. | + | | colspan="2" | Pin to be used for Transmit data |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | + | | width="90%" | TX Alt Pin | |
− | + | |- | |
− | + | | colspan="2" | Allows the TX pin to be allocated to an alternate I/O pin. | |
− | Pin to be used for Transmit data | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | + | | width="90%" | Use RX | |
− | + | |- | |
− | + | | colspan="2" | Selects if the Receive pin is used by the component. Yes: The RX pin is active and used to receive data for the UART. No: The RX pin is disabled and free to be used as general I/O. | |
− | + | |- | |
− | Allows the TX pin to be allocated to an alternate I/O pin. | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
− | + | | width="90%" | RX | |
− | + | |- | |
− | + | | colspan="2" | Pin to be used for Receive data | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | Selects if the Receive pin is used by the component. | + | | width="90%" | RX Alt Pin |
− | + | |- | |
− | Yes: The RX pin is active and used to receive data for the UART. | + | | colspan="2" | Allows the RX pin to be allocated to an alternate I/O pin. |
− | + | |- | |
− | No: The RX pin is disabled and free to be used as general I/O. | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
− | + | | width="90%" | Use Flow Control | |
− | + | |- | |
− | + | | colspan="2" | Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. | |
− | + | |- | |
− | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | |
− | Pin to be used for Receive data | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation |
− | + | |- | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | |
− | + | | width="90%" | Label | |
− | + | |- | |
− | Allows the RX pin to be allocated to an alternate I/O pin. | + | | colspan="2" | Textual label shown on the component I/O flasher |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | + | | width="90%" | Scope Traces | |
− | + | |- | |
− | + | | colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. | |
− | Flow Control (Handshake) enable or disable. | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | On: Two I/O pins are used to control the flow of data in and out of the device. | + | | width="90%" | Console Data |
− | + | |- | |
− | Off: Flow control is disabled. | + | | colspan="2" | Selects if the console data is automatically generated or not |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Console Format | |
− | + | |- | |
− | + | | colspan="2" | Controls if the data is shown as a log with time and date stamps or just as raw data | |
− | Textual label shown on the component I/O flasher | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] | |
− | + | | width="90%" | Console Columns | |
− | + | |- | |
− | + | | colspan="2" | Number of characters that can be displayed on a single line of the console. | |
− | + | |- | |
− | Selects if the scope traces are automatically added to the data recorder window or not. | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
− | + | | width="90%" | Data Source | |
− | Simulation - draws an approximation of the UART data onto the scope trace. | + | |- |
− | + | | colspan="2" | Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data API component on the Panel. | |
− | ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. | + | |} |
− | |||
− | |||
− | |||
− | |||
− | |||
− | Selects if the console data is automatically generated or not | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Controls if the data is shown as a log with time and date stamps or just as raw data | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Number of characters that can be displayed on a single line of the console. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Simulation data source used to allow the component to connect to various remote devices | ||
− | |||
− | Nothing - Simulation data is ignored | ||
− | |||
− | COM port - Routes the communication data to and from a physical or virtual COM port | ||
− | |||
− |
Latest revision as of 13:12, 7 February 2023
Author | Matrix Ltd |
Version | 3.0 |
Category | Comms: Interface |
Contents
- 1 UART (RS232) component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 ChangeHWBaud
- 5.2 Initialise
- 5.3 ReceiveBinary16Bit
- 5.4 ReceiveBinary32Bit
- 5.5 ReceiveBinaryFloat
- 5.6 ReceiveByteArray
- 5.7 ReceiveChar
- 5.8 ReceiveFloat
- 5.9 ReceiveHexNumber
- 5.10 ReceiveINTArray
- 5.11 ReceiveNumber
- 5.12 ReceiveString
- 5.13 SendBinary16Bit
- 5.14 SendBinary32Bit
- 5.15 SendBinaryFloat
- 5.16 SendByteArray
- 5.17 SendChar
- 5.18 SendFloat
- 5.19 SendHexNumber
- 5.20 SendINTArray
- 5.21 SendNumber
- 5.22 SendString
- 6 Property reference
UART (RS232) component
Low level routines for controlling or interacting with a standard asyncronous serial interface. On a microcontroller the interface will be the onboard UART which will need voltage level shifting using a max2323 to become RS232 compatible. See the EB015 RS232 E-block for details.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_RS232.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_RS232.fcfx
Detailed description
Overview
The RS232 component is in fact nothing more than a TTL level asynchronous serial communications bus which basically means that there is no clock signal. Instead the data is sent out at a precise data rate specified by the Baud which is represented in bits per second. Both devices need to be set to the same rate to allow communications to work correctly.
There are two signals which make up the asynchronous serial connection: RX and TX. The receive RX signal is used for incoming data and the transmit TX signal is used for outgoing data. When connecting two devices together it is important to connect the TX of one device to the RX of the other and visa versa. When inactive the bus defaults to having the TX signal held in the high state. Each data byte sent then starts with a low signal for 1 period of the baud rate to signify that data is to follow.
Each RS232 transaction consists of a start bit (low) for a single clock cycle followed by data made up of 7/8/9 clock cycles followed by a stop bit (high) for a single clock cycle.
TTL
By default the RS232 component will provide TTL asynchronous serial data which is best suited for a single device to single device data connection on the same circuit board. An example might be a GSM modem or GPS module. The TTL signals are normally at VCC when the bus is idle and toggles between VCC and Ground when sending data.
RS232
By adding a driver chip such as a MAX2323 the TTL signals can be upgraded to RS232 which is best suited for single device to single device mid range off board communications. The RS232 signals replace the voltages VCC with +12V and GND with -12V to allow for better noise rejection in noisy environments.
RS485
By adding a driver chip such as a MAX3078 the TTL signals can be upgraded to RS485 which is best suited for master to multiple slave type mid range off board communications.
Auto Baud
Some devices feature an auto baud functionality and is commonly triggered by sending a known data byte to the device before any other data is sent allowing the correct baud to be worked out.
Examples
Transmit
This example transmits a string "Hello World".
RS232_Example1
The Console window shows the data as it is sent and received.
Receive
This example receives a character and outputs it to the LCD, an injector has been added to allow you to type data into the console.
RS232_Example2
The Console window has tabs for the human interface data injector allowing you to type in data that will be received by the component.
Again the RS232 console tabs reflect the data as it is sent and received.
LCD showing received data.
Transmit and Receive
This example echoes back any data that is received allowing a nice sanity check when connecting an embedded device to a PC or other source of communications.
RS232_Example3
Again the RS232 console tabs reflect the data as it is sent and received.
UART Bridge
This example allows a microcontroller with two UART peripherals to receive data one one UART and transmit on the other and visa versa in a reliable manner using interrupts. Note that this method will only work with hardware UART channels. A software UART could be done in a similar way using a falling edge type interrupt on the UART RX pin to trigger the receive function.
RS232_Example4
COM Port
The COM port property allows you to attach the RS232 component to a COM port on your PC during simulation allowing real world hardware such as RS232, Bluetooth, GPS to work with the simulation.
Injector
The Injector property allows you to select an injector component on the panel for use in the simulation. The human interface injector can be used to inject typed in data via the console window and can be seen in examples 2 and 3 above.
There are other pre-made injectors to allow you to do various aspects from simulating a generic AT terminal to simulating a specific remote device.
Macro reference
ChangeHWBaud
![]() |
ChangeHWBaud |
Changes the hardware UART baud rate allowing for dynamic speed changes. | |
![]() |
NewBaud |
0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200, 8=250000 | |
![]() |
Return |
Initialise
![]() |
Initialise |
Sets up the RS232 peripheral, must be called at the start of your program or at least before you start calling any other RS232 macros. | |
![]() |
Return |
ReceiveBinary16Bit
ReceiveBinary32Bit
ReceiveBinaryFloat
ReceiveByteArray
ReceiveChar
![]() |
ReceiveChar |
Attempts to receive a single packet from the UART interface. | |
![]() |
Timeout |
Time to wait in milliseconds for valid data before returning, 0=Dont wait, 255=Wait forever. | |
![]() |
Return |
ReceiveFloat
ReceiveHexNumber
ReceiveINTArray
ReceiveNumber
ReceiveString
SendBinary16Bit
![]() |
SendBinary16Bit |
Sends out a 16-bit binary value split across two bytes. | |
![]() |
Value |
![]() |
MSBfirst |
0=Least significant byte first, 1=Most significant byte first | |
![]() |
Return |
SendBinary32Bit
![]() |
SendBinary32Bit |
Sends out a 32-bit binary value split across four bytes. | |
![]() |
Value |
![]() |
MSBfirst |
0=Least significant byte first, 1=Most significant byte first | |
![]() |
Return |
SendBinaryFloat
![]() |
SendBinaryFloat |
Sends out a 32-bit binary floating point value split across four bytes. | |
![]() |
Value |
![]() |
MSBfirst |
0=Least significant byte first, 1=Most significant byte first | |
![]() |
Return |
SendByteArray
![]() |
SendByteArray |
Transmits an array of bytes via the UART peripheral | |
![]() |
Data |
Data to transmit | |
![]() |
NumBytes |
Number of bytes to send from the array | |
![]() |
Return |
SendChar
![]() |
SendChar |
Sends out a single packet from the UART interface. | |
![]() |
Char |
![]() |
Return |
SendFloat
![]() |
SendFloat |
Sends out a floating point number as an ASCII String from the UART interface. | |
![]() |
Number |
![]() |
Return |
SendHexNumber
SendINTArray
SendNumber
![]() |
SendNumber |
Sends out a number as an ASCII String from the UART interface. | |
![]() |
Number |
![]() |
Return |
SendString
![]() |
SendString |
Sends out a string of bytes from the UART interface. | |
![]() |
Data |
![]() |
Return |