Component: UART Software (Timer) (Comms: Interface): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder"" |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 92: | Line 92: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CheckBuffer''' | ||
|- | |- | ||
| colspan="2" | Returns the number of values in the transmit or receive buffer | | colspan="2" | Returns the number of values in the transmit or receive buffer | ||
| Line 111: | Line 111: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Initialises the UART component pins ready to send and receive data | | colspan="2" | Initialises the UART component pins ready to send and receive data | ||
| Line 125: | Line 125: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBinary16Bit''' | ||
|- | |- | ||
| colspan="2" | Receives a binary 16-bit value split across two bytes. | | colspan="2" | Receives a binary 16-bit value split across two bytes. | ||
| Line 149: | Line 149: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBinary32Bit''' | ||
|- | |- | ||
| colspan="2" | Receives a binary 32-bit value split across four bytes. | | colspan="2" | Receives a binary 32-bit value split across four bytes. | ||
| Line 173: | Line 173: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBinaryFloat''' | ||
|- | |- | ||
| colspan="2" | Receives a binary 32-bit floating point value split across four bytes. | | colspan="2" | Receives a binary 32-bit floating point value split across four bytes. | ||
| Line 197: | Line 197: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveBytetArray''' | ||
|- | |- | ||
| colspan="2" | Gets an array of values from the receive buffer. Returns number of values received. | | colspan="2" | Gets an array of values from the receive buffer. Returns number of values received. | ||
| Line 226: | Line 226: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveChar''' | ||
|- | |- | ||
| colspan="2" | Attempts to receive a single packet from the UART interface. | | colspan="2" | Attempts to receive a single packet from the UART interface. | ||
| Line 245: | Line 245: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''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. | | 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. | ||
| Line 269: | Line 269: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''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. | | 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. | ||
| Line 298: | Line 298: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveINTArray''' | ||
|- | |- | ||
| colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | | colspan="2" | Receives an array of 16-bit INT/UINT values and returns the number of values received. | ||
| Line 332: | Line 332: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''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. | | 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. | ||
| Line 356: | Line 356: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReceiveString''' | ||
|- | |- | ||
| colspan="2" | Gets a string from the receive buffer | | colspan="2" | Gets a string from the receive buffer | ||
| Line 380: | Line 380: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendBinary16Bit''' | ||
|- | |- | ||
| colspan="2" | Sends out a 16-bit binary value split across two bytes. | | colspan="2" | Sends out a 16-bit binary value split across two bytes. | ||
| Line 404: | Line 404: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendBinary32Bit''' | ||
|- | |- | ||
| colspan="2" | Sends out a 32-bit binary value split across four bytes. | | colspan="2" | Sends out a 32-bit binary value split across four bytes. | ||
| Line 428: | Line 428: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendBinaryFloat''' | ||
|- | |- | ||
| colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. | | colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. | ||
| Line 452: | Line 452: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendByteArray''' | ||
|- | |- | ||
| colspan="2" | Sends an array of bytes to the transmit buffer | | colspan="2" | Sends an array of bytes to the transmit buffer | ||
| Line 476: | Line 476: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendChar''' | ||
|- | |- | ||
| colspan="2" | Sends out a single packet from the UART interface. | | colspan="2" | Sends out a single packet from the UART interface. | ||
| Line 495: | Line 495: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendFloat''' | ||
|- | |- | ||
| colspan="2" | Sends a single float to the transmit buffer | | colspan="2" | Sends a single float to the transmit buffer | ||
| Line 514: | Line 514: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendHexNumber''' | ||
|- | |- | ||
| colspan="2" | Sends out a number as an ASCII hexadecimal String from the UART interface. | | colspan="2" | Sends out a number as an ASCII hexadecimal String from the UART interface. | ||
| Line 543: | Line 543: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendIntArray''' | ||
|- | |- | ||
| colspan="2" | Sends an array of ints to the transmit buffer | | colspan="2" | Sends an array of ints to the transmit buffer | ||
| Line 572: | Line 572: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendNumber''' | ||
|- | |- | ||
| colspan="2" | Sends out a number as an ASCII String to the transmit buffer | | colspan="2" | Sends out a number as an ASCII String to the transmit buffer | ||
| Line 591: | Line 591: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SendString''' | ||
|- | |- | ||
| colspan="2" | Sends an string to the transmit buffer | | colspan="2" | Sends an string to the transmit buffer | ||
| Line 610: | Line 610: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''UART_Timer_Process''' | ||
|- | |- | ||
| colspan="2" | Called as part of a timer interrupt at the specific UART baud rate. | | colspan="2" | Called as part of a timer interrupt at the specific UART baud rate. | ||
| Line 625: | Line 625: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Global Settings | ||
|- | |- | ||
|- | |- | ||
| Line 652: | Line 652: | ||
| colspan="2" | Allows the Receive pin to be enabled / disabled | | colspan="2" | Allows the Receive pin to be enabled / disabled | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Transmit Properties | ||
|- | |- | ||
|- | |- | ||
| Line 666: | Line 666: | ||
| colspan="2" | Number of bytes that can be stored in the outgoing transmit buffer | | colspan="2" | Number of bytes that can be stored in the outgoing transmit buffer | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-propfolder" | Simulation | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:37, 13 July 2026
| Author | MatrixTSL |
| Version | 1.0 |
| Category | Comms: Interface |
UART Software (Timer) component
Creates a reliable software UART that can be driven using a timer interrupt setup by the user. The timer interrupt must be interrupting at the required baud rate. e.g 9600Hz.
Detailed description
No detailed description exists yet for this component
Examples
Simple example showing how to enable a timer interrupt at the desired baud rate then receive a string. If anything is received then it will be echoed back out and displayed on a LCD
Macro reference
CheckBuffer
| CheckBuffer | |
| Returns the number of values in the transmit or receive buffer | |
| Buffer | |
| 0=Transmit / 1=Receive | |
| Return | |
Initialise
| Initialise | |
| Initialises the UART component pins ready to send and receive data | |
| Return | |
ReceiveBinary16Bit
ReceiveBinary32Bit
ReceiveBinaryFloat
ReceiveBytetArray
| ReceiveBytetArray | |
| Gets an array of values from the receive buffer. Returns number of values received. | |
| Values | |
| NumValues | |
| Timeout | |
| Time in milliseconds to wait for data | |
| Return | |
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
| ReceiveString | |
| Gets a string from the receive buffer | |
| MaxChars | |
| Timeout | |
| Time in milliseconds to wait for data | |
| Return | |
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 | |
| Sends an array of bytes to the transmit buffer | |
| Values | |
| NumValues | |
| Return | |
SendChar
| SendChar | |
| Sends out a single packet from the UART interface. | |
| Char | |
| Return | |
SendFloat
| SendFloat | |
| Sends a single float to the transmit buffer | |
| Value | |
| Return | |
SendHexNumber
SendIntArray
| SendIntArray | |
| Sends an array of ints to the transmit buffer | |
| Data | |
| NumValues | |
| MSBfirst | |
| 0=Least significant byte first, 1=Most significant byte first | |
| Return | |
SendNumber
| SendNumber | |
| Sends out a number as an ASCII String to the transmit buffer | |
| Number | |
| Return | |
SendString
| SendString | |
| Sends an string to the transmit buffer | |
| Data | |
| Return | |
UART_Timer_Process
| UART_Timer_Process | |
| Called as part of a timer interrupt at the specific UART baud rate. | |
| Return | |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_UART_Software_Timer.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_UART_Software_Timer.fcfx