background image

To o l St i c k - C a p To u c h S e n s e D C

8

Rev. 0.3

7.  ToolStick CapTouchSense Daughter Card Example Code

The ToolStick kit includes two code examples. One of them is titled 

CapTouchSenseDC_SwitchSensitivity

. This

example can be used by a new user to learn the features and capabilities of the IDE and the microcontroller’s on-
chip debug capabilities. A ToolStick Base Adapter is required to be able to download code to the daughter card and
perform debugging.

7.1.  Hardware Setup

Connect the ToolStick hardware to the PC using the steps below while taking note of the recommendations in
Section 1:

1. Connect the ToolStick Base Adapter to the ToolStick CapTouchSense Daughter Card.

2. If available, connect the USB extension cable to the ToolStick Base Adapter.

3. Set the Power Select Switch (S1) to select ToolStick Power (TS PWR).

4. Connect the ToolStick to a USB port on a PC.

See Figure 5 for an example hardware setup using the C8051F330 ToolStick Daughter Card.

7.2.  Connecting to the Device and Downloading Firmware

This section describes how to open the IDE, open and build a project, connect to a device and download the
firmware.

1. Open the Silicon Laboratories IDE from the 

Start 

 Programs 

 Silicon Laboratories

 menu.

2. In the IDE, go to 

Project 

 Open Project

.

3.

Browse to the default installation location

 C:\SiLabs\MCU\ToolStick\CapTouchSenseDC\Firmware\.

4. Select 

CapTouchSenseDC_SwitchSensitivity.wsp

 and click OK.

5. In the IDE, select 

Project 

 Rebuild Project

.

6. Go to 

Options 

 Connection Options

.

7. Select “

USB Debug Adapter

” for the Serial Adapter and “

C2

” for the Debug Interface, and then click “OK”. If 

you have other Silicon Labs debug adapters connected to the PC, ensure that the correct ToolStick is selected 
in the drop-down box.

8. Go to 

Debug 

 Connect

.

9. Erase code space using the 

Tools 

 Erase Code Space

 command to remove configuration constants stored 

by the memory game in non-volatile Flash. It is not required when re-downloading the same software project.

10.Download the code using the 

download button

 on the menu bar or use alt-D.

Once these steps are completed, the firmware is built into an object file (step 5) and downloaded to the device
(step 9). The device is now ready to begin executing code. If all of these steps were followed successfully, the “Go”
option is enabled in the Debug menu. A green circle icon in the IDE toolbar also indicates that the device is ready
to run. If one of the steps leads to an error, make sure that the ToolStick is properly inserted in a USB port and start
again with step 6.

Summary of Contents for ToolStick-CapTouchSenseDC

Page 1: ...commendations when using the ToolStick Never connect or disconnect a daughter card to or from the ToolStick Base Adapter while the Base Adapter is connected to a PC Always connect and disconnect the T...

Page 2: ...Some daughter cards such as the CapTouchSense Daughter Card are used to demonstrate a specific feature or application and some are used as general purpose development platforms for the target microcon...

Page 3: ...package includes example code documentation including user s guides and data sheets and the ToolStick Terminal application The IDE Keil Demonstration Tools Configuration Wizard 2 and the Keil Vision D...

Page 4: ...nd have the programs start at code address 0x0000 5 3 Configuration Wizard 2 The Configuration Wizard 2 is a code generation tool for all of the Silicon Laboratories devices Code is generated through...

Page 5: ...ion please refer to the Vision driver documentation The documentation and software are available from the Downloads webpage www silabs com mcudownloads 5 5 ToolStick Terminal The ToolStick Terminal pr...

Page 6: ...ry into the battery holder BAT1 ensuring that the terminal is on the top side as marked on the battery holder 2 Set the Power Select Switch S1 to select Battery Power BAT PWR The yellow power source i...

Page 7: ...and green LEDs blinking alternately If you press a switch in the wrong sequence an error will be indicated by the red LED blinking four times The game will then restart at the same level and you will...

Page 8: ...DE from the Start Programs Silicon Laboratories menu 2 In the IDE go to Project Open Project 3 Browse to the default installation location C SiLabs MCU ToolStick CapTouchSenseDC Firmware 4 Select CapT...

Page 9: ...hSenseDC_SwitchSensitivity example includes code that allows the configuration of the capacitive touch sense switches This code is executed the first time firmware is run or when the code constants ar...

Page 10: ...ll light up to indicate that the calibration is complete and the game is ready to be played 8 Additional Demo Examples In addition to the CapTouchSenseDC_SwitchSensitivity example firmware the ToolSti...

Page 11: ...connect the LED from the pin P1 1 This pin is connected to the cathode of the green LED on the daughter card The LED or R24 resistor can be removed to disconnect the LED from the pin P1 5 This pin is...

Page 12: ...le switches to be operated using one comparator 11 Information Locations Example source code is installed by default in the C SiLabs MCU ToolStick CapTouchSenseDC Firmware directory during the ToolSti...

Page 13: ...X7R L1 680nH R3 330 D2 1 8V YELLOW R4 1k2 R5 1k2 D3 1 8V YELLOW D4 1 8V RED R6 1K R7 1K S2 R10 1K TP3 TP6 TP7 TP8 TP9 TP10 TP11 TP12 TP13 TP14 TP15 TP16 TP17 TP18 TP19 TP20 TP21 1 GND DC 2 GND 3 VDD D...

Page 14: ...ndescribed features or parameters Silicon Laboratories reserves the right to make changes without further notice Silicon Laboratories makes no warranty rep resentation or guarantee regarding the suita...

Reviews: