EmbeddedRelated.com
Forums
Memfault Beyond the Launch

ADC12 Sequence of Channels Mode, Time Overflow

Started by jrecas October 9, 2007
Hello to everybody!!

I am trying to read AD0 channel of an MSP430f149 using the Sequence of
Channels mode. I am able to get the data but I also have a Conversion Time
Overflow. I use TimerA.1 as a conversion trigger, in Set/Reset mode with a
period of 30us. The conversion uses de internal ADC12OSC, which works at
5MHz (1 conversion takes 13/5MHz=2.6us) so it possible to get the data in
the 15us low period of the TimerA.1.

Why I have this Time Overflow Interrupt?? This is the initialization and
interrupt vector code:

command result_t StdControl.init() {

// ADC12 & reference voltage 2.5V on, Int Enabled
ADC12CTL0 = REF2_5V|REFON|ADC12ON|ADC12OVIE|ADC12TOVIE;

// Sequence Of Channels, ADC12OSC (5Mhz), CLKDiv=0,
//Timer_A.OUT1 (Set/Reset output mode T0us)
ADC12CTL1 = SHS_1|ADC12DIV_0|ADC12SSEL_0|CONSEQ_1;

// Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel
ADC12MCTL0 =SREF_1|INCH_0;
// Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel, End of Sequence
ADC12MCTL1 =SREF_1|INCH_0|EOS;
// Mem1 Interrupt
ADC12IE = 0x2;
return SUCCESS;
}

TOSH_SIGNAL(ADC_VECTOR) {
uint16_t ivC12IV;
//Debug porpouses, MISC1 IO pin set
TOSH_SET_MISC1_PIN();
switch(iv){

//ADC12MEM overflow
case 0x2:
//Debug porpouses, MISC2 IO pin set and clear
TOSH_SET_MISC2_PIN(); TOSH_CLR_MISC2_PIN();
break;
//Conversion Time Overflow
case 0x4:
//Debug porpouses, MISC4 IO pin set and clear
TOSH_SET_MISC4_PIN(); TOSH_CLR_MISC4_PIN();
break;
//ADC12MEM1 interrupt flag
case 0x8:
//Debug porpouses, MISC3 IO pin set and clear
TOSH_SET_MISC3_PIN(); TOSH_CLR_MISC3_PIN();
pData[0]C12MEM0;
pData[1]C12MEM1;
dataReady=1;
break;
default:
//Debug porpouses, MISC5 IO pin set and clear
TOSH_SET_MISC5_PIN();
}
//Debug porpouses, MISC1 IO pin clear
TOSH_CLR_MISC1_PIN();
}

To enable ENC ADC12 bit I use an IO interrupt to synchronize with an
external device:

async event void Enable.fired(){
TOSH_SET_MISC1_PIN();

//AD Conversion Enabled
ADC12CTL0 |= ENC;
//Borramos el evento
call Enable.clear();

TOSH_CLR_MISC1_PIN();
}

--

Beginning Microcontrollers with the MSP430

Look at SLAZ017B from the TI web site. This is the device errata sheet.

Bug ADC7

The timing overflow flag is set in sequence mode even if no overflow
has occurred.

workaround - don't use this interrupt.

Ian

On 09/10/2007, jrecas wrote:
>
> Hello to everybody!!
>
> I am trying to read AD0 channel of an MSP430f149 using the Sequence of
> Channels mode. I am able to get the data but I also have a Conversion Time
> Overflow. I use TimerA.1 as a conversion trigger, in Set/Reset mode with a
> period of 30us. The conversion uses de internal ADC12OSC, which works at
> 5MHz (1 conversion takes 13/5MHz=2.6us) so it possible to get the data in
> the 15us low period of the TimerA.1.
>
> Why I have this Time Overflow Interrupt?? This is the initialization and
> interrupt vector code:
>
> command result_t StdControl.init() {
>
> // ADC12 & reference voltage 2.5V on, Int Enabled
> ADC12CTL0 = REF2_5V|REFON|ADC12ON|ADC12OVIE|ADC12TOVIE;
>
> // Sequence Of Channels, ADC12OSC (5Mhz), CLKDiv=0,
> //Timer_A.OUT1 (Set/Reset output mode T0us)
> ADC12CTL1 = SHS_1|ADC12DIV_0|ADC12SSEL_0|CONSEQ_1;
>
> // Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel
> ADC12MCTL0 =SREF_1|INCH_0;
> // Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel, End of Sequence
> ADC12MCTL1 =SREF_1|INCH_0|EOS;
> // Mem1 Interrupt
> ADC12IE = 0x2;
> return SUCCESS;
> }
>
> TOSH_SIGNAL(ADC_VECTOR) {
> uint16_t ivC12IV;
> //Debug porpouses, MISC1 IO pin set
> TOSH_SET_MISC1_PIN();
> switch(iv){
>
> //ADC12MEM overflow
> case 0x2:
> //Debug porpouses, MISC2 IO pin set and clear
> TOSH_SET_MISC2_PIN(); TOSH_CLR_MISC2_PIN();
> break;
> //Conversion Time Overflow
> case 0x4:
> //Debug porpouses, MISC4 IO pin set and clear
> TOSH_SET_MISC4_PIN(); TOSH_CLR_MISC4_PIN();
> break;
> //ADC12MEM1 interrupt flag
> case 0x8:
> //Debug porpouses, MISC3 IO pin set and clear
> TOSH_SET_MISC3_PIN(); TOSH_CLR_MISC3_PIN();
> pData[0]C12MEM0;
> pData[1]C12MEM1;
> dataReady=1;
> break;
> default:
> //Debug porpouses, MISC5 IO pin set and clear
> TOSH_SET_MISC5_PIN();
> }
> //Debug porpouses, MISC1 IO pin clear
> TOSH_CLR_MISC1_PIN();
> }
>
> To enable ENC ADC12 bit I use an IO interrupt to synchronize with an
> external device:
>
> async event void Enable.fired(){
> TOSH_SET_MISC1_PIN();
>
> //AD Conversion Enabled
> ADC12CTL0 |= ENC;
> //Borramos el evento
> call Enable.clear();
>
> TOSH_CLR_MISC1_PIN();
> }
>
> --
>
>
Thank you very much!!

I've spent 3 work days trying everything and I was not able to find
SLAZ017B.

jrecas
Ian Okey wrote:
>
> Look at SLAZ017B from the TI web site. This is the device errata sheet.
>
> Bug ADC7
>
> The timing overflow flag is set in sequence mode even if no overflow
> has occurred.
>
> workaround - don't use this interrupt.
>
> Ian
>
> On 09/10/2007, jrecas wrote:
>>
>> Hello to everybody!!
>>
>> I am trying to read AD0 channel of an MSP430f149 using the Sequence of
>> Channels mode. I am able to get the data but I also have a Conversion
>> Time
>> Overflow. I use TimerA.1 as a conversion trigger, in Set/Reset mode with
>> a
>> period of 30us. The conversion uses de internal ADC12OSC, which works at
>> 5MHz (1 conversion takes 13/5MHz=2.6us) so it possible to get the data in
>> the 15us low period of the TimerA.1.
>>
>> Why I have this Time Overflow Interrupt?? This is the initialization and
>> interrupt vector code:
>>
>> command result_t StdControl.init() {
>>
>> // ADC12 & reference voltage 2.5V on, Int Enabled
>> ADC12CTL0 = REF2_5V|REFON|ADC12ON|ADC12OVIE|ADC12TOVIE;
>>
>> // Sequence Of Channels, ADC12OSC (5Mhz), CLKDiv=0,
>> //Timer_A.OUT1 (Set/Reset output mode T0us)
>> ADC12CTL1 = SHS_1|ADC12DIV_0|ADC12SSEL_0|CONSEQ_1;
>>
>> // Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel
>> ADC12MCTL0 =SREF_1|INCH_0;
>> // Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel, End of Sequence
>> ADC12MCTL1 =SREF_1|INCH_0|EOS;
>> // Mem1 Interrupt
>> ADC12IE = 0x2;
>> return SUCCESS;
>> }
>>
>> TOSH_SIGNAL(ADC_VECTOR) {
>> uint16_t ivC12IV;
>> //Debug porpouses, MISC1 IO pin set
>> TOSH_SET_MISC1_PIN();
>> switch(iv){
>>
>> //ADC12MEM overflow
>> case 0x2:
>> //Debug porpouses, MISC2 IO pin set and clear
>> TOSH_SET_MISC2_PIN(); TOSH_CLR_MISC2_PIN();
>> break;
>> //Conversion Time Overflow
>> case 0x4:
>> //Debug porpouses, MISC4 IO pin set and clear
>> TOSH_SET_MISC4_PIN(); TOSH_CLR_MISC4_PIN();
>> break;
>> //ADC12MEM1 interrupt flag
>> case 0x8:
>> //Debug porpouses, MISC3 IO pin set and clear
>> TOSH_SET_MISC3_PIN(); TOSH_CLR_MISC3_PIN();
>> pData[0]C12MEM0;
>> pData[1]C12MEM1;
>> dataReady=1;
>> break;
>> default:
>> //Debug porpouses, MISC5 IO pin set and clear
>> TOSH_SET_MISC5_PIN();
>> }
>> //Debug porpouses, MISC1 IO pin clear
>> TOSH_CLR_MISC1_PIN();
>> }
>>
>> To enable ENC ADC12 bit I use an IO interrupt to synchronize with an
>> external device:
>>
>> async event void Enable.fired(){
>> TOSH_SET_MISC1_PIN();
>>
>> //AD Conversion Enabled
>> ADC12CTL0 |= ENC;
>> //Borramos el evento
>> call Enable.clear();
>>
>> TOSH_CLR_MISC1_PIN();
>> }
>>
>> --
>>
>>
--- In m..., prrecas wrote:
> Thank you very much!!
>
> I've spent 3 work days trying everything and I was not able to find
> SLAZ017B.

*** try this ***
http://focus.ti.com/lit/er/slaz017b/slaz017b.pdf

>
> jrecas
> Ian Okey wrote:
> >
> > Look at SLAZ017B from the TI web site. This is the device errata
sheet.
> >
> > Bug ADC7
> >
> > The timing overflow flag is set in sequence mode even if no overflow
> > has occurred.
> >
> > workaround - don't use this interrupt.
> >
> > Ian
> >
> > On 09/10/2007, jrecas wrote:
> >>
> >> Hello to everybody!!
> >>
> >> I am trying to read AD0 channel of an MSP430f149 using the
Sequence of
> >> Channels mode. I am able to get the data but I also have a Conversion
> >> Time
> >> Overflow. I use TimerA.1 as a conversion trigger, in Set/Reset
mode with
> >> a
> >> period of 30us. The conversion uses de internal ADC12OSC, which
works at
> >> 5MHz (1 conversion takes 13/5MHz=2.6us) so it possible to get the
data in
> >> the 15us low period of the TimerA.1.
> >>
> >> Why I have this Time Overflow Interrupt?? This is the
initialization and
> >> interrupt vector code:
> >>
> >> command result_t StdControl.init() {
> >>
> >> // ADC12 & reference voltage 2.5V on, Int Enabled
> >> ADC12CTL0 = REF2_5V|REFON|ADC12ON|ADC12OVIE|ADC12TOVIE;
> >>
> >> // Sequence Of Channels, ADC12OSC (5Mhz), CLKDiv=0,
> >> //Timer_A.OUT1 (Set/Reset output mode T0us)
> >> ADC12CTL1 = SHS_1|ADC12DIV_0|ADC12SSEL_0|CONSEQ_1;
> >>
> >> // Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel
> >> ADC12MCTL0 =SREF_1|INCH_0;
> >> // Sref=2.5v, Vr+=Vref+, Vr-=AVss, AD0 channel, End of Sequence
> >> ADC12MCTL1 =SREF_1|INCH_0|EOS;
> >> // Mem1 Interrupt
> >> ADC12IE = 0x2;
> >> return SUCCESS;
> >> }
> >>
> >> TOSH_SIGNAL(ADC_VECTOR) {
> >> uint16_t ivC12IV;
> >> //Debug porpouses, MISC1 IO pin set
> >> TOSH_SET_MISC1_PIN();
> >> switch(iv){
> >>
> >> //ADC12MEM overflow
> >> case 0x2:
> >> //Debug porpouses, MISC2 IO pin set and clear
> >> TOSH_SET_MISC2_PIN(); TOSH_CLR_MISC2_PIN();
> >> break;
> >> //Conversion Time Overflow
> >> case 0x4:
> >> //Debug porpouses, MISC4 IO pin set and clear
> >> TOSH_SET_MISC4_PIN(); TOSH_CLR_MISC4_PIN();
> >> break;
> >> //ADC12MEM1 interrupt flag
> >> case 0x8:
> >> //Debug porpouses, MISC3 IO pin set and clear
> >> TOSH_SET_MISC3_PIN(); TOSH_CLR_MISC3_PIN();
> >> pData[0]C12MEM0;
> >> pData[1]C12MEM1;
> >> dataReady=1;
> >> break;
> >> default:
> >> //Debug porpouses, MISC5 IO pin set and clear
> >> TOSH_SET_MISC5_PIN();
> >> }
> >> //Debug porpouses, MISC1 IO pin clear
> >> TOSH_CLR_MISC1_PIN();
> >> }
> >>
> >> To enable ENC ADC12 bit I use an IO interrupt to synchronize with an
> >> external device:
> >>
> >> async event void Enable.fired(){
> >> TOSH_SET_MISC1_PIN();
> >>
> >> //AD Conversion Enabled
> >> ADC12CTL0 |= ENC;
> >> //Borramos el evento
> >> call Enable.clear();
> >>
> >> TOSH_CLR_MISC1_PIN();
> >> }
> >>
> >> --
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>

Memfault Beyond the Launch