TI E2E Community
MSP430 Ultra-Low Power 16-bit Microcontroller Forum
DTC and ADC10 questions.
I´m trying to sample 5 sensors thought MSP430 EZ430-RF2500 (MSP430F2274) and send the info via serial port to the PC (Windows 7). This time, instead of "manually" changing INCH, I took a shot at DTC. But it really doesn´t seem to work... Could someone Help me?
The major problem seems to be the stop at that main loop, where it is supposed to be sampling. In the code above, it will go until P1OUT = 0x03, but won´t go back to the beginning of the FOR LOOP.
Another two questions are:
1)The way the program is written, are my results already in the “saida1” vector at the end of a loop (Right after the P1OUT = 0x03;) ?
2)I saw some programs that use a pointer in ADC10SA and retrieve the vector info in the ADC10 ISR, but I assumed that, at this point, the ADC´s still working. Is this correct?
Here is my code and its description.
Thanks a lot for your attention, and Please Help! =)
ADC10CTL1 = INCH_4 + CONSEQ_3; // A4, A3, A2, A1, A0
ADC10AE0 = BIT0+BIT1+BIT2+BIT3+BIT4; //OUTPUT selection
ADC10CTL0 = ADC10ON + REFON + REF2_5V + MSC + ADC10SHT_3;
ADC10DTC1 = 0x05;
TACCR0 = 30; // Delay to allow Ref to settle
TACCTL0 |= CCIE; // Compare-mode interrupt
TACTL = TASSEL_2 + MC_1; // TACLK = SMCLK, Up mode
__bis_SR_register(CPUOFF + GIE);
TACCTL0 &= ~CCIE; // Disable timer Interrupt
/*END ADC10 variables*/
WDTCTL = WDTPW|WDTHOLD;
start(); //start the variables
ADC10SA = (int) saida1;
P1DIR = 0x03;
ADC10CTL0 &= ~ENC;
while (ADC10CTL1 & BUSY);
ADC10CTL0 |= ENC + ADC10SC; //Begin sampling and convervison
__bis_SR_register(CPUOFF + GIE); // LPM0 com interrupt disponível.
P1OUT = 0x03;
__interrupt void ADC10_ISR(void)
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
__interrupt void TA0_ISR(void)
TACTL = 0;
// Clear Timer_A control registers
// Clear CPUOFF bit from 0(SR)
As near as I can tell, there are no interrupts enabled when you go into LPM, so it will wait forever.
Try setting ADC10IE.
Try setting ADC10IE.
Thanks a Lot! Now its working!
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.