Pumpkin, Inc.

Pumpkin User Forums

MSP430 ADC12MEM1 problem

For issues specific to TI's MSP430 line of ultra-low-power microcontrollers, including compilers (e.g. Quadravox AQ430), IDEs (e.g. IAR Embedded Workbench) and development tools (e.g. TI MSP-FET430 Flash Emulation Tool).

MSP430 ADC12MEM1 problem

Postby JohnBessel » Wed Aug 17, 2005 1:44 am

hello,
I try to use ADC12MEM1 for the second channel for ADC, but I get no values.

can anybody help me.

here is my quellcode:

#include <msp430x14x.h>
#include <stdio.h>

unsigned char rf_buf[8],
unsigned int adc1,adc2;

void main(void) {
P6SEL |= 0x03; // channel 1 + 2
ADC12CTL0 = REF2_5V + REFON + SHT0_2 + ADC12ON + MSC ;
ADC12CTL1 = SHP +CONSEQ_1; //if I put CONSEQ_1 in this row, then the program doesn't function
ADC12MCTL0 = SREF_1 + INCH_0; // channel 1
ADC12MCTL1 = SREF_1 + INCH_1; // channel 2
ADC12IE = 0x01; // ???
ADC12CTL0 |= ENC;
WDTCTL = WDT_ADLY_250;
IE1 |= WDTIE;
_EINT();
for ( ; ; ) {
_BIS_SR(LPM0_bits);
_NOP();
sprintf(rf_buf,"%d ",adc2); //
rf_poi = rf_buf;
}
}

interrupt [WDT_VECTOR] void wdt_isr(void) {
ADC12CTL0 |= ADC12SC;
}

interrupt[ADC_VECTOR] void ADC12ISR (void) {
adc1 = ADC12MEM0; // memory in the temp
adc2 = ADC12MEM1; // memory in the temp, but I get o value here. Why???
_BIC_SR_IRQ(LPM0_bits);
}

int __low_level_init(void) {
WDTCTL = WDTPW + WDTHOLD;
return 1;
}

What do I fals????

Thank you for you help.

with best regards

JohnBessel
 
Posts: 2
Joined: Tue Aug 16, 2005 11:00 pm

Re: MSP430 ADC12MEM1 problem

Postby aek » Wed Aug 17, 2005 6:52 am

Yahoo!'s MSP430 group is very active -- you may want to try your question there.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: MSP430 ADC12MEM1 problem

Postby JohnBessel » Fri Aug 19, 2005 8:58 am

thank you,
do you have the link on that Forum???
JohnBessel
 
Posts: 2
Joined: Tue Aug 16, 2005 11:00 pm

Re: MSP430 ADC12MEM1 problem

Postby aek » Fri Aug 19, 2005 9:18 am

http://groups.yahoo.com/group/msp430/

You'll probably have to join Yahoo! (free) to gain access ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to TI's MSP430

Who is online

Users browsing this forum: No registered users and 3 guests

cron