simplicititm 1 day workshop - lab guide

41
SimpliciTI TM 1 Day Workshop, Lab Guide Getting Started: What do you need? Hardware : eZ430-RF2500 Evaluation Board http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2500.html Software : 1. SimpliciTI TM 1.0.6 http://focus.ti.com/docs/toolsw/folders/print/simpliciti.html

Upload: others

Post on 16-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SimpliciTITM 1 Day Workshop - Lab Guide

SimpliciTITM 1 Day Workshop, Lab Guide

Getting Started: What do you need?

Hardware: eZ430-RF2500 Evaluation Board

http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2500.html

Software:

1. SimpliciTITM 1.0.6

http://focus.ti.com/docs/toolsw/folders/print/simpliciti.html

Page 2: SimpliciTITM 1 Day Workshop - Lab Guide

2. IAR Embedded Workbench MSP430

http://supp.iar.com/Download/SW/?item=EW430-EVAL

3. SmartRF Studio

http://focus.ti.com/docs/toolsw/folders/print/smartrftm-studio.html 4. SimpliciTI_Demo.zip

Installation Order

1. Install IAR Studio 2. Install SimplicTI 1.0.6 – Use Default Location 3. Install SmartRF Studio 4. Extract SimpliciTI_Demo.zip – Use Default Location 5. Plug in eZ430-RF2500 Board – Driver should be found. If it isn’t refer to the

device driver section further in this document.

Page 3: SimpliciTITM 1 Day Workshop - Lab Guide

Unzipping the Code Files

Here is the content of SimpliciTI_Demo.zip (Hit View Style Button for this View):

Two file folders are installed (if default C:\ location is used):

1. SimpliciTI_Template in the root C directory 2. My_Design in the SimpiciTI-1.0.9 Directory

Once the .zip file is extracted, an IAR Embedded Workspace is located in the My_Design directory, SimpliciTI_Design.eww

Page 4: SimpliciTITM 1 Day Workshop - Lab Guide

Getting Started with IAR Studio

IAR EW can be found here: Start->All Programs->IAR Systems->IAR Embedded Workbench for MSP430 V4->IAR Embedded Workbench

Page 5: SimpliciTITM 1 Day Workshop - Lab Guide

Two projects exist in this workspace. Use the pull down box shown below to change the project.

To build the project or debug the project (downloads code into the board*):

Use these Icons to control your code:

* Board needs to be attached to the FET Tool to Download Code

Page 6: SimpliciTITM 1 Day Workshop - Lab Guide

Connecting the eZ430-RF2500 Board

Plug the eZ430-RF2500 into the USB Port. The Windows new device driver

wizard appears and should find the driver. If the driver is NOT FOUND:

Select install from a specific location, add the path below into the include path.

Page 7: SimpliciTITM 1 Day Workshop - Lab Guide

eZ430-RF2500 Board Driver Locations

Two USB drivers are installed. The 1st is a Debug Chain Human Interface Device (HID):

The 2nd is a Back Channel UART Com Port:

Page 8: SimpliciTITM 1 Day Workshop - Lab Guide

To Perform a HW Reset the eZ430-RF2500

RF2500 Target Board eZ430 Debug & Download To reset the RF2500 board unplug it from the eZ430 while keeping the eZ430 board plugged into the USB port.

This will maintain the COM connection to your terminal application while still resetting the RF2500 application.

RF2500 Board features:

Chip Antenna CC2500 MSP430F2274

Red & Green LEDs Pushbutton

UART Rx UART Tx

Page 9: SimpliciTITM 1 Day Workshop - Lab Guide

Setting the Configuration File

Under the Configuration_Files Group, 3 configuration files reside. These files are used to set up the SimpliciTI stack and provide portability to new projects or port to new different SimpliciTI versions.

To instantiate the .cfg files into the C program, set the file include in the extra options tab in Project Options. To get the project options, click on the SimpliciTI_Demo-Debug and right click to give the menu below, selecting options:

Select the C/C++ compiler category, and hit the right arrow button until the Extra Options Tab appears. Adding the –f “<configuration file name>” will include that file in the build. Check the box next to Use command line options If the .cfg file and the .dat files are kept in the My_Design directory (or the same directory that your project is saved in), $PROJ_DIR$ can be used instead of the full directory path name.

Page 10: SimpliciTITM 1 Day Workshop - Lab Guide

An overview of the SimpliciTI_General Configuration.cfg

Options: /************************************************************************* Change the Address *************************************************************************/ -DI_WANT_TO_CHANGE_DEFAULT_ROM_DEVICE_ADDRESS_PSEUDO_CODE

1. Invoking this code (by taking the “//” comment off the front) will do a random address check and if no address exists, generate one. This setting will over ride any address settings in the smpl_config_XX.dat file.

//-DI_WANT_TO_CHANGE_DEFAULT_ROM_DEVICE_ADDRESS_PSEUDO_CODE 2. Remarking this code, SimpliciTI will use the address defined in the smpl_config_XX.dat file.

/************************************************************************* Enable Message Received Callback *************************************************************************/ -DCALLBACK_ENABLED

1. Invoking this code (by taking the “//” comment off the front) will instantiate a Callback ISR into the SimpliciTI Stack.

//-DCALLBACK_ENABLED 2. Remarking this code, SimpliciTI will rely on the Smpl_Receive () call to poll for messages.

/************************************************************************* Join Success Required at SimpliciTI Init *************************************************************************/ -DNETWORK_JOIN_SUCCESS_REQUIRED

1. Invoking this code (by taking the “//” comment off the front) will not allow an End Device leave the Smpl_Init () function until it receives a Join Response from an Access Point(AP). Should be utilized if the ED sleeps as the AP will set up a message Store and Forward service for the polling ED.

//-DNETWORK_JOIN_SUCCESS_REQUIRED 2. Remarking this code, SimpliciTI will use the default Link Token defined in

smpl_nwk_config.dat if a Join response does not occur from an Access Point.

/************************************************************************* Eliminate Repeated Messages *************************************************************************/ -DNO_REPEATS 1. Invoking this code (by taking the “//” comment off the front) will eliminate any repeat messages

that may be received from the network (Repeated from Range Extenders and Access Points). //-DNO_REPEATS

2. Remarking this code, All messages will be processed.

/************************************************************************* Add Frequency Agility *************************************************************************/ -DFREQUENCY_AGILITY

1. Invoking this code (by taking the “//” comment off of the front), SimpliciTI will perform the Frequency Agility functions in network devices (supported by SimpliciTI 1.0.6 or later).

//-DFREQUENCY_AGILITY

2. Remarking this code, SimpliciTI uses the frequency defined by the Smart RF Studio settings.

Page 11: SimpliciTITM 1 Day Workshop - Lab Guide

Options Continued: /************************************************************************* Select Radio *************************************************************************/ -DMRFI_CC2500

1. This code will always need to be invoked as it defines the radio. If this code is not added, SimpliciTI will give an error.

2. Options are being added for supported radios as they are released. A partial list of options are listed here.

// Defined Symbols: (one per line) - found in // Project->Options, C/C++ compiler, Preprocessor Tab // MRFI Radio Family Definitions: // Select the Radio but NOT the Family // MRFI_RADIO_FAMILY1 // Radios: CC2500, CC1100, CC1101 //-DMRFI_CC2500 //-DMRFI_CC1100 //-DMRFI_CC1101 // MRFI_RADIO_FAMILY2 // Radios: CC2510, CC2511, CC1110, CC1111 //-DMRFI_CC2510 //-DMRFI_CC2511 //-DMRFI_CC1110 //-DMRFI_CC1111 // MRFI_RADIO_FAMILY3 // Radios: CC2520 //-DMRFI_CC2520 // MRFI_RADIO_FAMILY4 // Radios: CC2430 //-DMRFI_CC2430 //-DMRFI_CC2431

Page 12: SimpliciTITM 1 Day Workshop - Lab Guide

An overview of the smpl_config_ED.dat Options:

/********************************************************************** Frames replayed only "MAX_HOPD" times maximum **********************************************************************/ -DMAX_HOPS=3 // Default Value is 4 /********************************************************************** Maximum distance from an AP. Used by poll and poll response to limit network replay traffic. Also used when joining since the EDs can't be more than 1 hop away.

**********************************************************************/ -DMAX_HOPS_FROM_AP=1 // Default Value is 1 /********************************************************************** Maximum size of application payload. Absolute maximum is based on size of Rx and Tx FIFOs (50 for CC2500/CC1100 class including SoCs and 113 for CC2430).

**********************************************************************/ -DMAX_APP_PAYLOAD=10 // Default Value is 10 /********************************************************************** Default Link token. Should be changed by APs on AP networks. Customer should modify nwk_join.c:generateLinkToken()to change the response token.

**********************************************************************/ -DDEFAULT_LINK_TOKEN=0x01020304 /********************************************************************** Default Join token. Change this to provide some access security **********************************************************************/ //-DDEFAULT_JOIN_TOKEN=0x05060708

Page 13: SimpliciTITM 1 Day Workshop - Lab Guide

An overview of the smpl_nwk_config.dat Options:

/********************************************************************** Number of connections supported. each connection supports bi-directional communication. Access Points and Range Extenders can set this to 0 if they do not host End Device objects **********************************************************************/ -DNUM_CONNECTIONS=4 // Default Value is 4 /********************************************************************** Access Point needs larger input frame queue if it is supporting store-and-forward clients because the forwarded messages are held here. Two is probably enough for an End Device **********************************************************************/ -DSIZE_INFRAME_Q=2 // Default Value is 2 /********************************************************************** The output frame queue can be small since Tx is done synchronously. Actually 1 is probably enough. If an Access Point device is also hosting an End Device that sends to a sleeping peer the output queue should be larger -- the waiting frames in this case are held here. In that case the output frame queue should be bigger.

**********************************************************************/ -DSIZE_OUTFRAME_Q=2 // Default Value is 2 /********************************************************************** This device's address. The first byte is used as a filter on the CC1100/CC2500 radios so THE FIRST BYTE MUST NOT BE either 0x00 or 0xFF. Also, for these radios on End Devices the first byte should be the least significant byte so the filtering is maximally effective. Otherwise the frame has to be processed by the MCU before it is recognized as not intended for the device. APs and REs run in promiscuous mode so the filtering is not done. This macro intializes a static const array of unsigned characters of length NET_ADDR_SIZE (found in nwk_types.h). the quotes (") are necessary below unless

the spaces are removed. **********************************************************************/ -DTHIS_DEVICE_ADDRESS="{0x78, 0x56, 0x34, 0x12}" // Default Value is 0x78, 0x56, 0x34, 0x12 /*********************************************************************/ /* *** End Device Type Definitions *** */ /*********************************************************************/ -DEND_DEVICE /********************************************************************** For polling End Devices we need to specify that they do so. Uncomment the macro definition below if this is a polling device. This field is used by the Access Point to know whether to reserve store-and-forward support for the polling End Device during the Join exchange.

**********************************************************************/ //-DRX_POLLS

Page 14: SimpliciTITM 1 Day Workshop - Lab Guide

An overview of the smpl_nwk_config.dat Options:

/********************************************************************** Number of connections supported. each connection supports bi-directional communication. Access Points and Range Extenders can set this to 0 if they do not host End Device objects **********************************************************************/ -DNUM_CONNECTIONS=4 // Default Value is 4 /********************************************************************** Access Point needs larger input frame queue if it is supporting store-and-forward clients because the forwarded messages are held here. Two is probably enough for an End Device **********************************************************************/ -DSIZE_INFRAME_Q=2 // Default Value is 2 /********************************************************************** The output frame queue can be small since Tx is done synchronously. Actually 1 is probably enough. If an Access Point device is also hosting an End Device that sends to a sleeping peer the output queue should be larger -- the waiting frames in this case are held here. In that case the output frame queue should be bigger.

**********************************************************************/ -DSIZE_OUTFRAME_Q=2 // Default Value is 2 /********************************************************************** This device's address. The first byte is used as a filter on the CC1100/CC2500 radios so THE FIRST BYTE MUST NOT BE either 0x00 or 0xFF. Also, for these radios on End Devices the first byte should be the least significant byte so the filtering is maximally effective. Otherwise the frame has to be processed by the MCU before it is recognized as not intended for the device. APs and REs run in promiscuous mode so the filtering is not done. This macro intializes a static const array of unsigned characters of length NET_ADDR_SIZE (found in nwk_types.h). the quotes (") are necessary below unless

the spaces are removed. **********************************************************************/ -DTHIS_DEVICE_ADDRESS="{0x78, 0x56, 0x34, 0x12}" // Default Value is 0x78, 0x56, 0x34, 0x12 /*********************************************************************/ /* *** Access Point Device Type Definitions *** */ /*********************************************************************/ -DACCESS_POINT /********************************************************************** Store and forward support: number of clients **********************************************************************/ -DNUM_STORE_AND_FWD_CLIENTS=3 // Default Value is 3 /********************************************************************** In the spcial case in which the AP is a data hub, the AP will automaically listen for a link each time a new device joins the network. this is a special case scenario in which all End Device peers are the AP and every ED links to the AP. in this scenario the ED must automatically try and link after the join reply.

**********************************************************************/ //-DAP_IS_DATA_HUB

Page 15: SimpliciTITM 1 Day Workshop - Lab Guide

Lab 1: End Device to End Device Introduction: This lab shows simple End Device to End Device communication. 1. Make sure the SimpliciTI_Demo – Debug project is selected:

2. Under the SimpliciTI_Demo – Debug Project, Open

SimpliciTI_General_Configuration.cfg and set the options accordingly:

//-DI_WANT_TO_CHANGE_DEFAULT_ROM_DEVICE_ADDRESS_PSEUDO_CODE //-DCALLBACK_ENABLED //-DNETWORK_JOIN_SUCCESS_REQUIRED //-DNO_REPEATS //-DFREQUENCY_AGILITY -DMRFI_CC2500

Page 16: SimpliciTITM 1 Day Workshop - Lab Guide

3. Open the smpl_config_ED.dat file and set the options accordingly:

-DNUM_CONNECTIONS=4 // Default Value is 4 -DSIZE_INFRAME_Q=2 // Default Value is 2 -DSIZE_OUTFRAME_Q=2 // Default Value is 2 -DTHIS_DEVICE_ADDRESS="{0x78, 0x56, 0x34, 0x12}" -DEND_DEVICE //-DRX_POLLS 4. Open the smpl_nwk_config.dat file and set the options accordingly:

-DMAX_HOPS=3 // Default Value is 4 -DMAX_HOPS_FROM_AP=1 // Default Value is 1 -DMAX_APP_PAYLOAD=10 // Default Value is 10 -DDEFAULT_LINK_TOKEN=0x01020304 -DDEFAULT_JOIN_TOKEN=0x05060708

Page 17: SimpliciTITM 1 Day Workshop - Lab Guide

5. Build and Download the code:

6. Stop Debugging:

Page 18: SimpliciTITM 1 Day Workshop - Lab Guide

7. Remove the Programmed RF2500 Board from the eZ430:

8. Put the Programmed RF2500 Board onto the Battery Board:

9. Put the un-programmed RF2500 Board onto the eZ430:

Page 19: SimpliciTITM 1 Day Workshop - Lab Guide

10. Build and Download the code into the un-programmed board:

11. Start HyperTerminal: Start->All Programs->Accessories->Communication->HyperTerminal

Page 20: SimpliciTITM 1 Day Workshop - Lab Guide

12. Set the Com Port to the MSP430 Application UART, and press OK

13. Set the Com Port to 9600 Baud, 8N1:

Page 21: SimpliciTITM 1 Day Workshop - Lab Guide

14. Run the Code:

The HyperTerminal Screen should show:

Page 22: SimpliciTITM 1 Day Workshop - Lab Guide

15. Press and Release the Button on the RF2500 Board connected to the USB:

Link Listen Appears on HyperTerminal, this ED is in Link Listen Mode:

16. Press and Hold the Button on the RF2500 Board connected to the Battery:

Page 23: SimpliciTITM 1 Day Workshop - Lab Guide

17. No connection occurs. Why? The Addresses Match:

18. In SimpliciTI_General_Configurations.cfg, delete the “//” in front of -DI_WANT_TO_CHANGE_DEFAULT_ROM_DEVICE_ADDRESS_PSEUDO_CODE then ReBuild and Download into the eZ430-RF2500 Board

Page 24: SimpliciTITM 1 Day Workshop - Lab Guide

19. Run the code:

Address Change shows up on HyperTerminal:

Page 25: SimpliciTITM 1 Day Workshop - Lab Guide

20. Reset the Battery board by pulling the jumper and replacing it:

21. Press and Release the button on the eZ430-RF2500:

22. Press and Hold the button on the RF2500 Battery Board:

23. Link now Occurs:

Page 26: SimpliciTITM 1 Day Workshop - Lab Guide

24. The LinkTo Port is Green and the LinkListen Port LED is red

25. Transmit Messages by typing the message number in hyperTerminal will

transmit the messages. The RF2500 connected to the Battery will display in binary the message number received on the LEDs.

26. Bad Parameter shows up on the eZ430-RF2500 screen. Why?

C or c: Refreshes the screen 1: Sends Message 1 2: Sends Message 2 3: Sends Message 3 4: Sends Message 4

?: SMPL_BAD_PARAM: No valid Connection Table entry for Link ID; Data in Connection Table entry bad; No message or message too long.

Page 27: SimpliciTITM 1 Day Workshop - Lab Guide

27. Open SimpliciTI_Main.c, Messages are highlighted (line 104). How many characters?:

28. Open smpl_nwk_config.dat, note the Max_App_Payload number:

29. Change: -DMAX_APP_PAYLOAD=20 // Default Value is 10 30. Rebuild both boards and execute the eZ430-RF2500 Board:

Page 28: SimpliciTITM 1 Day Workshop - Lab Guide

Successful Transmission and Receive on HyperTerminal

Binary 4 (Green and Red LED lit) showing 4th message received on the RF2500 Battery Board

Page 29: SimpliciTITM 1 Day Workshop - Lab Guide

Lab 2: End Device to End Device

1. Open smartrf_CC2500.h to show the radio settings:

2. Open SmartRF Studio:

Start->All Programs->Texas Instruments->Smart RF Studio->Smart RF Studio

Page 30: SimpliciTITM 1 Day Workshop - Lab Guide

3. Select a Preferred Setting to start with:

4. Set your base frequency and Channel Bandwidth:

Page 31: SimpliciTITM 1 Day Workshop - Lab Guide

5. And set your target channel:

6. Export your Code:

Page 32: SimpliciTITM 1 Day Workshop - Lab Guide

7. Select the SimpliciTI Settings Template

8. Add View Summary Information:

Page 33: SimpliciTITM 1 Day Workshop - Lab Guide

9. Over write the SimpliciTI settings in your code:

10. Overwrite the previous file:

Was the Radio File updated?

11. Rebuild both End Devices. The functionality of Lab 1 should occur but with less interference from your neighbor.

Page 34: SimpliciTITM 1 Day Workshop - Lab Guide

Lab 3: Adding an Access Point

In this exercise, you will need a 2nd eZ430-RF2500 1. Select the SimpliciTI_Access_Point – Debug Project and open the

smpl_config_AP.dat file:

2. Edit smpl_config_AP.dat: -DNUM_CONNECTIONS=4 // Default Value is 4 -DSIZE_INFRAME_Q=2 // Default Value is 2 -DSIZE_OUTFRAME_Q=2 // Default Value is 2 -DTHIS_DEVICE_ADDRESS="{0x78, 0x56, 0x34, 0x12}" -DACCESS_POINT -DNUM_STORE_AND_FWD_CLIENTS=3 // Default Value is 3 //-DAP_IS_DATA_HUB

3. Build and Download the Code into the Access Point RF2500, then release the debug so the board can be removed.

Page 35: SimpliciTITM 1 Day Workshop - Lab Guide

4. Place the RF2500 Board with the Access Point code onto a battery board.

Access Point (Press Button to Deny Join Access) Green LED – Join Accepted, Red LED – Join Denied

LinkTo End Device & LinkListen End Device (Green LED signals successful Join)

Join Requested acknowledged:

Page 36: SimpliciTITM 1 Day Workshop - Lab Guide

5. End Device to End Device communication should be the same as in Lab 1. Except:

6. Eliminating the duplicates in the End Devices. Change Project to SimpliciTI_Demo – Debug. Edit SimpliciTI_General_Configuration.cfg, removing “//” in front of the –DNO_REPEATS

Why Duplicates? AP’s are also

Range Extenders

Page 37: SimpliciTITM 1 Day Workshop - Lab Guide

7. Rebuild both End Devices, downloading them into the RF2500 Boards

Repeats are eliminated!

Page 38: SimpliciTITM 1 Day Workshop - Lab Guide

Lab 4: Adding Power Modes

1. Make sure the SimpliciTI_Demo – Debug Project is selected. Modify

smpl_config_ED.dat removing “//” in front of –DRX_POLLS and SimpliciTI_General_Configuration.cfg removing “//” in front of –DNETWORK_JOIN_SUCCESS_REQUIRED:

2. Rebuild the eZ430-RF2500 and download the code, then Go:

Message Delivery is delayed (once a second) but still continues.

3. Pull Power from the Access Point and then try to send a message:

Delivery Stops, as the Store and Forward Server is no longer available.

Page 39: SimpliciTITM 1 Day Workshop - Lab Guide

Lab 5: Frequency Agility

1. Select SimpliciTI_Access_Point - Debug Project and modify the file SimpliciTI_General_Configurations.cfg removing the “//”

-DFREQUENCY_AGILITY

2. Rebuild, download, and Release the RF2500 Access Point, placing it on a Battery Board.

3. Select SimpliciTI_Demo, modify the file smpl_config_ED.cfg, remark out the line –DRX_POLLS, and rebuild, download into both End Devices.

Page 40: SimpliciTITM 1 Day Workshop - Lab Guide

Message Delivery Successful:

4. Press button on the Access Point to Change the Channel:

Channel Change and Message Delivery Successful

Page 41: SimpliciTITM 1 Day Workshop - Lab Guide

Lab 6: Receive Callback Function 1. Select the SimpiciTI_Demo – Debug Project and modify the

SimpliciTI_General_Configuration.cfg by removing the “//” in front of –DCALLBACK_ENABLED

2. Rebuild, Download, and Go:

SimpliciTI Code results the same as Lab 5: