Lab 6: Analog-to-Digital Converter
6 - 24 C2000 Microcontroller Workshop - Analog-to-Digital Converter
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.
18. 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.
19. Enable the Memory Browser for continuous refresh using the same procedure as the
previous step.
20. 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.
21. Run the code and watch the windows update in real-time mode. Click:
Scripts Realtime Emulation Control Run_Realtime_with_Reset
22. Carefully remove and replace the connector wire from GPIO18. Are the values updating
in the Memory Browser and Single Time graph as expected?
23. Fully halt the CPU in real-time mode. Click:
Scripts Realtime Emulation Control Full_Halt
24. 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.
• Highlight DEBUG_TOGGLE with the mouse, right click and select “Add Watch
Expression…” and then select OK. The global variable DEBUG_TOGGLE should
now be in the “Expressions” window with a value of “1”.
• Enable the “Expressions” window for continuous refresh