Lab 6: Analog-to-Digital Converter
TMS320F2837xD Microcontroller Workshop - Analog Subsystem 6 - 33
Window Preferences…
and in the section on the left select the “Code Composer Studio” category. Click the plus
sign (+) to the left of “Code Composer Studio” and select “Debug”. In the section on the
right notice the default setting:
• “Continuous refresh interval (milliseconds)” = 500
Click OK.
Note: Decreasing the “Continuous refresh interval” causes all enabled continuous refresh
windows to refresh at a faster rate. This can be problematic when a large number of
windows are enabled, as bandwidth over the emulation link is limited. Updating too many
windows can cause the refresh frequency to bog down. In this case you can just
selectively enable continuous refresh for the individual windows of interest.
17. Next we need to enable the graph window for continuous refresh. Select the “Single
Time” graph. In the graph window toolbar, left-click on the yellow icon with the arrows
rotating in a circle over a pause sign. Note when you hover your mouse over the icon, it
will show “Enable Continuous Refresh”. This will allow the graph to continuously refresh
in real-time while the program is running.
18. Enable the Memory Browser for continuous refresh using the same procedure as the
previous step.
19. Code Composer Studio includes Scripts that are functions which automate entering and
exiting real-time mode. Four functions are available:
• Run_Realtime_with_Reset (reset CPU, enter real-time mode, run CPU)
• Run_Realtime_with_Restart (restart CPU, enter real-time mode, run CPU)
• Full_Halt (exit real-time mode, halt CPU)
• Full_Halt_with_Reset (exit real-time mode, halt CPU, reset CPU)
These Script functions are executed by clicking:
Scripts Realtime Emulation Control Function
In the remaining lab exercises we will be using the first and third above Script functions to
run and halt the code in real-time mode. Alternatively, the CPU Reset, Real-time mode,
Resume, and Suspend buttons on the Code Composer Studio tool bar can be used.
20. Run the code and watch the windows update in real-time mode. Click:
Scripts Realtime Emulation Control Run_Realtime_with_Reset
21. Carefully remove and replace the jumper wire from GPIO18 (header J1, pin #4). Are the
values updating in the Memory Browser and Single Time graph as expected?
22. Fully halt the CPU in real-time mode. Click:
Scripts Realtime Emulation Control Full_Halt
23. So far, we have seen data flowing from the MCU to the debugger in realtime. In this
step, we will flow data from the debugger to the MCU.
• Open and inspect Main_6.c. Notice that the global variable DEBUG_TOGGLE is
used to control the toggling of the GPIO18 pin. This is the pin being read with the
ADC.