Linx HumPRC Series Data Manual page 22

Rf transceiver module
Hide thumbs Also See for HumPRC Series:
Table of Contents

Advertisement

Writing to Registers
To allow any byte value to be written, values of 128 (0x80) or greater can
be encoded into a two-byte escape sequence of the format 0xFE, [value
- 0x80]. This includes register addresses as well as values to be written to
the registers. The result is that there are four possible packet structures
because of the possible escape sequences. These are shown in Figure 29.
HumPRC
Series Write to Configuration Register Command
TM
Register and Value less than 128 (0x80)
Header
Size
Address
Value
0xFF
0x02
REG
V
Register less than 128 (0x80) and a Value greater than or equal to 128 (0x80)
Header
Size
Address
Escape
0xFF
0x03
REG
0xFE
Register greater than or equal to 128 (0x80) and a Value less than 128 (0x80)
Header
Size
Escape
Address
0xFF
0x03
0xFE
REG-0x80
Register and Value greater than or equal to 128 (0x80)
Header
Size
Escape
Address
0xFF
0x04
0xFE
REG-0x80
Figure 29: HumPRC
Series Write to Configuration Register Command
TM
Generally, there are three steps to creating the command.
1. Determine the register address and the value to be written.
2. Encode the address and value as either the number (N) or the encoded
number (0xFE, N-0x80) as appropriate.
3. Add the header (0xFF) and the size.
The module responds with an ACK (0x06). If the ACK is not received, the
command should be resent. The module responds with a NACK (0x15) if a
write is attempted to a read-only or invalid register.
As an example, to write 01 to register 0x83, send
FF 03 FE 03 01
Note:
The non-volatile memory has a life expectancy with a limited
number of refresh cycles. Please see the electrical specifications.
Value
V-0x80
Value
V
Escape
Value
0xFE
V-0x80
38
Command Length Optimization
Some commands may be shortened by applying the following rules:
1. Escape sequences are not required for byte values 0x00 to 0xEF
(besides 0xFE and 0xFF, bytes 0xF0 – 0xFD are reserved for future
use).
2. An escape byte inverts bit 7 of the following data byte.
3. The 0xFE as the first byte of the Read Register Command field is an
escape byte.
4. Two consecutive escape bytes cancel unless the following data byte
is 0xf0-0xff.
Examples:
FF 02 FE 02 (read nv:TXPWR) is equivalent to FF 01 82.
FF 03 FE FE 53 (read v:PKOPT) is equivalent to FF 01 53.
FF 03 1A FE 7F (write FF to nv:UMASK0) cannot be shortened.
FF 03 1A FE 40 (write C0 to nv:UMASK0) is equivalent to FF 02 1A
C0.
These rules are implemented in the sample code file EncodeProCmd.c,
which can be downloaded from the Linx website.
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hum-868-prcHum-868-prc-casHum-868-prc-ufl

Table of Contents