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.
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
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
That would be my problem. Much obliged, Guenther.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.