User`s guide

FreeStar Pro SMAC Programmers’ Guide
Rev B 0006-00-08-02-000 Page 2 of 34
TableofContents
1
OVERVIEW ....................................................................................... 4
1.1 DESCRIPTION ............................................................................................ 4
1.2 REFERENCED DOCUMENTS .................................................................... 4
2 CODE DEVELOPMENT IN IAR WORKBENCH® ............................ 5
2.1 TOOLS ......................................................................................................... 5
2.1.1 IAR Embedded Workbench® for ARM ............................................................. 5
2.1.2 J-Link .................................................................................................................. 6
2.2 PROJECT OVERVIEW ................................................................................ 6
2.2.1 File Location on the CD .................................................................................... 6
2.2.2 Changes to BeeKit Generated Files ................................................................ 6
2.3 APPLICATION FILES ................................................................................ 10
2.3.1 Source Files ..................................................................................................... 10
2.3.2 Utility files ........................................................................................................ 10
2.4 PLM AND SMAC SOURCE FILES ............................................................. 11
2.5 DEBUG/RELEASE WORKSPACE MODE ................................................ 11
2.6 GENERATING AN OUTPUT FILE ............................................................. 12
2.7 J-LINK SPEED .......................................................................................... 13
2.7.1 Change the J-Link speed by following steps: .............................................. 13
2.8 OPTIMIZATIONS ....................................................................................... 13
2.9 MAIN IAR FEATURES ............................................................................... 14
2.9.1 Building a Project ............................................................................................ 14
2.9.2 Downloading into Flash: ................................................................................. 14
3 SMAC DEVELOPMENT WITH SAMPLE APPLICATION .............. 15
3.1 CODE DEVELOPMENT ............................................................................ 15
3.2 STATE DIAGRAMS ................................................................................... 16
3.2.1 Main State Diagram ......................................................................................... 16
3.2.2 AppInit State Diagram ..................................................................................... 17
3.2.3 Pseudo Random Binary Sequence (PRBS) State Diagram ......................... 18
3.2.4 Continuous Receive State Diagram ............................................................... 19
3.2.5 Transmit Range Message State Diagram ...................................................... 20
3.2.6 Receive Range Message State Diagram ....................................................... 21
3.2.7 PERT Transmit Message State Diagram ....................................................... 22
3.2.8 PERT Receive Message State Diagram ......................................................... 23
3.2.9 Hibernate using 2kHz Oscillator State Diagram ........................................... 24
3.2.10 Hibernate using 32kHz Oscillator State Diagram ......................................... 25
3.2.11 Doze using 24MHz Reference Oscillator State Diagram .............................. 26
3.2.12 Enable Buck Regulator State ......................................................................... 27
3.2.13 Save to NVM State Diagram ........................................................................... 28
3.2.14 NVM Read State Diagram ............................................................................... 29
3.2.15 UART Receive State Diagram ......................................................................... 30
3.2.16 Reading ADC’s State Diagram ....................................................................... 31
3.3 TRANSMITTING AN RF MESSAGE .......................................................... 32
3.3.1 More information ............................................................................................. 32
3.4 RECEIVING AN RF MESSAGE ................................................................. 32
3.4.1 More information ............................................................................................. 32
3.5 CHANGING OR QUERYING THE RF CHANNEL ...................................... 33
3.5.1 More information ............................................................................................. 33
3.6 CHANGING THE RF POWER .................................................................... 33
3.6.1 More information ............................................................................................. 33