Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216560

Forum Post: RE: How to Interface external circuits with MSP430

$
0
0

[quote user="Kumar Mehta"] ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE;[/quote]You configure the ADC for single channel, single conversion, but you never start a conversion.
'turn on ADC' means 'start consuming power and be ready for configuration and operation', but does not mean 'start constantly converting'. Please re-read the ADC10 chapter in the users guide and the function of the ENC and ADC10SC bits.

Since you never start a conversion, ADC10MEM contains the (undefined) power-up value all the time.

Also, you enable the ADC10 interrupt, but you don't have an ISR for handling it. So if you would start a conversion, the CPU would jump into the void and crash when the conversion is done.

When you just want to read the latest conversion result when the timer interrupt comes, then you should configure the ADC for repeated single channel conversion, then start converting. And do not set ADC10IE, as you don't need an interrupt when a conversion result is ready.


Viewing all articles
Browse latest Browse all 216560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>