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.
RF Example
Downloadable macro reference
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
FSKWrite
|
Writes to the FSK (frequency shift key) data pin.
|
- BYTE
|
State
|
|
- VOID
|
Return
|
|
GetDataCount
|
Returns the number of bytes in the received data buffer.
|
- BYTE
|
Return
|
|
SendBuffer
|
Sends the contents of the transmit buffer.
|
- BYTE
|
Count
|
Specifies how many bytes to transfer from the transmit buffer
|
- VOID
|
Return
|
|
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
|
|
ActivateTXMode
|
Enables the transmitter interface, allowing data to be sent. The receiver interface is automatically disabled.
|
- VOID
|
Return
|
|
SetDataRate
|
Allows the RF data rate to be adjusted during runtime.
|
- BYTE
|
Rate
|
Specifies the new data rate
|
- VOID
|
Return
|
|
ActivateRXMode
|
Enables the receiver interface, allowing data to be received. The transmitter interface is automatically disabled.
|
- VOID
|
Return
|
|
FSKRead
|
Reads the FSK (frequency shift key) data pin.
|
- BYTE
|
Return
|
|
ReadRXSignalStrength
|
Returns the current received signal strength.
|
- BYTE
|
Return
|
|
Uninitialise
|
Powers down the RF module. The module must be re-initialised before it can be used again.
|
- VOID
|
Return
|
|
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
|
|
GetBufferData
|
Returns a value from the incoming receive data buffer.
|
- BYTE
|
Index
|
Specifies which position in the buffer to read data from
|
- BYTE
|
Return
|
|
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
|
|
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
|
|
Initialise
|
Sets up the 1-Wire output pin ready for communications.
|
- VOID
|
Return
|
|
Initialise
|
Starts up the UART to allow communications and initialises the states of the various Modbus Coils, Inputs and Registers to 0.
|
- VOID
|
Return
|
|
Initialise
|
Initialises the MIDI component and sets up the UART.
|
- VOID
|
Return
|
|
CommsBaud
|
Sets the Baud rate of the alt communications channel
|
- BYTE
|
Baud
|
Range: 0-7 : 0=1200 / 7=115200
|
- VOID
|
Return
|
|
LCDOptions
|
Controls some of the LCD options
|
- BYTE
|
Foreground
|
Range: 0-1
|
- BYTE
|
Background
|
Range: 0-1
|
- BYTE
|
Transparent
|
Range: 0-1
|
- VOID
|
Return
|
|
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.
|
- BYTE
|
Mode
|
Range: 0-1 : 0=Off or User Mode / 1=API Verbose Mode
|
- VOID
|
Return
|
|
ReadDigitalInput
|
Reads a single digital input.
|
- BYTE
|
Channel
|
|
- BYTE
|
Return
|
|
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
|
- BYTE
|
Channel
|
Range 0-1
|
- UINT
|
Period
|
Range: 0-65535
|
- BYTE
|
Scaler
|
Range: 0-3
|
- VOID
|
Return
|
|
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
|
- BYTE
|
EnableMask
|
Range 0-63 or 0b00000 to 0b111111
|
- VOID
|
Return
|
|
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
|
- BYTE
|
Channel
|
Range 0-5
|
- UINT
|
Duty
|
|
- VOID
|
Return
|
|
LCDCursor
|
Sets the cursor position for the MIAC display
|
- BYTE
|
X
|
Range: 0-21
|
- BYTE
|
Y
|
Range: 0-4
|
- VOID
|
Return
|
|
WriteTran
|
Allows a single transistor output to be switched on or off.
|
- BYTE
|
Channel
|
Range 1-4
|
- BYTE
|
Value
|
0 = Off, 1 = On
|
- VOID
|
Return
|
|
Initialise
|
|
- VOID
|
Return
|
|
LCDClear
|
Clears the MIAC display
|
- VOID
|
Return
|
|
LCDClear
|
Clears the LCD
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
Simulations
|
|
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
|
|