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

From Flowcode Help
Jump to navigationJump to search
(XML import)
Line 1: Line 1:
 +
 +
 
{| width="50%"
 
{| width="50%"
 
|-
 
|-
Line 5: Line 7:
 
|-
 
|-
 
| width="20%" style="color: gray;" | Version
 
| width="20%" style="color: gray;" | Version
| 1.1
+
| 1.1 (Release)
 
|-
 
|-
 
| width="20%" style="color: gray;" | Category
 
| width="20%" style="color: gray;" | Category
Line 22: Line 24:
  
 
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.
 
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.
 
 
{{Fcfile|RF_Test.fcfx|RF Example}}
 
{{Fcfile|RF_Test.fcfx|RF Example}}
  
Line 450: Line 451:
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Channel''.
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Channel''.
  
''<span style="color:red;">No additional information</span>''
+
SPI peripheral used to talk to the RF module.
 
 
 
 
  
 
<span style="font-weight: normal;"><u>FSEL Pin</u></span>
 
<span style="font-weight: normal;"><u>FSEL Pin</u></span>
Line 458: Line 457:
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''fsel_pin''.
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''fsel_pin''.
  
''<span style="color:red;">No additional information</span>''
+
RF Mode selection pin
 
 
 
 
  
 
<span style="font-weight: normal;"><u>MOSI Pin</u></span>
 
<span style="font-weight: normal;"><u>MOSI Pin</u></span>
Line 466: Line 463:
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''mosi_pin''.
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''mosi_pin''.
  
''<span style="color:red;">No additional information</span>''
+
SPI Data Out pin - Master Out Slave In
 
 
 
 
  
 
<span style="font-weight: normal;"><u>MISO Pin</u></span>
 
<span style="font-weight: normal;"><u>MISO Pin</u></span>
Line 474: Line 469:
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''miso_pin''.
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''miso_pin''.
  
''<span style="color:red;">No additional information</span>''
+
SPI Data In pin - Master In Slave Out
 
 
 
 
  
 
<span style="font-weight: normal;"><u>SCK Pin</u></span>
 
<span style="font-weight: normal;"><u>SCK Pin</u></span>
Line 482: Line 475:
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''sck_pin''.
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''sck_pin''.
  
''<span style="color:red;">No additional information</span>''
+
Serial clock pin
 
 
 
 
  
 
<span style="font-weight: normal;"><u>CS Pin</u></span>
 
<span style="font-weight: normal;"><u>CS Pin</u></span>
Line 490: Line 481:
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cs_pin''.
 
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cs_pin''.
  
''<span style="color:red;">No additional information</span>''
+
Chip select pin
 
 
 
 
  
 
<span style="font-weight: normal;"><u>Label</u></span>
 
<span style="font-weight: normal;"><u>Label</u></span>
Line 498: Line 487:
 
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
 
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
  
''<span style="color:red;">No additional information</span>''
+
Label used to help identify the component on the panel.

Revision as of 11:25, 13 February 2015


Author Matrix Ltd.
Version 1.1 (Release)
Category Wireless


Image 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.

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

SetSyncPattern

Allows the sync pattern to be modified during runtime to allow for switching between several different RF connections.

Parameters

BYTE Mode
Switches on or off the extended sync functionality
BYTE Pattern
The bit pattern used for the standard sync mode


Return value

This call does not return a value


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.

Parameters

BYTE Timeout
Specifies how many milliseconds to wait for valid data before returning.


Return value

BYTE


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.

Parameters

STRING Data


Return value

This call does not return a value


TXTune

Used to specify and adjust the RF transmitter properties during runtime.

Parameters

BYTE Deviation
Specifies the transmit FSK frequency deviation - Range 0 - 15
BYTE Power
Specifies the transmitter power - Range 0 - 7


Return value

This call does not return a value


RXTune

Used to specify and adjust the RF receiver properties during runtime.

Parameters

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


Return value

This call does not return a value


SetBufferData

Allows a value to be loaded into the transmit buffer,

Parameters

BYTE Index
The current location in the transmit buffer starting from 0
BYTE Data
The data value to pass


Return value

This call does not return a value


UpdateCenterFrequency

Allows the RF center frequency to be adjusted during runtime to allow multiple RF channels to be scanned or multiplexed.

Parameters

UINT Frequency
Specifies the new center frequency value - Range 96 - 3903


Return value

This call does not return a value


FSKWrite

Writes to the FSK (frequency shift key) data pin.

Parameters

BYTE State


Return value

This call does not return a value


GetDataCount

Returns the number of bytes in the received data buffer.

Parameters

This macro has no parameters


Return value

BYTE


SendBuffer

Sends the contents of the transmit buffer.

Parameters

BYTE Count
Specifies how many bytes to transfer from the transmit buffer


Return value

This call does not return a value


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.

Parameters

BYTE Data


Return value

This call does not return a value


ActivateTXMode

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


SetDataRate

Allows the RF data rate to be adjusted during runtime.

Parameters

BYTE Rate
Specifies the new data rate


Return value

This call does not return a value


ActivateRXMode

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


FSKRead

Reads the FSK (frequency shift key) data pin.

Parameters

This macro has no parameters


Return value

BYTE


ReadRXSignalStrength

Returns the current received signal strength.

Parameters

This macro has no parameters


Return value

BYTE


Uninitialise

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


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.

Parameters

BYTE Timeout
Time to wait before returning no data available


Return value

BYTE


GetBufferData

Returns a value from the incoming receive data buffer.

Parameters

BYTE Index
Specifies which position in the buffer to read data from


Return value

BYTE


ReceiveString

Puts the RF module in data mode and attempts to receive a string of bytes from the RF connection.

Parameters

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.


Return value

STRING


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.

Parameters

This macro has no parameters


Return value

UINT


Simulation macro reference

This component does not contain any simulation macros


Property reference

Module Frequency

This property is of type Fixed list of ints and can be referenced with the variable name module_freq.

Module frequency - must be matched with the specific RF transciever being used.

Center Frequency (96-3903)

This property is of type Signed integer and can be referenced with the variable name cent_freq.

Specifies the default RF center frequency

Center Frequency (MHz)

This property is of type Floating point and can be referenced with the variable name cent_freq_cal.

Calculation to work out the approx actual frequency

Data Mode

This property is of type Fixed list of ints and can be referenced with the variable name data_mode.

Specifies if the module will send data packets (Byte) or FSK bits (Bit)

Data Buffer Size (Max)

This property is of type Signed integer and can be referenced with the variable name buffer_size.

Maximum number of bytes that can be loaded into a single data packet

Rate Divider 1

This property is of type Fixed list of ints and can be referenced with the variable name data_div1.

Data rate prescaler 1 - Coarse control

Rate Divider 2 (0-127)

This property is of type Signed integer and can be referenced with the variable name data_div2.

Data rate prescaler 2 - Fine control

Max Throughput (Kb/s)

This property is of type Floating point and can be referenced with the variable name baud_rate.

Calculated max data throughput if the data is 100% active

Data Rate Value

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

Sync Pattern

This property is of type Signed integer and can be referenced with the variable name sync_pattern.

Default sync pattern used by the standard sync in byte data mode.

Extended Sync

This property is of type Fixed list of ints and can be referenced with the variable name extended_sync.

Selects if an additional fixed sync byte is to be used.

Bandwidth

This property is of type Fixed list of ints and can be referenced with the variable name rx_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

This property is of type Fixed list of ints and can be referenced with the variable name rx_gain.

Controls the receiver gain - the amount to amplify the incoming signal before processing

Threshold

This property is of type Fixed list of ints and can be referenced with the variable name rx_threshold.

The signal to noise threshold used to control the sensitivity

Bandwidth

This property is of type Fixed list of ints and can be referenced with the variable name tx_bandwidth.

Controls the transmitter bandwidth, i.e. the frequency either side of the center frequency to use for the RF communications

Power

This property is of type Fixed list of ints and can be referenced with the variable name tx_power.

The amount of power to use when transmitting

SPI Channel

This property is of type Fixed list of ints and can be referenced with the variable name Channel.

SPI peripheral used to talk to the RF module.

FSEL Pin

This property is of type Single digital pin and can be referenced with the variable name fsel_pin.

RF Mode selection pin

MOSI Pin

This property is of type Single digital pin and can be referenced with the variable name mosi_pin.

SPI Data Out pin - Master Out Slave In

MISO Pin

This property is of type Single digital pin and can be referenced with the variable name miso_pin.

SPI Data In pin - Master In Slave Out

SCK Pin

This property is of type Single digital pin and can be referenced with the variable name sck_pin.

Serial clock pin

CS Pin

This property is of type Single digital pin and can be referenced with the variable name cs_pin.

Chip select pin

Label

This property is of type Line of text and can be referenced with the variable name label.

Label used to help identify the component on the panel.