There is no problem with a single AD channel single conversion.
ADC10CTL0 = SREF_1+ADC10SHT_2 + REFON+ADC10ON+ ADC10IE ;
ADC10AE0 |= 0x40;
ADC10CTL1 = INCH_6;
ADC10CTL0 |= ENC + ADC10SC;
Set up AD conversion, select channel 6, enable analog input of channel 6, and some related information. Finally, start AD conversion.
Next try AD single channel continuous conversion.
ADC10CTL0|=SREF_0+ADC10SHT_2+MSC+ADC10IE+ADC10ON;
ADC10CTL1|=INCH_6+SHS_0+ADC10SSEL_0+CONSEQ_2;
ADC10AE0 |= 0x40;
ADC10DTC1 = 0x0A;
ADC10SA = 0x200;
ADC10CTL0 |= ENC + ADC10SC;
Set AD and start DTC.
In single conversion, AD will generate an interrupt when it stores the conversion result in AD10MEM; in single-channel multiple conversion, DTC is enabled, then an interrupt will be generated after a complete data transfer. (That is, when the interrupt is enabled, after entering the interrupt program, the AD conversion has been completed and the result has been saved.)
I made a mistake when debugging. I added a statement __bis_SR_register( CPUOFF + GIE ) before setting AD. As a result, the program could not execute when it reached the following statement to set AD. It was stuck there. Haha... I found out that the CPU was disabled.
Previous article:How to use C language to write high-quality code for MSP430
Next article:MSP430 MCU - Debug Tool Settings
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Task stack overflow detection mechanism in FreeRTOS
- How to quickly learn to use a chip?
- Lei Jun lost the 1 billion bet with Dong Mingzhu. It seems that the typhoon still can't blow up the pigs.
- The pad is 0.3mm/center distance is 0.5mm and the wire cannot come out
- C2000 Code Generation Tools - Compiler
- I want to use an I/O port of the STM32F1 chip to connect an infrared sensor at a distance of 3 meters. I am worried that the transmission distance is too long. How can I achieve this?
- Op amp transfer function solves the problem
- [Repost] This article tells you the difference between Ethernet and broadband
- Passive buzzer driver
- [Reference Solution] Nuvoton Bluetooth Low Energy Microcontroller M031BT for Personal Electronic Massager