Programming examples, Aw900mspi user’s manual – AvaLAN Wireless AW900mSPI-10 User Manual

Page 26

Advertising
background image

AW900mSPI

User’s Manual

PAGE 26

Technical support (650) 384-0000

www.avalanwireless.com

CHK0 to 15 is the 16-bit integer checksum value for the block. It is calculated in the

host microcontroller as follows:

1. Initialize a 16-bit register to 0x1911.
2. Add the 16-bit data value to the register beginning with the firmware block

number.

3. Perform a rotate left with no carry by 5 bit positions.
4. Repeat steps 2 and 3 for all 34 words (OFS and DATA).

Once all blocks have been submitted to the XC1220, then the host microcontroller

must issue the

setFirmwareEnd (0x8C) command. Once the setFirmwareEnd com-

mand has been issued to the XC1220, the host microcontroller must wait for the

programming to complete. The XC1220 will indicate this by deasserting the Data

Ready line (pin 9). Once the Data Ready line is deasserted, programming is com-

plete and it is safe to reset the XC1220 with the

setReset command (0x85). A reset

is required before the XC1220 will begin executing the new firmware image.

Programming Examples

Note that these examples apply to SPI mode.

Initialization Example

To initialize the XC1220 follow these steps:

1. At startup delay for 300 ms to allow the XC1220 enough time to initialize.
2. Assert /CS_BB (drive the line low) and issue

setNetworkKey (0x82) com-

mand and delay for 4 µs.

3. Send 3 bytes with 24-bit Network Key value.
4. Deassert /CS_BB (drive the line high) and delay for 6 µs.
5. Assert /CS_BB and issue

setPrivateKey (0x83) command and delay for 4 µs.

6. Send 16 bytes with 128-bit Private Key value.
7. Deassert /CS_BB and delay for 6 µs.
8. Assert /CS_BB and issue

setDeviceID (0x84) command and delay for 4 µs.

9. Send one byte indicating what type of device and ID number.
10. Deassert /CS_BB and delay for 6 µs.
11. Assert /CS_BB and issue

setStatus (0x81) command and delay for 4 µs.

12. Send one byte with bit 6 set to take radio out of standby mode.

Advertising
This manual is related to the following products: