Lab 6: Analog-to-Digital Converter
17. Recall that the program toggled the IOPA1 pin at a 50 kHz rate. Therefore, a complete
cycle (toggle high, then toggle low) occurs at half this rate, or 25 kHz. We therefore
expect the period of the waveform to be 40
µ
s. Confirm this by measuring the period of
the saw-tooth wave using the graph (you may want to enlarge the graph window using
the mouse). The measurement is best done with the mouse. The lower left-hand corner
of the graph window will display the X and Y axis values. Subtract the X-axis values
taken over a complete waveform period.
Using Real-time Emulation
Real-time emulation is a special emulation feature that offers two valuable capabilities:
1. Windows within Code Composer Studio can be updated at up to a 10 Hz rate
while the
DSP is running
. This not only allows graphs and watch windows to update, but also
allows the user to change values in watch or memory windows, and have those
changes affect the DSP behavior. This is very useful when tuning control law
parameters on-the-fly, for example.
2. It allows the user to halt the DSP and step through foreground tasks, while specified
interrupts continue to get serviced in the background. This is useful when debugging
portions of a realtime system (e.g., serial port receive code) while keeping critical
parts of your system operating (e.g., commutation and current loops in motor control).
We will only be utilizing capability #1 above during the workshop. Capability #2 is a
particularly advanced feature, and will not be covered in the workshop.
18. Reset the DSP, and enable real-time mode by selecting:
Debug Real-time Mode
19. A message box will appear. Select
YES
to enable debug events. This will set bit 1
(DGBM bit) of status register 1 (ST1) to a “0”. The DGBM is the debug enable mask bit.
When the DGBM bit is set to “0”, memory and register values can be passed to the host
processor for updating the debugger windows.
20. The memory and graph windows displaying
AdcBuf
should still be open. The connector
wire between ADCINA0 (pin # P9-2) and IOPA1 (pin # P8-10) should still be connected.
In real-time mode, we would like to have our window continuously refresh. Click:
View Real-time Refresh Options…
and check
“Global Continuous Refresh”
. Alternately, we could have right
clicked on each window individually and selected
“Continuous Refresh”
.
Note:
“Global Continuous Refresh”
causes all open windows to refresh at the
refresh rate. This can be problematic when a large number of windows are open, as
bandwidth over the emulation link is limited. Updating too many windows can cause the
refresh frequency to bog down. In that case, either close some windows, or disable
global refresh and selectively enable
“Continuous Refresh”
for individual
windows of interest instead.
C28x - Analog-to-Digital Converter
6 - 17
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...