Jump to content

Component: RF ISM (EB063, MRF49XA) (Wireless): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(17 intermediate revisions by 2 users not shown)
Line 14: Line 14:
==RF ISM (EB063, MRF49XA) component==
==RF ISM (EB063, MRF49XA) component==
A simple RF-ISM communications module based on the Microchip Alpha MRF49XA device. Also available in the form of the EB063 RF E-block.
A simple RF-ISM communications module based on the Microchip Alpha MRF49XA device. Also available in the form of the EB063 RF E-block.
==Component Source Code==
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_RF-ISM.fcfx FC_Comp_Source_RF-ISM.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_RF-ISM.fcfx FC_Comp_Source_RF-ISM.fcfx]


==Detailed description==
==Detailed description==




Line 26: Line 48:


==Examples==
==Examples==




Line 39: Line 77:
{{Fcfile|RF_Test.fcfx|RF Example}}
{{Fcfile|RF_Test.fcfx|RF Example}}


==Downloadable macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
 
 
 
 
 
 
 
==Macro reference==
 
===ActivateRXMode===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSyncPattern'''
| width="90%" class="mtx-class-macrohead" | '''ActivateRXMode'''
|-
|-
| colspan="2" | Allows the sync pattern to be modified during runtime to allow for switching between several different RF connections. 
| colspan="2" | Enables the receiver interface, allowing data to be received. The transmitter interface is automatically disabled. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" | Mode
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
===ActivateTXMode===
{| class="mtx-class-macrotable wikitable"
|-
|-
| colspan="2" | Switches on or off the extended sync functionality 
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ActivateTXMode'''
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| colspan="2" | Enables the transmitter interface, allowing data to be sent. The receiver interface is automatically disabled. 
| width="90%" | Pattern
|-
|-
| colspan="2" | The bit pattern used for the standard sync mode 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 64: Line 117:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CheckBuffer===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByte'''
| width="90%" class="mtx-class-macrohead" | '''CheckBuffer'''
|-
|-
| colspan="2" | Puts the RF module in data mode and attempts to receive a single byte from the RF connection. Only packets containing a single data byte will be accepted. 
| colspan="2" | Checks for incoming data for a specific period of time. Returns a value greater then 250 to indicate a failure. Returns the length of the incoming data buffer to indicate success. 
|-
|-
|-
|-
Line 75: Line 129:
| width="90%" | Timeout
| width="90%" | Timeout
|-
|-
| colspan="2" | Specifies how many milliseconds to wait for valid data before returning. 
| colspan="2" | Time to wait before returning no data available 
|-
| 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''
|}
 
 
===FSKRead===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''FSKRead'''
|-
| colspan="2" | Reads the FSK (frequency shift key) data pin. 
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 82: Line 150:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===FSKWrite===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString'''
| width="90%" class="mtx-class-macrohead" | '''FSKWrite'''
|-
|-
| colspan="2" | Puts the RF module in data mode and transmits a packet containing the data string through the RF connection. A packet consists of Sync information, Data and Checksum. 
| colspan="2" | Writes to the FSK (frequency shift key) data pin. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
| width="90%" | State
|-
|-
| colspan="2" |  
| colspan="2" |  
Line 100: Line 169:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===GetBufferData===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''TXTune'''
| width="90%" class="mtx-class-macrohead" | '''GetBufferData'''
|-
|-
| colspan="2" | Used to specify and adjust the RF transmitter properties during runtime. 
| colspan="2" | Returns a value from the incoming receive data buffer. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Deviation
| width="90%" | Index
|-
| colspan="2" | Specifies which position in the buffer to read data from 
|-
| 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''
|}
 
 
===GetDataCount===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''GetDataCount'''
|-
| colspan="2" | Returns the number of bytes in the received data buffer. 
|-
|-
| 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''
|}
 
 
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| colspan="2" | Specifies the transmit FSK frequency deviation - Range 0 - 15 
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| colspan="2" | Starts up and configures the RF module ready for use. The macro will return a value greater then 0 if the module has been started correctly, otherwise the macro will return a 0. 
| width="90%" | Power
|-
|-
| colspan="2" | Specifies the transmitter power - Range 0 - 7 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===RXTune===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RXTune'''
| width="90%" class="mtx-class-macrohead" | '''RXTune'''
|-
|-
| colspan="2" | Used to specify and adjust the RF receiver properties during runtime. 
| colspan="2" | Used to specify and adjust the RF receiver properties during runtime. 
Line 151: Line 245:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReadRXSignalStrength===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetBufferData'''
| width="90%" class="mtx-class-macrohead" | '''ReadRXSignalStrength'''
|-
|-
| colspan="2" | Allows a value to be loaded into the transmit buffer, 
| colspan="2" | Returns the current received signal strength. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" | The current location in the transmit buffer starting from 0 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" | The data value to pass 
|-
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReceiveByte===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UpdateCenterFrequency'''
| width="90%" class="mtx-class-macrohead" | '''ReceiveByte'''
|-
|-
| colspan="2" | Allows the RF center frequency to be adjusted during runtime to allow multiple RF channels to be scanned or multiplexed. 
| colspan="2" | Puts the RF module in data mode and attempts to receive a single byte from the RF connection. Only packets containing a single data byte will be accepted. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Frequency
| width="90%" | Timeout
|-
|-
| colspan="2" | Specifies the new center frequency value - Range 96 - 3903 
| colspan="2" | Specifies how many milliseconds to wait for valid data before returning. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ReceiveString===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ReceiveString'''
|-
| colspan="2" | Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection. 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''FSKWrite'''
|-
|-
| colspan="2" | Writes to the FSK (frequency shift key) data pin. 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Length
|-
|-
| colspan="2" | Specifies the maximum number of bytes to try and receive 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
| width="90%" | Timeout
|-
|-
| colspan="2" |  
| colspan="2" | Specifies how many milliseconds to wait for valid data before returning. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendBuffer===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetDataCount'''
| width="90%" class="mtx-class-macrohead" | '''SendBuffer'''
|-
|-
| colspan="2" | Returns the number of bytes in the received data buffer. 
| colspan="2" | Sends the contents of the transmit buffer. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
|-
|-
| colspan="2" | Specifies how many bytes to transfer from the transmit buffer 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendByte===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBuffer'''
| width="90%" class="mtx-class-macrohead" | '''SendByte'''
|-
|-
| colspan="2" | Sends the contents of the transmit buffer. 
| colspan="2" | Puts the RF module in data mode and transmits a packet containing a single data byte through the RF connection. A packet consists of Sync information, Data and Checksum. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
| width="90%" | Data
|-
|-
| colspan="2" | Specifies how many bytes to transfer from the transmit buffer 
| colspan="2" |  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 241: Line 340:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SendString===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByte'''
| width="90%" class="mtx-class-macrohead" | '''SendString'''
|-
|-
| colspan="2" | Puts the RF module in data mode and transmits a packet containing a single data byte through the RF connection. A packet consists of Sync information, Data and Checksum. 
| colspan="2" | Puts the RF module in data mode and transmits a packet containing the data string through the RF connection. A packet consists of Sync information, Data and Checksum. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
| width="90%" | Data
|-
|-
Line 259: Line 359:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetBufferData===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetBufferData'''
|-
| colspan="2" | Allows a value to be loaded into the transmit buffer, 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" | The current location in the transmit buffer starting from 0 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ActivateTXMode'''
|-
|-
| colspan="2" | Enables the transmitter interface, allowing data to be sent. The receiver interface is automatically disabled. 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
|-
| colspan="2" | The data value to pass 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 272: Line 383:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetDataRate===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDataRate'''
| width="90%" class="mtx-class-macrohead" | '''SetDataRate'''
|-
|-
| colspan="2" | Allows the RF data rate to be adjusted during runtime. 
| colspan="2" | Allows the RF data rate to be adjusted during runtime. 
Line 290: Line 402:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SetSyncPattern===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''SetSyncPattern'''
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" | Allows the sync pattern to be modified during runtime to allow for switching between several different RF connections. 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ActivateRXMode'''
|-
|-
| colspan="2" | Enables the receiver interface, allowing data to be received. The transmitter interface is automatically disabled. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mode
|-
| colspan="2" | Switches on or off the extended sync functionality 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pattern
|-
| colspan="2" | The bit pattern used for the standard sync mode 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 303: Line 426:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===TXTune===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''FSKRead'''
| width="90%" class="mtx-class-macrohead" | '''TXTune'''
|-
|-
| colspan="2" | Reads the FSK (frequency shift key) data pin. 
| colspan="2" | Used to specify and adjust the RF transmitter properties during runtime. 
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" | Deviation
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| colspan="2" | Specifies the transmit FSK frequency deviation - Range 0 - 15 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadRXSignalStrength'''
|-
|-
| colspan="2" | Returns the current received signal strength. 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Power
|-
|-
| colspan="2" | Specifies the transmitter power - Range 0 - 7 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Uninitialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Uninitialise'''
| width="90%" class="mtx-class-macrohead" | '''Uninitialise'''
|-
|-
| colspan="2" | Powers down the RF module. The module must be re-initialised before it can be used again. 
| colspan="2" | Powers down the RF module. The module must be re-initialised before it can be used again. 
Line 342: Line 464:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===UpdateCenterFrequency===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckBuffer'''
| width="90%" class="mtx-class-macrohead" | '''UpdateCenterFrequency'''
|-
|-
| colspan="2" | Checks for incoming data for a specific period of time. Returns a value greater then 250 to indicate a failure. Returns the length of the incoming data buffer to indicate success. 
| colspan="2" | Allows the RF center frequency to be adjusted during runtime to allow multiple RF channels to be scanned or multiplexed. 
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
| width="90%" | Frequency
|-
|-
| colspan="2" | Time to wait before returning no data available 
| colspan="2" | Specifies the new center frequency value - Range 96 - 3903 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| 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''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
==Property reference==
 
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetBufferData'''
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
| colspan="2" | Returns a value from the incoming receive data buffer. 
|-
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Connections
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
|-
| colspan="2" | Specifies which position in the buffer to read data from 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| colspan="2" | SPI Channel selector 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString'''
| width="90%" | MOSI
|-
|-
| colspan="2" | Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection. 
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
|-
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | MISO
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
| width="90%" | Length
|-
|-
| colspan="2" | Specifies the maximum number of bytes to try and receive 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | CLK
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
| width="90%" | Timeout
|-
|-
| colspan="2" | Specifies how many milliseconds to wait for valid data before returning. 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | CS / SS
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| colspan="2" | Chip Select / Slave Select Pin  Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
| width="90%" | FSEL Pin
|-
|-
| colspan="2" | Starts up and configures the RF module ready for use. The macro will return a value greater then 0 if the module has been started correctly, otherwise the macro will return a 0. 
| colspan="2" | RF Mode selection pin 
|-
|-
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" class="mtx-class-propfolder" | RF Settings
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
 
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
|-
|-
Line 478: Line 583:
|-
|-
| colspan="2" | Selects if an additional fixed sync byte is to be used. 
| colspan="2" | Selects if an additional fixed sync byte is to be used. 
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Receiver Settings
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 493: Line 602:
|-
|-
| colspan="2" | The signal to noise threshold used to control the sensitivity 
| colspan="2" | The signal to noise threshold used to control the sensitivity 
|-
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" class="mtx-class-propfolder" | Transmitter Settings
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Line 504: Line 617:
| colspan="2" | The amount of power to use when transmitting 
| colspan="2" | The amount of power to use when transmitting 
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | SPI Channel selector 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | MOSI
|-
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | MISO
|-
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | CLK
|-
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | CS / SS
|-
| colspan="2" | Chip Select / Slave Select Pin  Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | FSEL Pin
|-
| colspan="2" | RF Mode selection pin 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
|-
|-
|-
|-

Latest revision as of 14:37, 13 July 2026

Author Matrix Ltd.
Version 2.0
Category Wireless


RF ISM (EB063, MRF49XA) component

A simple RF-ISM communications module based on the Microchip Alpha MRF49XA device. Also available in the form of the EB063 RF E-block.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_RF-ISM.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_RF-ISM.fcfx

Detailed description

No detailed description exists yet for this component

Examples

The example attempts to send and receive data from a remote board. You will need two RF modules to allow the communications to work.

The example can be used to drive both ends of the RF communications as it will send out data but also print out any data received onto the LCD. Pins RA0 and RA1 can be used for diagnostics on the program. RF Example






Macro reference

ActivateRXMode

ActivateRXMode
Enables the receiver interface, allowing data to be received. The transmitter interface is automatically disabled. 
- VOID Return


ActivateTXMode

ActivateTXMode
Enables the transmitter interface, allowing data to be sent. The receiver interface is automatically disabled. 
- VOID Return


CheckBuffer

CheckBuffer
Checks for incoming data for a specific period of time. Returns a value greater then 250 to indicate a failure. Returns the length of the incoming data buffer to indicate success. 
- BYTE Timeout
Time to wait before returning no data available 
- BYTE Return


FSKRead

FSKRead
Reads the FSK (frequency shift key) data pin. 
- BYTE Return


FSKWrite

FSKWrite
Writes to the FSK (frequency shift key) data pin. 
- BYTE State
 
- VOID Return


GetBufferData

GetBufferData
Returns a value from the incoming receive data buffer. 
- BYTE Index
Specifies which position in the buffer to read data from 
- BYTE Return


GetDataCount

GetDataCount
Returns the number of bytes in the received data buffer. 
- BYTE Return


Initialise

Initialise
Starts up and configures the RF module ready for use. The macro will return a value greater then 0 if the module has been started correctly, otherwise the macro will return a 0. 
- BYTE Return


RXTune

RXTune
Used to specify and adjust the RF receiver properties during runtime. 
- BYTE Bandwidth
Specifies the Rx bandwidth - Range 1- 6 
- BYTE Gain
Specifies the Rx gain - Range 0 - 3 
- BYTE Threshold
Specifies the Rx signal to noise threshold - Range 0 - 5 
- VOID Return


ReadRXSignalStrength

ReadRXSignalStrength
Returns the current received signal strength. 
- BYTE Return


ReceiveByte

ReceiveByte
Puts the RF module in data mode and attempts to receive a single byte from the RF connection. Only packets containing a single data byte will be accepted. 
- BYTE Timeout
Specifies how many milliseconds to wait for valid data before returning. 
- BYTE Return


ReceiveString

ReceiveString
Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection. 
- BYTE Length
Specifies the maximum number of bytes to try and receive 
- BYTE Timeout
Specifies how many milliseconds to wait for valid data before returning. 
- STRING Return


SendBuffer

SendBuffer
Sends the contents of the transmit buffer. 
- BYTE Count
Specifies how many bytes to transfer from the transmit buffer 
- VOID Return


SendByte

SendByte
Puts the RF module in data mode and transmits a packet containing a single data byte through the RF connection. A packet consists of Sync information, Data and Checksum. 
- BYTE Data
 
- VOID Return


SendString

SendString
Puts the RF module in data mode and transmits a packet containing the data string through the RF connection. A packet consists of Sync information, Data and Checksum. 
- STRING Data
 
- VOID Return


SetBufferData

SetBufferData
Allows a value to be loaded into the transmit buffer, 
- BYTE Index
The current location in the transmit buffer starting from 0 
- BYTE Data
The data value to pass 
- VOID Return


SetDataRate

SetDataRate
Allows the RF data rate to be adjusted during runtime. 
- BYTE Rate
Specifies the new data rate 
- VOID Return


SetSyncPattern

SetSyncPattern
Allows the sync pattern to be modified during runtime to allow for switching between several different RF connections. 
- BYTE Mode
Switches on or off the extended sync functionality 
- BYTE Pattern
The bit pattern used for the standard sync mode 
- VOID Return


TXTune

TXTune
Used to specify and adjust the RF transmitter properties during runtime. 
- BYTE Deviation
Specifies the transmit FSK frequency deviation - Range 0 - 15 
- BYTE Power
Specifies the transmitter power - Range 0 - 7 
- VOID Return


Uninitialise

Uninitialise
Powers down the RF module. The module must be re-initialised before it can be used again. 
- VOID Return


UpdateCenterFrequency

UpdateCenterFrequency
Allows the RF center frequency to be adjusted during runtime to allow multiple RF channels to be scanned or multiplexed. 
- UINT Frequency
Specifies the new center frequency value - Range 96 - 3903 
- VOID Return


Property reference

Properties
Connections
Channel
SPI Channel selector 
MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
FSEL Pin
RF Mode selection pin 
RF Settings
Module Frequency
Module frequency - must be matched with the specific RF transciever being used. 
Center Frequency (96-3903)
Specifies the default RF center frequency 
Center Frequency (MHz)
Calculation to work out the approx actual frequency 
Data Mode
Specifies if the module will send data packets (Byte) or FSK bits (Bit) 
Data Buffer Size (Max)
Maximum number of bytes that can be loaded into a single data packet 
Rate Divider 1
Data rate prescaler 1 - Coarse control 
Rate Divider 2 (0-127)
Data rate prescaler 2 - Fine control 
Max Throughput (Kb/s)
Calculated max data throughput if the data is 100% active 
Data Rate Value
Actual default value passed to the data rate control 
Sync Pattern
Default sync pattern used by the standard sync in byte data mode. 
Extended Sync
Selects if an additional fixed sync byte is to be used. 
Receiver Settings
Bandwidth
Controls the receiver bandwidth, the higher the value the bigger the datarate that can be acheived but the fewer channels that can co-exist 
Gain
Controls the receiver gain - the amount to amplify the incoming signal before processing 
Threshold
The signal to noise threshold used to control the sensitivity 
Transmitter Settings
Bandwidth
Controls the transmitter bandwidth, i.e. the frequency either side of the center frequency to use for the RF communications 
Power
The amount of power to use when transmitting 
Simulation
Label
Label used to help identify the component on the panel. 
Scope Traces
Selects if the scope traces are automatically generated or not 
Console Data
Selects if the console data is automatically generated or not 
API