– –
– –
44
45
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 36.
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
Figure 36: HumPRO-A
TM
Series Write to Configuration Register Command
HumPRO-A
TM
Series Write to Configuration Register Command
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
Value
0xFF
0x03
REG
0xFE
V-0x80
Register greater than or equal to 128 (0x80) and a Value less than 128 (0x80)
Header
Size
Escape
Address
Value
0xFF
0x03
0xFE
REG-0x80
V
Register and Value greater than or equal to 128 (0x80)
Header
Size
Escape
Address
Escape
Value
0xFF
0x04
0xFE
REG-0x80
0xFE
V-0x80
Note:
The non-volatile memory has a life expectancy of at least 18,000
write operations.
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.
Содержание EVM-900-PRO
Страница 1: ...HumPRO ATM Series 900MHz RF Transceiver Module Data Guide...
Страница 60: ...114 115 Notes...