Silicon Laboratories F321DC Скачать руководство пользователя страница 12

ToolStick-F321DC

12

Rev. 0.1

6.8.  Using ToolStick Terminal

This section describes how to use ToolStick Terminal to communicate with UART from the PC to the daughter card
through the ToolStick Base Adapter.
1. If the Silicon Laboratories IDE is open, close the IDE. The IDE and the ToolStick Terminal cannot communicate 

with the daughter card simultaneously.

2. Open ToolStick Terminal from the 

Start 

 Programs 

 Silicon Laboratories

 menu.

3. Go to the 

ToolStick 

→ 

Settings

 menu.

4. Under “Pin Settings”, change GPIO0 / RTS to “

GPIO Output - Push Pull

” and click “OK.” The rest of the default 

settings are correct for the C8051F321 Features Demo.

5. In the top, left-hand corner of the Terminal application, available devices are shown in the drop-down 

Connection menu. Click “

Connect

” to connect to the device. In the “

Receive Data

” window, text indicating the 

blink rate of the LED will appear.

6. Turn the potentiometer on the daughter card and see that the blink rate is updated on the daughter card and the 

new blink rate is printed to the Terminal.

In addition to the standard two UART pins (TX and RX), there are two GPIO/UART handshaking pins on the
ToolStick Base Adapter that are connected to two port pins on the target microcontroller. ToolStick Terminal is used
to configure and read/write these pins. For the 

F321DC_FeaturesDemo

, one of these GPIO pins is connected to

an external interrupt pin on the C8051F321. The following steps describe how to change the level of one of the
GPIO pins and trigger an interrupt on the target microcontroller. The interrupt forces the firmware to switch modes
and send a pulse-width modulated (PWM) signal to the LED instead of blinking the LED using an on-chip Timer.
1. In ToolStick Terminal, under Pin State Configuration, select “

Set GPIO0 Logic Low

” and click on “

Set Selected 

Pin States

.” This changes the level of the GPIO0 pin from 

Logic High

 to 

Logic Low

 and triggers a level-

sensitive interrupt on the microcontroller.

2. In the Receive window, see that the printed text has changed to indicate the LED PWM duty cycle. 
3. Turn the potentiometer on the daughter card to change the brightness of the LED on the daughter card.
4. Change the GPIO0 pin state back to 

Logic High

 and notice that the firmware switches back to blinking the 

LED.

The firmware on the C8051F321 target microcontroller does not need to be customized to use the UART and
communicate with ToolStick Terminal. The firmware on the microcontroller should write to the UART as it would in
any standard application and all of the translation is handled by the ToolStick Base Adapter.

Содержание F321DC

Страница 1: ...s 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 ToolStick Base Adapter from the PC by holding the edges of the boards Figure 1 Proper Method of Holding the ToolStick Avoid directly touching any of the other components Figure 2 Improper Method of Holding the Too...

Страница 2: ... The ToolStick Base Adapter provides a USB debug interface and data communications path between a Windows PC and a target microcontroller The C8051F321 Daughter Card includes a pair of LEDs a potentiometer a micro USB connector a switch connected to a GPIO and a small prototyping area which provides access to all of the pins of the device This prototyping area can be used to connect additional har...

Страница 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 Drivers are available as separate downloads After downloading and installing these packages see the following sections for information 5 Software Overview 5 1 Silicon Laboratories IDE The Silicon Labo...

Страница 4: ...ave 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 the use of dialog boxes for each of the device s peripherals Figure 4 Configuration Wizard 2 Utility The Configuration Wizard 2 utility helps accelerate development by automatically generating initializat...

Страница 5: ... documentation The documentation and software are available from the Downloads webpage www silabs com mcudownloads 5 5 ToolStick Terminal The ToolStick Terminal program provides the standard terminal interface to the target microcontroller s UART However instead of requiring the usual RS 232 and COM port connection ToolStick Terminal uses the USB interface of the ToolStick Base Adapter to provide ...

Страница 6: ...e IDE to connect and download the firmware view and modify registers use watch windows use breakpoints and single step through code The second part of the demo shows how to use ToolStick Terminal to receive UART data from the daughter card and how to use the GPIO pins 6 1 Hardware Setup Connect the ToolStick hardware to the PC using the steps below while taking note of the recommendations in Secti...

Страница 7: ... ToolStick is properly inserted in a USB port and start again with step 6 6 3 Running and Stopping Code Execution Once the IDE is connected to the device and the firmware is loaded the IDE can start and stop the code execution The following steps can be performed using the buttons on the toolbar or using the options in the Debug menu 1 To start code execution click the green Go button on the toolb...

Страница 8: ...m 0x82 to 0x02 This value turns off the ADC on the target microcontroller 3 To write this new value to the device select Refresh from the Debug Menu or click the Refresh button in the toolbar 4 Click Go to resume running the device with the new ADC0CN value 5 Turn the potentiometer on the daughter card and notice that it has no effect on the blinking rate of the LED 6 Re enable the ADC by writing ...

Страница 9: ... 3 Scroll to the ADC0_ISR function and right click on the variable Num_LED_Flashes In the context menu that appears select Add Num_LED_Flashes to Watch and then choose Default On the right hand portion of the IDE the watch window appears and the variable is added The current value of the variable is shown to the right of the name 4 Start and stop the device a few times See that the value of the Nu...

Страница 10: ...lashes variable 1 If the device is running stop execution using the Stop button or use the Debug Stop menu option 2 Scroll to the ADC0_ISR function and right click on the variable Num_LED_Flashes In the context menu that appears select Insert Remove Breakpoint On the left side of the line in the editor window a red circle is added to indicate a breakpoint is placed on the source line 3 Click the G...

Страница 11: ...ct View Debug Windows Disassembly The disassembly window will appear on the right hand side of the IDE if it is not already open 4 To execute one assembly instruction at a time click the Step button on the toolbar or select the Debug Step menu option The highlighted line in the disassembly window indicates the next instruction to be executed The blue line marker in the editor window will stay on t...

Страница 12: ...ins on the target microcontroller ToolStick Terminal is used to configure and read write these pins For the F321DC_FeaturesDemo one of these GPIO pins is connected to an external interrupt pin on the C8051F321 The following steps describe how to change the level of one of the GPIO pins and trigger an interrupt on the target microcontroller The interrupt forces the firmware to switch modes and send...

Страница 13: ... or handshaking pins could affect signaling P0 4 P0 5 These pins are connected directly to the ToolStick Base Adapter for UART communication P1 7 This pin is connected to the output of the potentiometer R5 a 0 Ω resistor can be removed to disconnect the potentiometer from the pin P2 0 This pin is connected to the S1 switch The switch can be removed to disconnect it from the pin P2 2 This pin is co...

Страница 14: ...ToolStick F321DC 14 Rev 0 1 10 C8051F321 Daughter Card Schematic Figure 6 C8051F321 Daughter Card Schematic ...

Страница 15: ...ToolStick F321DC Rev 0 1 15 NOTES ...

Страница 16: ...ity 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 spe...

Отзывы: