Component: UART Software (Timer) (Comms: Interface)

From Flowcode Help
Jump to navigationJump to search
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.

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

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

FC6 Icon.png UART_Timer_Example









Macro reference

CheckBuffer

Fc9-comp-macro.png CheckBuffer
Returns the number of values in the transmit or receive buffer 
Fc9-bool-icon.png - BOOL Buffer
0=Transmit / 1=Receive 
Fc9-u16-icon.png - UINT Return


Initialise

Fc9-comp-macro.png Initialise
Initialises the UART component pins ready to send and receive data 
Fc9-void-icon.png - VOID Return


ReceiveArray

Fc9-comp-macro.png ReceiveArray
Gets an array of values from the receive buffer. Returns number of values received. 
Fc9-u16-icon.png - UINT Values
 
Fc9-u16-icon.png - UINT NumValues
 
Fc9-u16-icon.png - UINT Timeout
Time in milliseconds to wait for data 
Fc9-u16-icon.png - UINT Return


ReceiveString

Fc9-comp-macro.png ReceiveString
Gets a string from the receive buffer 
Fc9-u16-icon.png - UINT MaxChars
 
Fc9-u16-icon.png - UINT Timeout
Time in milliseconds to wait for data 
Fc9-string-icon.png - STRING Return


ReceiveValue

Fc9-comp-macro.png ReceiveValue
Gets a single value from the receive buffer 
Fc9-u16-icon.png - UINT Timeout
Time in milliseconds to wait for data 
Fc9-u16-icon.png - UINT Return


SendArray

Fc9-comp-macro.png SendArray
Sends an array of values to the transmit buffer 
Fc9-u16-icon.png - UINT Values
 
Fc9-u16-icon.png - UINT NumValues
 
Fc9-void-icon.png - VOID Return


SendString

Fc9-comp-macro.png SendString
Sends an string to the transmit buffer 
Fc9-string-icon.png - STRING Data
 
Fc9-void-icon.png - VOID Return


SendValue

Fc9-comp-macro.png SendValue
Sends a single value to the transmit buffer 
Fc9-u16-icon.png - UINT Value
 
Fc9-void-icon.png - VOID Return


UART_Timer_Process

Fc9-comp-macro.png UART_Timer_Process
Called as part of a timer interrupt at the specific UART baud rate. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Global Settings
Fc9-type-16-icon.png Data Bits
 
Fc9-type-16-icon.png Stop Bits
 
Fc9-type-7-icon.png Use TX
Allows the Transmit pin to be enabled / disabled 
Fc9-type-7-icon.png Use RX
Allows the Receive pin to be enabled / disabled 
Fc9-conn-icon.png Transmit Properties
Fc9-type-5-icon.png Transmit Pin
Pin assigned to transmitting data 
Fc9-type-21-icon.png Transmit Buffer Size
Number of bytes that can be stored in the outgoing transmit buffer 
Fc9-conn-icon.png Receive Properties
Fc9-type-5-icon.png Receive Pin
Pin assigned to receiving data 
Fc9-type-21-icon.png Receive Buffer Size
Number of bytes that can be stored in the incoming receive buffer 
Fc9-conn-icon.png Simulation
Fc9-type-16-icon.png API