MSP430 - DTC problem of AD10

Publisher:快乐的旅程Latest update time:2016-08-17 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Tonight I finally debugged the continuous conversion of AD10 of the MSP430 microcontroller.

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.

Keywords:MSP430 Reference address:MSP430 - DTC problem of AD10

Previous article:How to use C language to write high-quality code for MSP430
Next article:MSP430 MCU - Debug Tool Settings

Latest Microcontroller 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号