background image

C P 2 4 0 0 / 1 - D K

10

Rev. 0.1

5.  Using the Keil Software 8051 Tools with the Silicon Laboratories IDE

To perform source-level debugging with the IDE, configure the Keil 8051 tools to generate an absolute object file in
the OMF-51 format with object extensions and debug records enabled. Build the OMF-51 absolute object file by
calling the Keil 8051 tools at the command line (e.g., batch file or make file) or by using the project manager built
into the IDE. The default configuration when using the Silicon Laboratories IDE project manager enables object
extension and debug record generation. Refer to "AN104: Integrating Keil 8051 Tools into the Silicon Labs IDE" in
the “

Silabs\MCU\Documentation\ApplicationNotes

” directory on the CD-ROM for additional information on using the

Keil 8051 tools with the Silicon Laboratories IDE. 

To build an absolute object file using the Silicon Laboratories IDE project manager, you must first create a project.
A project consists of a set of files, IDE configuration, debug views, and a target build configuration (list of files and
tool configurations used as input to the assembler, compiler, and linker when building an output object file).

The following sections illustrate the steps necessary to manually create a project with one or more source files,
build a program, and download it to the target in preparation for debugging. (The IDE will automatically create a
single-file project using the currently open and active source file if you select Build/Make Project before a project is
defined.) 

5.1.  Creating a New Project

1. Select Project

New Project to open a new project and reset all configuration settings to default.

2. Select File

New File to open an editor window. Create your source file(s) and save the file(s) with a 

recognized extension, such as .c, .h, or .asm, to enable color syntax highlighting.

3. Right-click on “New Project” in the Project Window. Select Add files to project. Select files in the file browser 

and click Open. Continue adding files until all project files have been added.

4. For each of the files in the Project Window that you want assembled, compiled and linked into the target build, 

right-click on the file name and select Add file to build. Each file will be assembled or compiled as appropriate 
(based on file extension) and linked into the build of the absolute object file.

5. If a project contains a large number of files, the “Group” feature of the IDE can be used to organize. Right-click 

on “New Project” in the Project Window. Select Add Groups to project. Add pre-defined groups or add 
customized groups. Right-click on the group name and choose Add file to group. Select files to be added. 
Continue adding files until all project files have been added.

5.2.  Building and Downloading the Program for Debugging

1. Once all source files have been added to the target build, build the project by clicking on the Build/Make Project 

button in the toolbar or selecting Project

Build/Make Project from the menu.

Note:

 After the project has been built the first time, the Build/Make Project command will only build the files that 

have been changed since the previous build. To rebuild all files and project dependencies, click on the Rebuild 
All button in the toolbar or select Project

Rebuild All from the menu.

2. Before connecting to the target device, several connection options may need to be set. Open the Connection 

Options window by selecting Options

Connection Options... in the IDE menu. First, select the appropriate 

adapter in the “Serial Adapter” section. Next, the correct “Debug Interface” must be selected. C8051F93x-
C8051F92x family devices use the Silicon Labs 2-wire (C2) debug interface. Once all the selections are made, 
click the OK button to close the window. 

3. Click the Connect button in the toolbar or select Debug

Connect from the menu to connect to the device. 

4. Download the project to the target by clicking the Download Code button in the toolbar.

Note:

 To enable automatic downloading if the program build is successful select Enable automatic connect/

download after build in the Project

Target Build Configuration dialog. If errors occur during the build process, 

the IDE will not attempt the download.

5. Save the project when finished with the debug session to preserve the current target build configuration, editor 

settings and the location of all open debug views. To save the project, select Project

Save Project As... from 

the menu. Create a new name for the project and click on Save.

Downloaded from 

Elcodis.com

 

electronic components distributor

 

Summary of Contents for CP2400-DK

Page 1: ...over 4 kB RAM 8051 based C8051F930 MCU The C8051F930 MCU is part of the low power family and can operate with a supply voltage from 0 9 to 3 6 V The MCU LCD interface provided by the AB board consists of the CP2400 1 LCD controller and an LCD and is compatible with the C8051F930 DK and C8051F912 DK The LCD development kit includes example code which uses either the SPI interface CP2400 DK or SMBus...

Page 2: ... includes the following Silicon Laboratories Integrated Development Environment IDE Keil 8051 development tools macro assembler linker evaluation C compiler Source code examples and register definition files Documentation CP2400 and CP2401 Development Kit User s Guide this document AC to DC power adapter USB Debug Adapter USB to debug interface 2 USB cables 2 AAA batteries Figure 2 C8051F930 Targe...

Page 3: ...OM into your PC s CD ROM drive An installer will automatically launch allowing you to install the IDE software or read documentation by clicking buttons on the Installation Panel If the installer does not automatically start when you insert the CD ROM run autorun exe found in the root directory of the CD ROM Refer to the ReleaseNotes txt file on the CD ROM for the latest information regarding know...

Page 4: ...aboratories IDE integrates a source code editor a source level debugger and an in system Flash programmer See Section 5 Using the Keil Software 8051 Tools with the Silicon Laboratories IDE on page 10 for detailed information on how to use the IDE The Keil Evaluation Toolset includes a compiler linker and assembler and easily integrates into the IDE The use of third party compilers and assemblers i...

Page 5: ...atically generating initialization source code to configure and enable the on chip resources needed by most design projects In just a few steps the wizard creates complete startup code for a specific Silicon Laboratories MCU The program is configurable to provide the output in C or assembly language For more information refer to the Configuration Wizard documentation Documentation and software is ...

Page 6: ... battery profiles for common battery types such as AAA AA A76 Button Cell and CR2032 coin cell The discharge profile is application specific and describes the supply current requirements of the system under various supply voltages and battery configurations The discharge profile is independent of the selected power source Several read only discharge profiles for common applications are included in...

Page 7: ...y current The V2 and V1 voltages at the top of the two columns specify the voltages at which the current measurements were taken The Battery Life Estimator creates a linear approximation based on the input data and is able to feed the simulation engine with an approximate supply current demand for every input voltage The minimum system operating voltage input field allows the system operating time...

Page 8: ...lude estimated battery capacity average current self discharge current and the ability to export graph data to a comma delimited text file for plotting in an external graphing application 3 7 Keil µVision2 and µVision3 Silicon Laboratories Drivers As an alternative to the Silicon Laboratories IDE the µVision debug driver allows the Keil µVision2 and µVision3 IDEs to communicate with Silicon Labora...

Page 9: ...ecting the cable when the devices have power can damage the device and or the USB Debug Adapter Figure 8 CP2400 1 LCD Development Board Attachment Figure 9 Hardware Setup Using a USB Debug Adapter P1 CP2400 U1 J5 J1 D2 D1 J2 IMEASURE J5J4 LED PWR SILICON LABS www silabs com CP2400 GQ LCD DEVELOPMENT BOARD P0 2 P0 3 J3 J4 J2 P3 CP 2103 U3 P2 DEBUG J9 RESET J17 IMEASURE H2 SILICON LABS www silabs co...

Page 10: ...e file name and select Add file to build Each file will be assembled or compiled as appropriate based on file extension and linked into the build of the absolute object file 5 If a project contains a large number of files the Group feature of the IDE can be used to organize Right click on New Project in the Project Window Select Add Groups to project Add pre defined groups or add customized groups...

Page 11: ...configuration and usage of the touch sensitive contactless switches located on P2 0 and P2 1 Refer to the source file for step by step instructions to build and test this example This is installed in the following directory by default Silabs MCU Examples C8051F93x_92x CapTouchSense_Switch 6 4 LCD Examples The example source files in the project CP240x_LCD_Example show how to initialize the C8051F9...

Page 12: ...measured can be selected by modifying the CHANNEL_SELECT definition in app_config h The available selections are VDD and the potentiometer POT To measure VDD change the corresponding EXAMPLE definition in app_config h The VDD voltage will now be displayed on the LCD To measure the potentiometer voltage change the corresponding EXAMPLE definition in app_config h and place shorting blocks on J16 and...

Page 13: ...ace J10 J11 Selects the power supply source Wall Power AAA Battery or Coin Cell J12 Connects Port I O to UART0 interface J13 Connects external VREF capacitor to the P0 0 VREF J14 Connects the PCB ground plane to P0 1 AGND J15 Connects negative potentiometer R14 terminal to pin P1 4 or to GND J16 Connects the potentiometer R14 wiper to P0 6 CNVSTR J17 Creates an open in the power supply path to all...

Page 14: ... mode BT2 Battery Holder for 1 5 V AAA Use for two cell mode only BT3 Battery Holder for 3 V Coin Cell CR2032 BT4 Battery Holder for 1 5 V Button Cell A76 or 357 Figure 11 Bottom of C8051F930 Target Board NEG POS NEG POS BT4 BT2 BT1 BT3 CR2032 A76 or 357 AAA AAA Note BT2 is only used in two cell mode Downloaded from Elcodis com electronic components distributor ...

Page 15: ...ing Blocks Factory Defaults P0 2 P0 3 Pin 1 Pin 2 J3 J4 J2 P3 CP 2103 U3 P2 DEBUG J9 USB POWER RESET P1 6 P1 5 POWER OFF BEFORE SW4 SWITCHING MODE 2 CELL 1 CELL J17 IMEASURE H2 SILICON LABS www silabs com H1 Pin 1 J6 VDD DC J5 J7 J13 F930 U1 J14 J11 J10 VBAT WALL_PWR AAA_BAT COIN_CELL TOUCH SENSE SWITCH P2 0 TOUCH SENSE SWITCH P2 1 P1 4 J15 GND J16 R15 J12 J8 3VD 1VD VBAT J1 SW5 ON OFF P1 SW2 SW3 ...

Page 16: ...oard If SW4 is configured to select two cell mode the VBAT supply net on the target board is powered directly from the 3 VD net If SW4 is configured to select one cell mode the VBAT supply net is powered directly from the 1 VD This power supply net takes 3 VD and passes it through a 1 65 V LDO The LDO s output voltage is variable and can be set by changing the value of resistor R32 7 2 2 AAA Batte...

Page 17: ... I O on the C8051F930 is provided through the headers J2 J3 and J4 The header J6 provides access to the ground plane for easy clipping of oscilloscope probes 7 5 Switches and LEDs Three push button switches are provided on the target board Switch SW1 is connected to the reset pin of the C8051F930 Pressing SW1 puts the device into its hardware reset state Switches SW2 and SW3 are connected to the C...

Page 18: ...ly Net J5 Red LED VBAT VBAT Supply Net J1 Red LED USB Power USB VBUS none Red LED 1 VD Power 1 VD Regulator Output none Red LED 3 VD Power 3 VD Regulator Output none Potentiometer R15 P0 6 P1 4 J15 J16 Table 2 P1 Pin Descriptions Row A Pin Description Row B Pin Description Row C Pin Description 1 3 VD 1 GND 1 nc 2 nc 2 nc 2 nc 3 nc 3 nc 3 nc 4 nc 4 nc 4 nc 5 nc 5 nc 5 nc 6 nc 6 nc 6 nc 7 nc 7 nc 7...

Page 19: ...ks on header J12 The shorting block positions for connecting each of these signals to the CP2103 are listed in Table 4 To use this interface the USB to UART device drivers should be installed as described in Section 3 2 CP210x USB to UART VCP Driver Installation on page 3 19 nc 19 nc 19 P2 3 A11 20 P2 2 A10 20 P2 1 A9 20 P2 0 A8 21 WR 21 RD 21 P0 2H 22 P2 3 A11 22 P2 2 A10 22 P2 1 A9 23 P2 0 A8 23...

Page 20: ...ge Reference is optional since F93x F92x devices have an on chip High Speed Voltage Reference The shorting block J14 allows P0 1 AGND to be connected to ground This provides a noise free ground reference to the analog to digital Converter The use of this dedicated analog ground is optional 7 12 C2 Pin Sharing On the C8051F930 the debug pins C2CK and C2D are shared with the pins RST and P2 7 respec...

Page 21: ...Liquid Crystal Display LCD U1 CP2400 1 LCD Controller J1 CP2400 1 Port I O headers provide access to Port I O pins on CP2400 1 J2 Creates an open in the power supply path to allow supply current measurement J3 Provides an easily accessible ground clip J4 Connects the LED signal from the C8051F9xx Target Board to the LED on the CP2400 1 Development Board J5 Enable Disable CP2400 1 Power LED D1 LED ...

Page 22: ...orting blocks on many headers Figure 14 shows the positions of the factory default shorting blocks Figure 14 CP2400 AB LCD Development Board Shorting Blocks Factory Defaults P1 CP2400 U1 J5 J1 D2 D1 J2 IMEASURE J5J4 LED PWR SILICON LABS www silabs com CP2400 GQ LCD DEVELOPMENT BOARD Downloaded from Elcodis com electronic components distributor ...

Page 23: ...ted to on the target board Headers are provided on the AB board to allow for the LEDs to be physically disconnected from the circuit Placing a jumper on the header J4 will connect the PWR LED to ground which will allow it to turn on when a voltage is applied on the CP2400 1 s VDD pin Placing a jumper on the header J5 will connect LED labeled LED to the LED signal on the attached Target Board Table...

Page 24: ...nc 3 nc 3 nc 3 nc 4 nc 4 nc 4 nc 5 nc 5 nc 5 nc 6 nc 6 nc 6 nc 7 nc 7 nc 7 nc 8 nc 8 nc 8 nc 9 nc 9 nc 9 nc 10 nc 10 nc 10 nc 11 nc 11 nc 11 nc 12 nc 12 INT_H 12 RST_H 13 LED_H 13 nc 13 nc 14 CLK_H 14 NSS_H PWR_H 14 MOSI_H 15 MISO_H SCL_H 15 SCK_H SDA_H 15 nc 16 nc 16 nc 16 nc 17 nc 17 nc 17 nc 18 nc 18 nc 18 nc 19 nc 19 nc 19 nc 20 nc 20 nc 20 nc 21 nc 21 nc 21 nc 22 nc 22 nc 22 nc 23 nc 23 nc 23...

Page 25: ...CP2400 1 DK Rev 0 1 25 9 Schematics Figure 15 CP2400 LCD Development Board Schematic Page 1 of 2 Downloaded from Elcodis com electronic components distributor ...

Page 26: ...CP2400 1 DK 26 Rev 0 1 Figure 16 CP2400 LCD Development Board Schematic Page 2 of 2 Downloaded from Elcodis com electronic components distributor ...

Page 27: ...CP2400 1 DK Rev 0 1 27 Figure 17 CP2401 LCD Development Board Schematic Page 1 of 2 Downloaded from Elcodis com electronic components distributor ...

Page 28: ...CP2400 1 DK 28 Rev 0 1 Figure 18 CP2401 LCD Development Board Schematic Page 2 of 2 Downloaded from Elcodis com electronic components distributor ...

Page 29: ...CP2400 1 DK Rev 0 1 29 Figure 19 C8051F930 Target Board Schematic Page 1 of 3 Downloaded from Elcodis com electronic components distributor ...

Page 30: ...CP2400 1 DK 30 Rev 0 1 Figure 20 C8051F930 Target Board Schematic Page 2 of 3 Downloaded from Elcodis com electronic components distributor ...

Page 31: ...CP2400 1 DK Rev 0 1 31 Figure 21 C8051F930 Target Board Schematic Page 3 of 3 Downloaded from Elcodis com electronic components distributor ...

Page 32: ... for the functioning of undescribed 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 suitability of its products for any particular purpose nor does Silicon Laboratories assume any liability arising out of the application or use of any product or circuit and specif...

Reviews: