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
Previous article:Implementing DES encryption algorithm using assembly language
Next article:External interrupt of DSP chip TMS320f2812
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- μC/OS embedded real-time operating system releases new open source version
- STEVAL-MKI109V3+ Test Basics
- Is there a “great theorist” around you?
- Built-in numeric keyboard to input numeric variable values
- Summary of crystal oscillator problems
- Unboxing of Materials - STM32F7508 & ESP32
- Gigabit Network Contactless Connector-SK202 Evaluation 4: Strict Test Conditions, Reliable Test Data
- Please recommend a free and easy-to-use EDA software
- [HC32F460 Development Board Review] NO.3 Using OLED to display benchmark indicators
- TI C5000 implements FFT