STK512 User Guide
3-1
5170C–AVR–10/09
Section 3
Programming Notes
The following describes optional programming that is not necessary to use the kit to demonstrate the roll-
ing code algorithm over an RF link. In addition to the information below, the accompanying CD contains
a “readme.html” file that documents user programming of both the receiver and transmitter.
This information is included for the advanced user who wishes to experiment with the kit and its
expanded capabilities.
3.1
Configuration
There are numerous options for the system, e.g., cryptographic key sizes, message field sizes etc. The
parameters are given as #define macros in the config.h files in both the transmitter and receiver source
code folder. The most important parameters are given in. It is important that the parameters for the trans-
mitter and receiver code are the same.
The configuration file contains several other advanced parameters. Parameter usage is explained in
comment blocks in the files themselves and should not be altered. Always keep a backup copy of the
original default configuration.
Note:
1. Serial number, command code and sequential counter value fields must not exceed 16 bytes. A compile
error will occur if the total size exceeds this limit.
Table 3-1. Basic Configuration Parameters
Parameter Name
Default
Value
Description
KEY_BITS
128
Size of the AES cipher key in bits. Allowed values are 128, 192 and 256
bits, where 256 bits is the most secure option.
SERIAL_NO_BYTES
4
Size in bytes of the message field containing a transmitter's serial
number. Allowed values are 1, 2, and 4 bytes
(1)
.
COMMAND_CODE_BYTES
1
Size in bytes of the message field containing the requested command.
Allowed values are 1, 2, and 4 bytes
(1)
.
SEQ_COUNTER_BYTES
4
Size in byte of the message field containing the sequential counter
value. Allowed values are 1, 2, and 4 bytes
(1)
.
MAC BYTES -
4
Size in bytes of the message field containing the MAC. The value must
not be larger than 16 bytes. More bytes give a more secure
authentication.
MAX_TRANSMITTERS
5
Maximum number of transmitters that one receiver can learn. This
number is limited by the amount of free EEPROM memory. A compile
error will occur of the number is chosen too large.
WINDOW SIZE -
100
The size of the rolling window of acceptance.