background image

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.

Содержание STK512

Страница 1: ...ional Radio Starter Kit Featuring Secure Rolling Code RF Transmission Encryption User Guide Note This Radio Starter Kit is not self contained It is based on an Atmel AVR STK 500 Flash Microcontroller Starter Kit that must be obtained separately ...

Страница 2: ... Getting Started 2 1 2 1 Hardware Assembly 2 1 2 2 Initial Programming 2 6 2 2 1 Programming the ATmega88 to Control the Receiver 2 6 2 2 2 Programming the Transmitter s 2 7 2 3 Teach the Transmitters to the Receiver 2 8 2 4 The Demonstration 2 9 Section 3 Programming Notes 3 1 3 1 Configuration 3 1 3 2 Project Compilation 3 2 3 3 EEPROM Image Generation 3 2 Section 4 Troubleshooting Guide 4 1 ...

Страница 3: ...2 General Description This kit demonstrates the transmission protocol with one receiver and a pair of associated transmitters However a typical system can support many more transmitters Characteristics of this protocol are A transmission encryption value that is valid only once preventing interception and re transmission to gain unauthorized access Message content that is virtually impossible to p...

Страница 4: ...r Kit that must be obtained separately This starter kit includes all the essential components needed to demonstrate an AVR based uni direc tional radio that features a Secure Rolling Code RF Transmission Encryption protocol Contents of this kit are listed and shown in Figure 1 1 Transmitter application board ISP programming adapter for Transmitter Receiver application board with external antenna S...

Страница 5: ...ting further capabilities of this kit the following are optional JTAGICE mkII for debugging IAR Embedded Workbench AVR C compiler for changing and recompiling the source code without porting it to another compiler precompiled source code with default configuration is provided on the CDROM ...

Страница 6: ...ts teaching the transmitters to the receiver and demonstrating the transmission protocol are described in the following subsections 2 1 Hardware Assembly The kit hardware must be interfaced to the STK500 Step A Assemble the STK500 Board The STK500 Board must be set up properly before mounting the STK512 Interface Board The assem bled STK500 Board is shown in Figure 2 1 Figure 2 1 STK500 Board with...

Страница 7: ...g a 6 pin jumper cable supplied with the STK500 connect the two male headers ISP6PIN and SPROG2 4 Using a 10 pin jumper cable supplied with the STK500 connect the two male headers PORTC and LEDS 5 Using a 10 pin jumper cable supplied with the STK500 connect the two male headers PORTD and SWITCHES 6 Place jumpers on the following headers as shown in Figure 2 2 VTARGET AREF RESET XTAL1 OSCEL a 3 pin...

Страница 8: ...ets use caution if a tool is used for leverage It is easy to bend pins or otherwise damage the STK500 and or the interface board Use a rocking motion while steadily pulling not prying it straight from the sockets 2 Insert the STK512 Interface Board into the EXPANDx sockets oriented with the LEDs and red DIP switches to the left hand side To verify the orientation check that the EXPAND0 pins on the...

Страница 9: ...Getting Started 2 4 STK512 User Guide 5170C AVR 10 09 Figure 2 4 STK512 Jumper Placement ...

Страница 10: ... board is removed from the interface board sockets use EXTREME caution The pins on the receiver board are very easily bent and broken Use a rocking motion to lift the board straight perpendicular out of the socket 1 Orient the receiver board above the Interface Board as shown in Figure 2 5 Carefully insert the Receiver Application Board into the STK512 Interface Board sockets 2 Install the antenna...

Страница 11: ...g properly If the read attempt is successful a number will show in the window If not a pop up will appear describing the failure Consult the STK500 documentation to handle any failures 3 Select the Fuses tab and ensure that the Fuses are set as shown in Table 2 1 4 From the CD in the folder software IAR RX Release Exe program the flash of the ATMega88 with RX_fffMHz a90 Note fff is 315 434 868 or ...

Страница 12: ... the window If not a pop up will appear describing the failure Consult the STK500 documentation to handle any failures 4 Select the fuses tab and ensure that the Fuses are set as shown in Table 2 2 5 From the CD in the folder software IAR TX Release Exe program the flash of the ATtiny45 with TX a90 6 From the CD in the folder software Precompiled program the EEPROM of the Tiny45 with TX_EEPROM_AES...

Страница 13: ...tigation into this mode Familiarize yourself with the following instructions before beginning the teaching process Also keep your transmitter key fobs readily available The default timeout to teach a transmitter is 10 seconds before the receiver will exit the learn mode 1 Enter learn mode on the receiver by pressing the SW5 button on the STK500 The LED marked LED5 illuminates indicating that the r...

Страница 14: ...ion feature a situation must be created to cause a transmitter key fob s counter to become out of sequence with the receiver s respective counter With the source code provided the window of acceptance defaults to a value of 100 That is the transmitter key fob must increment its counter 100 times above the count the receiver remembers for that transmitter key fob This can be done by moving the tran...

Страница 15: ... 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 th...

Страница 16: ...numbers and secret and shared keys for the system components Then use the supplied command line tools to generate one HEX file for every unit The secret key for the transmitters should be discarded after generating the HEX file They are not needed and could compromise system security if they get into the wrong hands Make sure that all transmitters that will be associated with a receiver have the s...

Страница 17: ...rd VTG jumper Corresponding DIP Switch bit s not set Set the corresponding bit s to ON on the DIP Switch for that register Bias resistor s damaged Replace the corresponding bias resistor s on the back of the STK512 Interface Board with 1 k Incorrect firmware loaded into the STK512 Interface Board where I O port of the onboard microcontroller programmed to logic high Reload the STK512 Interface Boa...

Страница 18: ... STK500 Verify the orientation of both sides of the ribbon cable Power not supplied to transmitter on board microcontroller Supply 3 volts to the transmitter microcontroller through the coin cell battery or via the STK500 Wrong device selected in the STK500 software Select ATtinyl3 from the Device menu Verify that the signature We matches in the Advanced tab Power and serial cable not connected to...

Страница 19: ...OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTY OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NON INFRINGEMENT IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT INDIRECT CONSEQUENTIAL PUNITIVE SPECIAL OR INCIDEN TAL DAMAGES INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF PROFITS BUSINESS INTERRUPTION OR LOSS OF INFORMATION ARISING OUT OF TH...

Страница 20: ...Mouser Electronics Authorized Distributor Click to View Pricing Inventory Delivery Lifecycle Information Atmel ATASTK512 EK1 AUT ...

Отзывы: