
Quick Start Guide for the
Turbo uPSD DK3300-ELCD Development Kit- RIDE
V 1.0 Dec. 2004
2
•When the blue line is on timer0_init(), click “Step-In”.
The debugger is now in the called function, timer0_init().
•Double click “ Disassembly Code” in the left debugger
window. This opens a display named, “code (pwm_adc)”
showing both C and Assembly code source instructions.
•Click ”Step-Over” a few times to see that code
execution can be stepped one assembly instruction at a
time.
•Click ”Reset” to return to main program, pwm_adc.c
5. Device Specific Formatted Displays
•Double-click “ Main Registers” in the left debugger
window to show the contents of the MCU core registers
(Refer to Figure -3).
•Double-click “ Port 1” in the left debugger window
to show the current value of the pins in I/O port 1.
•Go back to the file, pwm_adc.c by clicking on tab at
bottom of the main display window (Refer to Figure -8),
and expand the window view back to full screen.
6. Breakpoints
Four hardware breakpoints are available on uPSD3300.
•Set one breakpoint by clicking on the green dot on the left
of the line of code ( printfLCD(msg_buff);) . The green dot
will turn into and the line highlights in red at the line of
code as shown in Figure -8
•Click “Go”, the program will run until hitting breakpoint.
•Click “Go” repeatedly. See that the PWM and ADC
values displayed on the LCD change after each cycle. You
will see increasing values for PWM and decreasing values
for ADC each time one loop of code is executed within the
while(1) loop construct.
7. Symbolic Debugging and Variables Watch
•With the mouse, highlight the entire variable name
“ADC_result”, then right-click on it, then select “Add Watch”
to add this variable to the Watch Window which appears at
bottom left of the screen (Refer to Figure-8 and Figure-4).
•Select Kthe same way and add to the watch window.
•These variables show the current PWM and ADC values.
•Set the same Breakpoint as in step-6 above.
•Click ”Reset”.
•Click “Go” and see that the values change in the watch
window (Refer to Figure-4). and the LCD Display.
•Repeat this a couple of times. You will see that for each
loop the PWM value changes by 10.
•Click ”Reset”.
8. Code Iteration
•Make this code change in Flash memory.
•Close the Debugger by clicking on (this is same icon
that “starts” the Debugger).
•Now you are in the editor. Go to the file pwm_adc.c by
clicking on its file tab and change the following C code
statement from…
printfLCD("PWM to ADC DEMO"); to…
printfLCD("PWM - ADC DEMO");
•Click “Make All” to recompile and rebuild the program.
•Start the Debugger by clicking “Start” to re-program this
new code into the Flash memory.
•Click “Go” and see that the LCD display now shows
“PWM - ADC DEMO “
•Go back to the editor. Go to the file pwm_adc.c and
change the text back to the original:
printfLCD("PWM to ADC DEMO
•Click “Make All” to recompile and rebuild the program.
•Start the Debugger by clicking “Start” to re-program this
new code into the Flash memory.
•Click “Go” and see that the LCD display now shows
the original text “PWM to ADC DEMO
•Click “Reset”.
9. Instruction Tracing, near Real-Time Performance
The uPSD will rapidly stream a record of all the MCU
instruction steps out to the RLINK-ST adaptor. From this data,
RIDE will create a formatted file to help you find even the
most stubborn bugs, showing a history as deep as 256,000
instruction steps that the MCU has last executed!
•To enable Trace, select from the title bar “Debug” then
“Trace”, and select trace “Options” as shown in Figure -5 .
•Open the Trace Display. Select from the title bar “Debug”,
then “Trace”, then “View”. A blank Trace Display will
appear. (Refer Figure-6)
A Trace Display file can display program source code in both
C and Assembly formats. Tracing runs in the background with
little impact to real-time performance in this project.
•Go back to the file pwm_adc.c by clicking on its file tab.
•Set one breakpoint at the line of code
( printfLCD(msg_buff);) as shown in Figure -8 by clicking
on the green dot on the left of the line of code. The green
dot will turn into and the line highlights in red.
•Click “Go”, and the MCU will run until hitting the
breakpoint, then a window will open showing the Assembly
source code, as shown in Figure -9.
Note that the red line indicates where the breakpoint is set
(MCU Program Counter value 01BA), and the blue line
indicates the next instruction to execute.
•Now open the Trace Display window by clicking on the file
tab “Trace (pwm_adc)” as shown in Figure -10. At the
bottom of the Trace Display is the last instruction that was
executed (MCU Program Counter at 01BA). Above this
line is the history of all the instructions that the MCU has
executed before hitting the breakpoint.
•Examining the Trace Display window further, you’ll see the
source C and Assembly statements at each step to assist
you in finding a bug.
•Go back to the file pwm_adc.c and remove the breakpoint
by clicking on the at the left of the code line highlighted
in red.
•Click “Go” and notice that the LCD display shows
continuous changes in the PWM and ADC values as the
loop is executed multiple times while tracing is occurring in
the background.
•After about 10 seconds click. ”Stop”.
•See the messages in the window that records the actions
( Figure -7 ). This window shows the number of non-
sequential instructions traced.
Open the Trace Display window again, “Trace(pwm_adc)”. At
the bottom-left you’ll see that over 50,000 MCU instruction
steps have been recorded!