Single-channel and multi-channel analog-to-digital conversion (AD) of DSP chip

Publisher:世界因你而精彩Latest update time:2011-08-10 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Single-channel, multi-channel analog-to-digital conversion (AD)
I. Experimental purpose
1. Through the experiment, get familiar with the timer of F2812A.
2. Master the control method of AD in F2812A chip.
II. Experimental principle
1. Features of analog-to-digital conversion module with TMS320F2812 A chip - 12-bit analog-to-digital conversion module ADC, fast conversion time runs at 25mhz, ADC clock or 12.5MSPS. - 16 analog input channels (AIN0-AIN15). - Built-in double sample-holder - Sampling amplitude: 0-3v 2. Introduction to analog-to-digital module The ADC module has 16 channels and can be configured as two independent 8-channel modules to facilitate the service of event managers A and B. Two independent 8-channel modules can be cascaded to form a 16-channel module. Although there are multiple input channels and two sequencers , there is only one converter inside the ADC, and only one AD is converting data at the same time. 3. Program control of analog-to-digital conversion Analog-to-digital conversion is a relatively slow process compared to computers. Generally, the interrupt method is used to start the conversion or save the result, so that less processing time can be occupied when the CPU is busy with other tasks. When designing the conversion program, the first consideration should be how to match the processing process with the time of analog-to-digital conversion, and the appropriate means of triggering the conversion should be selected according to actual needs. The results should also be saved in time. 4. Experimental program flow chart













3. Experimental equipment
Computer, ICETEK-F2812-EDU experimental box (or ICETEK simulator + ICETEK-F2812-A system board + related wiring and power supply).
4. Experimental content and steps
1. Experimental preparation
(1) Connect the experimental equipment: Please refer to Part I and Part II of this book.
(2) Prepare the signal source for AD input.
① Take out the two signal cables attached to the experimental box (as shown in the right figure, both ends are mono voice plugs).
② Use a signal cable to connect the
"waveform output" socket (3 or 4 in Figure 10-1) of the signal source I module (the part in the single solid line frame in Figure 10-1) on the bottom board of the experimental box and the "ADCIN0" socket (A in Figure 10-1) of the "A/D input" module (the part in the dotted line frame in Figure 10-1 ). Note that the plug must be inserted firmly and to the bottom. In this way, the output waveform of
the signal source I can be sent to the AD input channel 0 of the ICETEK-F2812-A evaluation board. ③ Use a signal line to connect the "waveform output " socket (c or d in Figure 10-1) of the signal source II module (the part in the double solid line frame in Figure 10-1) on the bottom plate of the experimental box and the "ADCIN1" socket (B in Figure 10-1) of the "A/D input" module. Note that the plug must be inserted firmly and to the bottom. In this way, the output waveform of the signal source II can be sent to the AD input channel 1 of the ICETEK-F2812-A evaluation board.




④ Set signal source I:
- Adjust the toggle switch "Frequency Selection" (5 in Figure 10-1) to the "100Hz-1KHz" position (10 in Figure 10-1).
- Adjust the "Frequency Fine Adjustment" (6 in Figure 10-1) clockwise to the full position (maximum).
- Adjust the toggle switch "Waveform Selection" (7 in Figure 10-1) to the "Triangle Wave" position (11 in Figure 10-1).
- Adjust the "Amplitude Fine Adjustment" (8 in Figure 10-1) clockwise to the full position (maximum).

⑤ Set signal source II:
- Adjust the slide switch "Frequency Selection" (e in Figure 10-1) to "100Hz-1KHz" (j in Figure 10-1).
- Adjust the "Frequency Fine Adjustment" (f in Figure 10-1) clockwise to the end (maximum).
- Adjust the slide switch "Waveform Selection" (g in Figure 10-1) to the "Sine Wave" (k in Figure 10-1).
- Adjust the "Amplitude Fine Adjustment" (h in Figure 10-1) clockwise to the end (maximum).
⑥ Turn the power switches of the two signal sources (2 and b in Figure 10-1) to the "On" position.
2. Set Code Composer Studio 2.21 to run in hardware emulation (Emulator) mode .
Please refer to Part I, IV, 2 of this book.
3. Start Code Composer Studio 2.21.
Please refer to Part I, V, 2 of this book.
Select the menu Debug→Reset CPU.
4. Open the project file
- Project directory: C:ICETEK-F2812-A-EDUlabDSP281x_examplesLab0305-AD ADC.pjt.
- In the project browser, double-click adc.c to open the adc.c file, browse the contents of the file, and understand the functions of each statement.
5. Compile and download the program.
6. Open the observation window
- Select the menu "View", "Graph", "Time/Frequency..." to make the following settings, and then click the "OK" button;

- Select the menu "View", "Graph", "Time/Frequency..." to make the following settings (Figure 10-3), and then click the "OK"
button;
- Right-click in the pop-up graphics window and select "Clear Display".
Through the settings, we open two graphics windows to observe the results of analog-to-digital conversion of the two channels.

Figure 10-3 Observation window setting 2
7. Set the signal source
Since the analog-to-digital input signal enters the DSP without any conversion, the amplitude of the input analog signal must be between
0-3V. The signal range must be detected with an oscilloscope to ensure that the minimum value is 0V and the maximum value is 3 V, otherwise it is easy to damage the
analog-to-digital acquisition module of the DSP chip.
8. Run the program and observe the results
- Click the "Debug" menu, "Run" item, and run the program;
- Stop running and observe the graphic display in the "ADCIN0" and "ADCIN1" windows;
- Change the signal source appropriately, press the F5 key to run again, and observe the display in the graphic window after stopping.
Note: The frequency of the input signal cannot be greater than 10KHz, otherwise it will cause aliasing distortion and the waveform cannot be observed. If
you are interested, you can try to do it and observe the graphics after sampling distortion.
9. Select the menu File→workspace→save workspacs As…, and enter the file name SY.wks.
10. Exit CCS
V. Pre-study requirements
1. Understand the timer of F2812A.
2. Understand the control method of the AD in the F2812A chip.
VI. Notes
In the sampling amplitude, remember that the signal input to the AD should not exceed this range, otherwise the 2812 chip will be burned out.
VII. Questions for consideration

Try to make the input signal frequency greater than 10KHz, and observe the graph after sampling distortion.
VIII. Experimental report requirements
1. Draw the output waveforms of ad1 and ad2.
2. After changing the signal source frequency, the waveform changes and try to analyze it

Reference address:Single-channel and multi-channel analog-to-digital conversion (AD) of DSP chip

Previous article:Implementing DES encryption algorithm using assembly language
Next article:External interrupt of DSP chip TMS320f2812

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号