Hi everyone, I'm having a bit of trouble understanding the usage of the sequence conversion option on the MSP430's ADC10. Using a G2553. Code posted below - I don't understand how to move the ADC10MEM values into general purpose registers between the conversions. The MSP430 user guide suggests that the proper way to pause the ADC10 during a conversion is to toggle the ENC bit in ADC10CTL0. So, the conversion starts, CPU enters LPM until the conversion is complete. At this point, should I toggle the ENC bit, store the value in ADC10MEM, then toggle the ENC bit again to restart the conversion sequence? Something is a bit off, because both the registers come up with the same value from ADC10MEM at the moment.
Mainloop
bis.w #ENC+ADC10SC,&ADC10CTL0 ; initiate conversion bis.w #CPUOFF+GIE,SR ; turn off CPU (enter low power mode 0) ; and enable interrupts - wait in low ; power mode until ADC sample is complete
bis.w #ENC,&ADC10CTL0 ; pause conversion mov.w &ADC10MEM,R15 ; store ADC10MEM value in register R15 bis.w #ENC,&ADC10CTL0 ; enable conversion mov.w &ADC10MEM, R14 ; store next ADC10MEM value in reg. R14
jmp Mainloop ;start sample process again
thanks,
-Jk.
Hi Jazz,
I guess the issue is that you need to clear the ENC bit:
bic.w #ENC,&ADC10CTL0 ; pause conversion
Most likely you need to pause the MUC again while ADC10 runs.
bis.w #ENC,&ADC10CTL0 ; enable conversionbis.w #CPUOFF+GIE,SR mov.w &ADC10MEM, R14 ; store next ADC10MEM value in reg. R14
RegardsGuenther
That would be my problem. Much obliged, Guenther.