University of LeicesterPLUMERef: PLM-COMS-DataInter-117-2
Date: 07/08/2009
COMS Data Interface Document
P. Peterson
Date / Updated Reference Number / change? / PLM-COMS-DataInter-117-1 / first version issued
07/08/2009 / PLM-COMS-DataInter-117-2 / TXPSUEN should not be grounded.
System Information:
A total of 8 connections perform all electronic and software interface on the LRT Transceiver and PIC modem complex. These are:
RADRXD Outputs serial data
RADTXD Serial data input
RSSI VoltageReceived signal strength indicator
RAD+Transmitter power supply
+5V5 Volt Supply
TXPSUEN10 Volt Supply
0VGround
TXP[1]Transmitted power
We will be using all of these apart from TXPSUEN. This should be disconnected. The 5V supply and 0V are self explanatory, but 0V does need to be a common ground with the MCU input. RAD+ needs to be at 5V for the LRT 470 that we are using.
Electronic Interface:
Communication through RADRXD and RADTXD operates at 9600baud, and each serial character consists of: a start bit, 8 data bits, a 9th bit used to differentiate between commands and data, and a stop bit. Definitions of commands below will omit the start and stop bits. Communications are half duplex and a handshake is returned after every command or data byte received. Commands are sent through RADTXD, output is received on RADRXD.
Command Syntax:
Example:
SendXMPL = c,000b,000a = hex value where appropriate
where a = 1st bit, b = 3rd bit, c = 9th bit
This is to be input at RADTXD
ReturnsRTNXMPL = n,nnnn,nnnn
where n0 to n8 may have varying values and follow the order given above i.e. right to left.
This is the expected output at RADRXD
Basic Commands:
Wake and Sleep:
SendWAKE = 1,1111,1111 = 111
(The system will wake to any RADTXD input)
ReturnsWAKAK = 1,0000,0010 = 102
SendSLEEP = 1,1000,0000
The system is now asleep
Receive:
When awake and when TXP = 0 then any incoming data will return:
DATA = 0,dddd,dddd = 0dd
Where d's represent the data bits.
Transmit:
SendTXSTT = 1,101a,aaaa
where when a4 = 0 , [a0,a3] = 5ms * [0 to 16]
when a4 = 1, [a0,a3] = 80ms * [0 to 16]
Time given is the delay before transmit dataaccepted.
This is to allow:
Raise TXP from 0V to 5V to give a proportional output power.
ReturnsLast received data character then
ACK = 1,0000,0000 = 100
SYSTEM IS NOW IN TRANSMIT MODE
Send0,dddd,dddd = any data
Modulates and transmits data
ReturnsACK
Sendmore data
ReturnsACK
SendTXEND = 1,0010,0000 = 120
Ends transmit mode
TXP should now be dropped to 0V
Returns ACK
SYSTEM IS NOW IN RECEIVE MODE
Housekeeping:
Enquire:
SendENQ = 1,010a,aaaa
When [a0,a4] = 0,0000
ReturnRQD = 1,0000,0001
Then
Data = 0,bbbb,bbbb
b0 = 1 = channel busy
b1 = 1 = data carrier detected
b2 = 1 = transmitter on
b3 = 1 = test mode on
b4 = 1 = synchroniser out of lock
b5 = 1 = rx buffer overflow
b6 = 1 = tx buffer overflow
b7 = 1 = power on reset status[2]
When [a0,a4] = 0,0001
Return8bit identifier of radio.
When [a0,a4] = 0,0010
ReturnCode version in radio.[3]
Test:
SendTEST = 1,011n,nnnn
where n corresponds to the test number to be run from 1 to 4.
The system will switch into a test mode:
1 = Transmit continuous zero tone.
2 = Transmit continuous one tone.
3 = Transmit continuous carrier.
4 = Transmit 50Hz square wave.
SendTEST, n = 0
The system will return to normal operation.
ReturnACK
Configuration:
To set the transmission and reception frequencies, baud rate and modulation modes, it is necessary to set 6 parameters. These must be input in the order specified below and as a single operation. Misconfiguration will result in an error[4] and requires the entire operation to be carried out again.
Parameters:
TX Divider + Offset = TX Freq (Hz) / 6250
e.g. for 435MHz, Tx Div + Offset = 6960010 = 10FE016
RX Divider + Offset = RX Freq + I.F. Freq(Hz) / 6250
(I.F. = Intermediate Frequency[5])
The Dividers are inputted as two 8bit characters, *XPLL0 and *XPLL1. In the example above, the Tx Divider cannot be separated into two 8bit characters. We use the Offset, which is chosen to allow lower values to be input as the Tx/Rx PLL 0/1. The offset is an 8bit number, which is then multiplied by 256 [in hex, 01 becomes 0100].
For our example, in hex:10FE0 – 4000 = CFE0. So the input values would be:
TXPLL0 = 0CF = 0,1100,1111
TXPLL1 = 0E0 = 0,1110,0000
OFFSET = 040 = 0,0100,0000
Config:
SendCFG0 = 1,0000,0000
ReturnACK
SendTXPLL0 = 0,aaaa,aaaa
ReturnACK
SendCFG1 = 1,0000,0001
ReturnACK
SendTXPLL1 = 0,aaaa,aaaa
ReturnACK
SendCFG2 = 1,0000,0010
ReturnACK
SendRXPLL0 = 0,aaaa,aaaa
ReturnACK
SendCFG3 = 1,0000,0011
ReturnACK
SendRXPLL1 = 0,aaaa,aaaa
ReturnACK
SendCFG4 = 1,0000,0100
ReturnACK
SendOFFSET = 0,aaaa,aaaa
ReturnACK
SendCFG5 = 1,0000,0101
ReturnACK
SendFFBAUD = 0,bbbb,bbbb
Where b0 = 1 = 1200 baud
b1 = 1 = 600
b2 = 1 = 300
b3 = 1 = 600
b7 = 1 = 2400[6]
ReturnACK
SendCFG6 = 1,0000,0110
ReturnACK
SendFFMODE = 0,cccc,cccc
Sets FSK Format.
Where c4 = 1 = 7bit
= 0 = 8bit
c5 = 1 = parity on
= 0 = parity off
c6 = 1 = odd parity
= 0 = even parity
c7 = 1 = 2 stop bits
= 0 = 1 stop bit[7]
ReturnACK
The configuration is now complete.
Errors:
Bits 4 to 7 of the data returned from an inquiry represent the device being in an error state. Bit 7 specifically implies that either the system has just reset due to power or watchdog timer. This state will also be flagged after an incomplete configuration.
The WAKAK character should only be seen after waking the device. If output at any other time, this indicates an error.
Error diagnosis and handling procedures need to be a focus of any future test plan.
Appendix:
IF Frequencies = 45MHz , 455KHz from LRT Manual.
Page 1 of 10
[1]TXP is the connection from Pin 6 of the transceiver.
[2] b4 to b7 represent errors, these will be discussed in more detail below.
[3]The radio identifier and code version are not described further in the manual. I am unsure of the format.
[4] Discussed below.
[5]Values for IF are given in LRT manual. I am unsure which to use, and of what sign. Listed below.
[6]These are given for the M1 modem, all functions are apparently identical to the M2, except obviously these baud rates are incorrect. This will need testing.
[7]These are also given for the M1 modem, there may be different options for GMSK settings.