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

From Flowcode Help
Jump to navigationJump to search
(XML import)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| 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
| 2.0 (Release)
+
| 2.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Wireless
 
| 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.
 +
 +
==Detailed description==
  
==[[File:Component Icon 45bd9065_b6f7_42be_b96f_28c3df2c0a22.png|Image]] RF ISM (EB063, MRF49XA) component==
+
''No detailed description exists yet for this 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.
 
  
 
==Examples==
 
==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 attempts to send and receive data from a remote board. You will need two RF modules to allow the communications to work.
  
Line 27: Line 29:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>SetSyncPattern</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Allows the sync pattern to be modified during runtime to allow for switching between several different RF connections.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetSyncPattern'''
 +
|-
 +
| colspan="2" | Allows the sync pattern to be modified during runtime to allow for switching between several different RF connections.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Mode
 +
|-
 +
| colspan="2" | Switches on or off the extended sync functionality&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Pattern
 +
|-
 +
| colspan="2" | The bit pattern used for the standard sync mode&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Mode''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Switches on or off the extended sync functionality
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByte'''
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Specifies how many milliseconds to wait for valid data before returning.&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''Pattern''
 
::The bit pattern used for the standard sync mode
 
  
 +
{| 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" | 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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 value'''
 
  
:''This call does not return a value''
+
{| 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;" | '''TXTune'''
 +
|-
 +
| colspan="2" | Used to specify and adjust the RF transmitter properties during runtime.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Deviation
 +
|-
 +
| colspan="2" | Specifies the transmit FSK frequency deviation - Range 0 - 15&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Power
 +
|-
 +
| colspan="2" | Specifies the transmitter power - Range 0 - 7&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ReceiveByte</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RXTune'''
 +
|-
 +
| colspan="2" | Used to specify and adjust the RF receiver properties during runtime.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Bandwidth
 +
|-
 +
| colspan="2" | Specifies the Rx bandwidth - Range 1- 6&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Gain
 +
|-
 +
| colspan="2" | Specifies the Rx gain - Range 0 - 3&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Threshold
 +
|-
 +
| colspan="2" | Specifies the Rx signal to noise threshold - Range 0 - 5&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Timeout''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Specifies how many milliseconds to wait for valid data before returning.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetBufferData'''
 +
|-
 +
| colspan="2" | Allows a value to be loaded into the transmit buffer,&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | The current location in the transmit buffer starting from 0&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | The data value to pass&nbsp;
 +
|-
 +
| 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 value'''
+
{| 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;" | '''UpdateCenterFrequency'''
 +
|-
 +
| colspan="2" | Allows the RF center frequency to be adjusted during runtime to allow multiple RF channels to be scanned or multiplexed.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Frequency
 +
|-
 +
| colspan="2" | Specifies the new center frequency value - Range 96 - 3903&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| 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;" | '''FSKWrite'''
 +
|-
 +
| colspan="2" | Writes to the FSK (frequency shift key) data pin.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | State
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SendString</tt></u></span>===
 
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.
+
{| 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;" | '''GetDataCount'''
 +
|-
 +
| colspan="2" | Returns the number of bytes in the received data buffer.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|STRING]] ''Data''
+
{| 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;" | '''SendBuffer'''
 +
|-
 +
| colspan="2" | Sends the contents of the transmit buffer.&nbsp;
 +
|-
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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 value'''
+
{| 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;" | '''SendByte'''
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| 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;" | '''ActivateTXMode'''
 +
|-
 +
| colspan="2" | Enables the transmitter interface, allowing data to be sent. The receiver interface is automatically disabled.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>TXTune</tt></u></span>===
 
Used to specify and adjust the RF transmitter properties during runtime.
 
  
'''Parameters'''
+
{| 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;" | '''SetDataRate'''
 +
|-
 +
| colspan="2" | Allows the RF data rate to be adjusted during runtime.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Rate
 +
|-
 +
| colspan="2" | Specifies the new data rate&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''Deviation''
 
::Specifies the transmit FSK frequency deviation - Range 0 - 15
 
  
:[[Variable Types|BYTE]] ''Power''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Specifies the transmitter power - Range 0 - 7
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| 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 value'''
+
{| 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;" | '''FSKRead'''
 +
|-
 +
| colspan="2" | Reads the FSK (frequency shift key) data pin.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| 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;" | '''ReadRXSignalStrength'''
 +
|-
 +
| colspan="2" | Returns the current received signal strength.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>RXTune</tt></u></span>===
 
Used to specify and adjust the RF receiver properties during runtime.
 
  
'''Parameters'''
+
{| 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;" | '''Uninitialise'''
 +
|-
 +
| colspan="2" | Powers down the RF module. The module must be re-initialised before it can be used again.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''Bandwidth''
 
::Specifies the Rx bandwidth - Range 1- 6
 
  
:[[Variable Types|BYTE]] ''Gain''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Specifies the Rx gain - Range 0 - 3
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckBuffer'''
 +
|-
 +
| 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.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Time to wait before returning no data available&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''Threshold''
 
::Specifies the Rx signal to noise threshold - Range 0 - 5
 
  
 +
{| 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;" | '''GetBufferData'''
 +
|-
 +
| colspan="2" | Returns a value from the incoming receive data buffer.&nbsp;
 +
|-
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| 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 value'''
 
  
:''This call does not return a value''
+
{| 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" | Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection.&nbsp;
 +
|-
 +
|-
 +
| 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&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Specifies how many milliseconds to wait for valid data before returning.&nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>SetBufferData</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Allows a value to be loaded into the transmit buffer,
+
|-
 +
| 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" | 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.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Index''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::The current location in the transmit buffer starting from 0
+
|-
 +
| 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 1-Wire output pin ready for communications.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''Data''
 
::The data value to pass
 
  
 +
{| 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" | Starts up the UART to allow communications and initialises the states of the various  Modbus Coils, Inputs and Registers to 0.&nbsp;
 +
|-
 +
|-
 +
| 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 value'''
 
  
:''This call does not return a value''
+
{| 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" | Initialises the MIDI component and sets up the UART.&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>UpdateCenterFrequency</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Allows the RF center frequency to be adjusted during runtime to allow multiple RF channels to be scanned or multiplexed.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CommsBaud'''
 +
|-
 +
| colspan="2" | Sets the Baud rate of the alt communications channel&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Baud
 +
|-
 +
| colspan="2" | Range: 0-7 : 0=1200 / 7=115200&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|UINT]] ''Frequency''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Specifies the new center frequency value - Range 96 - 3903
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDOptions'''
 +
|-
 +
| colspan="2" | Controls some of the LCD options&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Foreground
 +
|-
 +
| colspan="2" | Range: 0-1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Background
 +
|-
 +
| colspan="2" | Range: 0-1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Transparent
 +
|-
 +
| colspan="2" | Range: 0-1&nbsp;
 +
|-
 +
| 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 value'''
+
{| 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;" | '''LCDVerbose'''
 +
|-
 +
| colspan="2" | Controls the Verbose mode.  When enabled the LCD automatically displays an account of the incoming API commands and parameters. When switched off the LCD is free for the user to control as required.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Mode
 +
|-
 +
| colspan="2" | Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:''This call does not return a value''
 
  
 +
{| 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;" | '''ReadDigitalInput'''
 +
|-
 +
| colspan="2" | Reads a single digital input.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>FSKWrite</tt></u></span>===
 
Writes to the FSK (frequency shift key) data pin.
 
  
'''Parameters'''
+
{| 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;" | '''PWMConfig'''
 +
|-
 +
| colspan="2" | Sets the PWM configuration. Channel = 0 - 1 : 0 = EN_AB, A, B / 1 = EN_CD, C, D Period = 0 - 65535 Scaler = 0 - 3 :  0=1:1 1=1:8 2=1:64 3=1:256&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 0-1&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Period
 +
|-
 +
| colspan="2" | Range: 0-65535&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Scaler
 +
|-
 +
| colspan="2" | Range: 0-3&nbsp;
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''State''
 
  
 +
{| 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;" | '''PWMEnable'''
 +
|-
 +
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | EnableMask
 +
|-
 +
| colspan="2" | Range 0-63 or 0b00000 to 0b111111&nbsp;
 +
|-
 +
| 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 value'''
 
  
:''This call does not return a value''
+
{| 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;" | '''PWMDuty'''
 +
|-
 +
| colspan="2" | Sets a single PWM channel duty. Channel = 0 - 5 : 0=EN_AB, 1=A, 2=B, 3=C, 4=D, 5=EN_CD Duty = 0 - 65535&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 0-5&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Duty
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| 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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>GetDataCount</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Returns the number of bytes in the received data buffer.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDCursor'''
 +
|-
 +
| colspan="2" | Sets the cursor position for the MIAC display&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | X
 +
|-
 +
| colspan="2" | Range: 0-21&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Y
 +
|-
 +
| colspan="2" | Range: 0-4&nbsp;
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
{| 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;" | '''WriteTran'''
 +
|-
 +
| colspan="2" | Allows a single transistor output to be switched on or off.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Channel
 +
|-
 +
| colspan="2" | Range 1-4&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Value
 +
|-
 +
| colspan="2" | 0 = Off, 1 = On&nbsp;
 +
|-
 +
| 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 value'''
+
{| 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" | &nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]]
 
  
 +
{| 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;" | '''LCDClear'''
 +
|-
 +
| colspan="2" | Clears the MIAC display&nbsp;
 +
|-
 +
|-
 +
| 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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>SendBuffer</tt></u></span>===
 
Sends the contents of the transmit buffer.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Count''
 
::Specifies how many bytes to transfer from the transmit buffer
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>SendByte</tt></u></span>===
 
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.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Data''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>ActivateTXMode</tt></u></span>===
 
Enables the transmitter interface, allowing data to be sent.
 
 
The receiver interface is automatically disabled.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>SetDataRate</tt></u></span>===
 
Allows the RF data rate to be adjusted during runtime.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Rate''
 
::Specifies the new data rate
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>ActivateRXMode</tt></u></span>===
 
Enables the receiver interface, allowing data to be received.
 
 
The transmitter interface is automatically disabled.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>FSKRead</tt></u></span>===
 
Reads the FSK (frequency shift key) data pin.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>ReadRXSignalStrength</tt></u></span>===
 
Returns the current received signal strength.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Uninitialise</tt></u></span>===
 
Powers down the RF module. The module must be re-initialised before it can be used again.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
 
 
'''Return value'''
 
 
:''This call does not return a value''
 
 
 
===<span style="font-weight: normal;"><u><tt>CheckBuffer</tt></u></span>===
 
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.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Timeout''
 
::Time to wait before returning no data available
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>GetBufferData</tt></u></span>===
 
Returns a value from the incoming receive data buffer.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Index''
 
::Specifies which position in the buffer to read data from
 
 
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
===<span style="font-weight: normal;"><u><tt>ReceiveString</tt></u></span>===
 
Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection.
 
 
'''Parameters'''
 
 
:[[Variable Types|BYTE]] ''Length''
 
::Specifies the maximum number of bytes to try and receive
 
 
:[[Variable Types|BYTE]] ''Timeout''
 
::Specifies how many milliseconds to wait for valid data before returning.
 
 
 
'''Return value'''
 
 
:[[Variable Types|STRING]]
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
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.
 
 
'''Parameters'''
 
 
:''This macro has no parameters''
 
  
 
'''Return value'''
 
 
:[[Variable Types|BYTE]]
 
 
 
 
==Simulation macro reference==
 
 
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Channel</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::CHANNEL''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
SPI Channel selector
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>MOSI</u></span>
+
|-
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::MOSI''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Module Frequency
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
+
|-
 
+
| colspan="2" | Module frequency - must be matched with the specific RF transciever being used.&nbsp;
<span style="font-weight: normal;"><u>MISO</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::MISO''.
+
| width="90%" | Center Frequency (96-3903)
 
+
|-
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
+
| colspan="2" | Specifies the default RF center frequency&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>CLK</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
 
+
| width="90%" | Center Frequency (MHz)
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::CLK''.
+
|-
 
+
| colspan="2" | Calculation to work out the approx actual frequency&nbsp;
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>CS / SS</u></span>
+
| width="90%" | Data Mode
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::SS''.
+
| colspan="2" | Specifies if the module will send data packets (Byte) or FSK bits (Bit)&nbsp;
 
+
|-
Chip Select / Slave Select Pin
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Data Buffer Size (Max)
Master Mode: General purpose output pin used to select the remote SPI device.
+
|-
 
+
| colspan="2" | Maximum number of bytes that can be loaded into a single data packet&nbsp;
Slave Mode: Hardware chip select pin input used to select the SPI device.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>FSEL Pin</u></span>
+
| width="90%" | Rate Divider 1
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''fsel_pin''.
+
| colspan="2" | Data rate prescaler 1 - Coarse control&nbsp;
 
+
|-
RF Mode selection pin
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Rate Divider 2 (0-127)
<span style="font-weight: normal;"><u>Module Frequency</u></span>
+
|-
 
+
| colspan="2" | Data rate prescaler 2 - Fine control&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''module_freq''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-15-icon.png]]
Module frequency - must be matched with the specific RF transciever being used.
+
| width="90%" | Max Throughput (Kb/s)
 
+
|-
<span style="font-weight: normal;"><u>Center Frequency (96-3903)</u></span>
+
| colspan="2" | Calculated max data throughput if the data is 100% active&nbsp;
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''cent_freq''.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Data Rate Value
Specifies the default RF center frequency
+
|-
 
+
| colspan="2" | Actual default value passed to the data rate control&nbsp;
<span style="font-weight: normal;"><u>Center Frequency (MHz)</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
This property is of type ''Floating point'' and can be referenced with the variable name ''cent_freq_cal''.
+
| width="90%" | Sync Pattern
 
+
|-
Calculation to work out the approx actual frequency
+
| colspan="2" | Default sync pattern used by the standard sync in byte data mode.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Data Mode</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Extended Sync
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''data_mode''.
+
|-
 
+
| colspan="2" | Selects if an additional fixed sync byte is to be used.&nbsp;
Specifies if the module will send data packets (Byte) or FSK bits (Bit)
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Data Buffer Size (Max)</u></span>
+
| width="90%" | Bandwidth
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''buffer_size''.
+
| colspan="2" | Controls the receiver bandwidth, the higher the value the bigger the datarate that can be acheived but the fewer channels that can co-exist&nbsp;
 
+
|-
Maximum number of bytes that can be loaded into a single data packet
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Gain
<span style="font-weight: normal;"><u>Rate Divider 1</u></span>
+
|-
 
+
| colspan="2" | Controls the receiver gain - the amount to amplify the incoming signal before processing&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''data_div1''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Data rate prescaler 1 - Coarse control
+
| width="90%" | Threshold
 
+
|-
<span style="font-weight: normal;"><u>Rate Divider 2 (0-127)</u></span>
+
| colspan="2" | The signal to noise threshold used to control the sensitivity&nbsp;
 
+
|-
This property is of type ''Signed integer'' and can be referenced with the variable name ''data_div2''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Bandwidth
Data rate prescaler 2 - Fine control
+
|-
 
+
| colspan="2" | Controls the transmitter bandwidth, i.e. the frequency either side of the center frequency to use for the RF communications&nbsp;
<span style="font-weight: normal;"><u>Max Throughput (Kb/s)</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Floating point'' and can be referenced with the variable name ''baud_rate''.
+
| width="90%" | Power
 
+
|-
Calculated max data throughput if the data is 100% active
+
| colspan="2" | The amount of power to use when transmitting&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Data Rate Value</u></span>
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''DataRateValue''.
+
|-
 
+
|-
Actual default value passed to the data rate control
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Channel
<span style="font-weight: normal;"><u>Sync Pattern</u></span>
+
|-
 
+
| colspan="2" | SPI Channel selector&nbsp;
This property is of type ''Signed integer'' and can be referenced with the variable name ''sync_pattern''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Default sync pattern used by the standard sync in byte data mode.
+
| width="90%" | MOSI
 
+
|-
<span style="font-weight: normal;"><u>Extended Sync</u></span>
+
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''extended_sync''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | MISO
Selects if an additional fixed sync byte is to be used.
+
|-
 
+
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
<span style="font-weight: normal;"><u>Bandwidth</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''rx_bandwidth''.
+
| width="90%" | CLK
 
+
|-
Controls the receiver bandwidth, the higher the value the bigger the datarate that can be acheived but the fewer channels that can co-exist
+
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Gain</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | CS / SS
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''rx_gain''.
+
|-
 
+
| 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. &nbsp;
Controls the receiver gain - the amount to amplify the incoming signal before processing
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>Threshold</u></span>
+
| width="90%" | FSEL Pin
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''rx_threshold''.
+
| colspan="2" | RF Mode selection pin&nbsp;
 
+
|-
The signal to noise threshold used to control the sensitivity
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
<span style="font-weight: normal;"><u>Bandwidth</u></span>
+
|-
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''tx_bandwidth''.
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Label
Controls the transmitter bandwidth, i.e. the frequency either side of the center frequency to use for the RF communications
+
|-
 
+
| colspan="2" | Label used to help identify the component on the panel.&nbsp;
<span style="font-weight: normal;"><u>Power</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''tx_power''.
+
| width="90%" | Scope Traces
 
+
|-
The amount of power to use when transmitting
+
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Label</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Console Data
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
|-
 
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
Label used to help identify the component on the panel.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| width="90%" | API
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi::ScopeTraces''.
+
| colspan="2" | &nbsp;
 
+
|}
Selects if the scope traces are automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Console Data</u></span>
 
 
 
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi::ConsoleData''.
 
 
 
Selects if the console data is automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Injector</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::Injector''.
 
 
 
''<span style="color:red;">No additional information</span>''
 

Revision as of 20:35, 16 November 2021

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.

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. FC6 Icon.png RF Example

Downloadable macro reference

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


Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Timeout
Specifies how many milliseconds to wait for valid data before returning. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png 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. 
Fc9-string-icon.png - STRING Data
 
Fc9-void-icon.png - VOID Return


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


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


Fc9-comp-macro.png SetBufferData
Allows a value to be loaded into the transmit buffer, 
Fc9-u8-icon.png - BYTE Index
The current location in the transmit buffer starting from 0 
Fc9-u8-icon.png - BYTE Data
The data value to pass 
Fc9-void-icon.png - VOID Return


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


Fc9-comp-macro.png FSKWrite
Writes to the FSK (frequency shift key) data pin. 
Fc9-u8-icon.png - BYTE State
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetDataCount
Returns the number of bytes in the received data buffer. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png SendBuffer
Sends the contents of the transmit buffer. 
Fc9-u8-icon.png - BYTE Count
Specifies how many bytes to transfer from the transmit buffer 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ActivateTXMode
Enables the transmitter interface, allowing data to be sent. The receiver interface is automatically disabled. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetDataRate
Allows the RF data rate to be adjusted during runtime. 
Fc9-u8-icon.png - BYTE Rate
Specifies the new data rate 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ActivateRXMode
Enables the receiver interface, allowing data to be received. The transmitter interface is automatically disabled. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png FSKRead
Reads the FSK (frequency shift key) data pin. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadRXSignalStrength
Returns the current received signal strength. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Uninitialise
Powers down the RF module. The module must be re-initialised before it can be used again. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Timeout
Time to wait before returning no data available 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetBufferData
Returns a value from the incoming receive data buffer. 
Fc9-u8-icon.png - BYTE Index
Specifies which position in the buffer to read data from 
Fc9-u8-icon.png - BYTE Return


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


Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Sets up the 1-Wire output pin ready for communications. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Initialises the MIDI component and sets up the UART. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CommsBaud
Sets the Baud rate of the alt communications channel 
Fc9-u8-icon.png - BYTE Baud
Range: 0-7 : 0=1200 / 7=115200 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDOptions
Controls some of the LCD options 
Fc9-u8-icon.png - BYTE Foreground
Range: 0-1 
Fc9-u8-icon.png - BYTE Background
Range: 0-1 
Fc9-u8-icon.png - BYTE Transparent
Range: 0-1 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDVerbose
Controls the Verbose mode. When enabled the LCD automatically displays an account of the incoming API commands and parameters. When switched off the LCD is free for the user to control as required. 
Fc9-u8-icon.png - BYTE Mode
Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadDigitalInput
Reads a single digital input. 
Fc9-u8-icon.png - BYTE Channel
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png PWMConfig
Sets the PWM configuration. Channel = 0 - 1 : 0 = EN_AB, A, B / 1 = EN_CD, C, D Period = 0 - 65535 Scaler = 0 - 3 : 0=1:1 1=1:8 2=1:64 3=1:256 
Fc9-u8-icon.png - BYTE Channel
Range 0-1 
Fc9-u16-icon.png - UINT Period
Range: 0-65535 
Fc9-u8-icon.png - BYTE Scaler
Range: 0-3 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMEnable
Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
Fc9-u8-icon.png - BYTE EnableMask
Range 0-63 or 0b00000 to 0b111111 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png PWMDuty
Sets a single PWM channel duty. Channel = 0 - 5 : 0=EN_AB, 1=A, 2=B, 3=C, 4=D, 5=EN_CD Duty = 0 - 65535 
Fc9-u8-icon.png - BYTE Channel
Range 0-5 
Fc9-u16-icon.png - UINT Duty
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDCursor
Sets the cursor position for the MIAC display 
Fc9-u8-icon.png - BYTE X
Range: 0-21 
Fc9-u8-icon.png - BYTE Y
Range: 0-4 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteTran
Allows a single transistor output to be switched on or off. 
Fc9-u8-icon.png - BYTE Channel
Range 1-4 
Fc9-u8-icon.png - BYTE Value
0 = Off, 1 = On 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png LCDClear
Clears the MIAC display 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Module Frequency
Module frequency - must be matched with the specific RF transciever being used. 
Fc9-type-14-icon.png Center Frequency (96-3903)
Specifies the default RF center frequency 
Fc9-type-15-icon.png Center Frequency (MHz)
Calculation to work out the approx actual frequency 
Fc9-type-16-icon.png Data Mode
Specifies if the module will send data packets (Byte) or FSK bits (Bit) 
Fc9-type-14-icon.png Data Buffer Size (Max)
Maximum number of bytes that can be loaded into a single data packet 
Fc9-type-16-icon.png Rate Divider 1
Data rate prescaler 1 - Coarse control 
Fc9-type-14-icon.png Rate Divider 2 (0-127)
Data rate prescaler 2 - Fine control 
Fc9-type-15-icon.png Max Throughput (Kb/s)
Calculated max data throughput if the data is 100% active 
Fc9-type-21-icon.png Data Rate Value
Actual default value passed to the data rate control 
Fc9-type-14-icon.png Sync Pattern
Default sync pattern used by the standard sync in byte data mode. 
Fc9-type-16-icon.png Extended Sync
Selects if an additional fixed sync byte is to be used. 
Fc9-type-16-icon.png 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 
Fc9-type-16-icon.png Gain
Controls the receiver gain - the amount to amplify the incoming signal before processing 
Fc9-type-16-icon.png Threshold
The signal to noise threshold used to control the sensitivity 
Fc9-type-16-icon.png Bandwidth
Controls the transmitter bandwidth, i.e. the frequency either side of the center frequency to use for the RF communications 
Fc9-type-16-icon.png Power
The amount of power to use when transmitting 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png 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.  
Fc9-type-5-icon.png FSEL Pin
RF Mode selection pin 
Fc9-conn-icon.png Simulations
Fc9-type-10-icon.png Label
Label used to help identify the component on the panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API