EmbeddedRelated.com
Forums

ADC12 Conversion-start issue (sourcing from TB0 or TB1)

Started by tintronic August 26, 2008
Hi there.
I'm having trouble with the ADC12 of an MSP430F1610. I'm using IAR
3.42. I've used the ADC12 many times before, but not with this
particular configuration:
I'm trying to start a sequence of conversions each time TimerB rolls
over (TimerB IS working in UP mode).
For that I'm selecting the SHI signal to be sourced from TB1 (have
also tryed TB0), but conversions never start (there is no data change
on ADC12MEM 0 to 5). The strangest part is that if I set ADC12SC bit,
either by firmware or with the IAR Register window, conversion does
start. That shouldn't be possible with SHS0=1 and SHS1=1. I've checked
with the register window and all ADC12 bits have the value they're
supposed to have.

Here's my configuration:

void Init_ADC12 (void)
{
ADC12CTL0 &= ~ENC;modified
ADC12CTL0 = SHT0_2 | MSC | ADC12ON;
//StartOfConversion source = Timer_B.out1
ADC12CTL1 = CSTARTADD_0 | SHS_3 | SHP | ADC12DIV_0 | ADC12SSEL_0 |
CONSEQ_1;

ADC12MCTL0 = SREF_0 | 2; // Vbat
ADC12MCTL1 = SREF_0 | 3; // AN1
ADC12MCTL2 = SREF_0 | 4; // AN2
ADC12MCTL3 = SREF_0 | 5; // AN3
ADC12MCTL4 = SREF_0 | 6; // AN4
ADC12MCTL5 = SREF_0 | 1 |EOS; // Vt

ADC12IFG = 0; //Reset interrupt flags
ADC12IE = 0; //Disable interrupts

ADC12CTL0 |= ENC; // Enable conversions.
}

void Init_TimerB (void)
{
TBR = 0;
TBCTL = TBSSEL_1; // TBclk = ACLK
TBCCR0 = 19999; // TB period = 2.5ms
TBCCTL0 |= CCIE | OUTMOD_4; //Toggle mode, interrupt enabled.
TBCCR1 = 1;
TBCCTL1 = OUTMOD_4; //Toggle mode
TBCTL |= MC_1; // Start Up Mode
}

#pragma vector = TIMERB0_VECTOR
__interrupt void TimerB0 (void)
{
...
}

I really don't know what could be wrong. I've tryed to find the source
of my problems, but as mentioned above, the fact that setting ADC12SC
bit starts a conversion sequence despite the SHS_3 configuration has
me clueless. Strangely enought, using SHS_2 which only changes SHI
source from TB1 to TB0, prevents ADC12SC bit from starting a
conversion sequence, but still does not start the sequence when TB0
rises. Any thoughts will be greatly appreciated.

I should probably mention that I'm not enabling P4.0/TB0 or P4.1/TB1
peripheral function via P4SEL, as they are used as digital outputs.

Best Regards,
Michael K.

Beginning Microcontrollers with the MSP430

A minor point, but without toggling ENC after each sequence in
CONSEQ_1 mode you will only get a single conversion sequence. Is that
that you intended? However, as you point out ADC12SC should not
trigger a sequence when in SHS_3.

My only suggestion might be to try using a higher value than 1 as the
OUT1 toggle point (eg 10000); there are some issues when using a slow
ACLK and a fast MCLK. Also maybe try checking the part date code
against bugspray; there are a few ADC12 & TimerB errata for the '1610.

Hugh

At 02:22 PM 8/26/2008, you wrote:
Hi there.
I'm having trouble with the ADC12 of an MSP430F1610. I'm using IAR
3.42. I've used the ADC12 many times before, but not with this
particular configuration:
I'm trying to start a sequence of conversions each time TimerB rolls
over (TimerB IS working in UP mode).
For that I'm selecting the SHI signal to be sourced from TB1 (have
also tryed TB0), but conversions never start (there is no data change
on ADC12MEM 0 to 5). The strangest part is that if I set ADC12SC bit,
either by firmware or with the IAR Register window, conversion does
start. That shouldn't be possible with SHS0=1 and SHS1=1. I've checked
with the register window and all ADC12 bits have the value they're
supposed to have.

Here's my configuration:

void Init_ADC12 (void)
{
ADC12CTL0 &= ~ENC;modified
ADC12CTL0 = SHT0_2 | MSC | ADC12ON;
//StartOfConversion source = Timer_B.out1
ADC12CTL1 = CSTARTADD_0 | SHS_3 | SHP | ADC12DIV_0 | ADC12SSEL_0 |
CONSEQ_1;

ADC12MCTL0 = SREF_0 | 2; // Vbat
ADC12MCTL1 = SREF_0 | 3; // AN1
ADC12MCTL2 = SREF_0 | 4; // AN2
ADC12MCTL3 = SREF_0 | 5; // AN3
ADC12MCTL4 = SREF_0 | 6; // AN4
ADC12MCTL5 = SREF_0 | 1 |EOS; // Vt

ADC12IFG = 0; //Reset interrupt flags
ADC12IE = 0; //Disable interrupts

ADC12CTL0 |= ENC; // Enable conversions.
}

void Init_TimerB (void)
{
TBR = 0;
TBCTL = TBSSEL_1; // TBclk = ACLK
TBCCR0 = 19999; // TB period = 2.5ms
TBCCTL0 |= CCIE | OUTMOD_4; //Toggle mode, interrupt enabled.
TBCCR1 = 1;
TBCCTL1 = OUTMOD_4; //Toggle mode
TBCTL |= MC_1; // Start Up Mode
}

#pragma vector = TIMERB0_VECTOR
__interrupt void TimerB0 (void)
{
....
}

I really don't know what could be wrong. I've tryed to find the source
of my problems, but as mentioned above, the fact that setting ADC12SC
bit starts a conversion sequence despite the SHS_3 configuration has
me clueless. Strangely enought, using SHS_2 which only changes SHI
source from TB1 to TB0, prevents ADC12SC bit from starting a
conversion sequence, but still does not start the sequence when TB0
rises. Any thoughts will be greatly appreciated.

I should probably mention that I'm not enabling P4.0/TB0 or P4.1/TB1
peripheral function via P4SEL, as they are used as digital outputs.

Best Regards,
Michael K.

First, Thanks for your prompt response.
I did check the Errata document but there is only one bug listed for
ADC12 and that was not it.

> A minor point, but without toggling ENC after each sequence in
> CONSEQ_1 mode you will only get a single conversion sequence. Is
> that that you intended?
No, that's not what I intended. I wanted the ADC12 to start conversion
each time TimerB counts to 0 (or at least near that instant) without
having ever to touch ADC12 or TimerB again.
But you're right, I didn't notice the need to toggle ENC after each
sequence when using a source different than ADC12SC. I went over those
(damned) bubble diagrams time and time again, and didn't understand
why they used the ADC12SC instead of the (real) SHI to show a
conversion-trigger event. Now I know why.
(It seems I also didn't read or swept over the last sentence just over
that buble diagram. Damn.)

It seems I'll have to change my ADC12 strategy.

Many, many thanks.

Michael K.

--- In m..., Hugh Molesworth wrote:
>
> A minor point, but without toggling ENC after each sequence in
> CONSEQ_1 mode you will only get a single conversion sequence. Is that
> that you intended? However, as you point out ADC12SC should not
> trigger a sequence when in SHS_3.
>
> My only suggestion might be to try using a higher value than 1 as the
> OUT1 toggle point (eg 10000); there are some issues when using a slow
> ACLK and a fast MCLK. Also maybe try checking the part date code
> against bugspray; there are a few ADC12 & TimerB errata for the '1610.
>
> Hugh
>
> At 02:22 PM 8/26/2008, you wrote:
> Hi there.
> I'm having trouble with the ADC12 of an MSP430F1610. I'm using IAR
> 3.42. I've used the ADC12 many times before, but not with this
> particular configuration:
> I'm trying to start a sequence of conversions each time TimerB rolls
> over (TimerB IS working in UP mode).
> For that I'm selecting the SHI signal to be sourced from TB1 (have
> also tryed TB0), but conversions never start (there is no data change
> on ADC12MEM 0 to 5). The strangest part is that if I set ADC12SC bit,
> either by firmware or with the IAR Register window, conversion does
> start. That shouldn't be possible with SHS0=1 and SHS1=1. I've checked
> with the register window and all ADC12 bits have the value they're
> supposed to have.
>
> Here's my configuration:
>
> void Init_ADC12 (void)
> {
> ADC12CTL0 &= ~ENC;modified
> ADC12CTL0 = SHT0_2 | MSC | ADC12ON;
> //StartOfConversion source = Timer_B.out1
> ADC12CTL1 = CSTARTADD_0 | SHS_3 | SHP | ADC12DIV_0 | ADC12SSEL_0 |
> CONSEQ_1;
>
> ADC12MCTL0 = SREF_0 | 2; // Vbat
> ADC12MCTL1 = SREF_0 | 3; // AN1
> ADC12MCTL2 = SREF_0 | 4; // AN2
> ADC12MCTL3 = SREF_0 | 5; // AN3
> ADC12MCTL4 = SREF_0 | 6; // AN4
> ADC12MCTL5 = SREF_0 | 1 |EOS; // Vt
>
> ADC12IFG = 0; //Reset interrupt flags
> ADC12IE = 0; //Disable interrupts
>
> ADC12CTL0 |= ENC; // Enable conversions.
> }
>
> void Init_TimerB (void)
> {
> TBR = 0;
> TBCTL = TBSSEL_1; // TBclk = ACLK
> TBCCR0 = 19999; // TB period = 2.5ms
> TBCCTL0 |= CCIE | OUTMOD_4; //Toggle mode, interrupt enabled.
> TBCCR1 = 1;
> TBCCTL1 = OUTMOD_4; //Toggle mode
> TBCTL |= MC_1; // Start Up Mode
> }
>
> #pragma vector = TIMERB0_VECTOR
> __interrupt void TimerB0 (void)
> {
> ....
> }
>
> I really don't know what could be wrong. I've tryed to find the source
> of my problems, but as mentioned above, the fact that setting ADC12SC
> bit starts a conversion sequence despite the SHS_3 configuration has
> me clueless. Strangely enought, using SHS_2 which only changes SHI
> source from TB1 to TB0, prevents ADC12SC bit from starting a
> conversion sequence, but still does not start the sequence when TB0
> rises. Any thoughts will be greatly appreciated.
>
> I should probably mention that I'm not enabling P4.0/TB0 or P4.1/TB1
> peripheral function via P4SEL, as they are used as digital outputs.
>
> Best Regards,
> Michael K.
>

You're ok then, just use CONSEQ_3 and it should do what you are
looking for. Then ENC is not required for repeats, and you get
continuous sequences.

Hugh

At 03:54 PM 8/26/2008, you wrote:
First, Thanks for your prompt response.
I did check the Errata document but there is only one bug listed for
ADC12 and that was not it.

> A minor point, but without toggling ENC after each sequence in
> CONSEQ_1 mode you will only get a single conversion sequence. Is
> that that you intended?
No, that's not what I intended. I wanted the ADC12 to start conversion
each time TimerB counts to 0 (or at least near that instant) without
having ever to touch ADC12 or TimerB again.
But you're right, I didn't notice the need to toggle ENC after each
sequence when using a source different than ADC12SC. I went over those
(damned) bubble diagrams time and time again, and didn't understand
why they used the ADC12SC instead of the (real) SHI to show a
conversion-trigger event. Now I know why.
(It seems I also didn't read or swept over the last sentence just over
that buble diagram. Damn.)

It seems I'll have to change my ADC12 strategy.

Many, many thanks.

Michael K.

--- In m..., Hugh Molesworth wrote:
>
> A minor point, but without toggling ENC after each sequence in
> CONSEQ_1 mode you will only get a single conversion sequence. Is that
> that you intended? However, as you point out ADC12SC should not
> trigger a sequence when in SHS_3.
>
> My only suggestion might be to try using a higher value than 1 as the
> OUT1 toggle point (eg 10000); there are some issues when using a slow
> ACLK and a fast MCLK. Also maybe try checking the part date code
> against bugspray; there are a few ADC12 & TimerB errata for the '1610.
>
> Hugh
>
> At 02:22 PM 8/26/2008, you wrote:
> Hi there.
> I'm having trouble with the ADC12 of an MSP430F1610. I'm using IAR
> 3.42. I've used the ADC12 many times before, but not with this
> particular configuration:
> I'm trying to start a sequence of conversions each time TimerB rolls
> over (TimerB IS working in UP mode).
> For that I'm selecting the SHI signal to be sourced from TB1 (have
> also tryed TB0), but conversions never start (there is no data change
> on ADC12MEM 0 to 5). The strangest part is that if I set ADC12SC bit,
> either by firmware or with the IAR Register window, conversion does
> start. That shouldn't be possible with SHS0=1 and SHS1=1. I've checked
> with the register window and all ADC12 bits have the value they're
> supposed to have.
>
> Here's my configuration:
>
> void Init_ADC12 (void)
> {
> ADC12CTL0 &= ~ENC;modified
> ADC12CTL0 = SHT0_2 | MSC | ADC12ON;
> //StartOfConversion source = Timer_B.out1
> ADC12CTL1 = CSTARTADD_0 | SHS_3 | SHP | ADC12DIV_0 | ADC12SSEL_0 |
> CONSEQ_1;
>
> ADC12MCTL0 = SREF_0 | 2; // Vbat
> ADC12MCTL1 = SREF_0 | 3; // AN1
> ADC12MCTL2 = SREF_0 | 4; // AN2
> ADC12MCTL3 = SREF_0 | 5; // AN3
> ADC12MCTL4 = SREF_0 | 6; // AN4
> ADC12MCTL5 = SREF_0 | 1 |EOS; // Vt
>
> ADC12IFG = 0; //Reset interrupt flags
> ADC12IE = 0; //Disable interrupts
>
> ADC12CTL0 |= ENC; // Enable conversions.
> }
>
> void Init_TimerB (void)
> {
> TBR = 0;
> TBCTL = TBSSEL_1; // TBclk = ACLK
> TBCCR0 = 19999; // TB period = 2.5ms
> TBCCTL0 |= CCIE | OUTMOD_4; //Toggle mode, interrupt enabled.
> TBCCR1 = 1;
> TBCCTL1 = OUTMOD_4; //Toggle mode
> TBCTL |= MC_1; // Start Up Mode
> }
>
> #pragma vector = TIMERB0_VECTOR
> __interrupt void TimerB0 (void)
> {
> ....
> }
>
> I really don't know what could be wrong. I've tryed to find the source
> of my problems, but as mentioned above, the fact that setting ADC12SC
> bit starts a conversion sequence despite the SHS_3 configuration has
> me clueless. Strangely enought, using SHS_2 which only changes SHI
> source from TB1 to TB0, prevents ADC12SC bit from starting a
> conversion sequence, but still does not start the sequence when TB0
> rises. Any thoughts will be greatly appreciated.
>
> I should probably mention that I'm not enabling P4.0/TB0 or P4.1/TB1
> peripheral function via P4SEL, as they are used as digital outputs.
>
> Best Regards,
> Michael K.
>

It'll not be that easy. It is absolutely necesary for the ADC12 to
execute the first conversion synchronously to the TimerB period. It's
for a battery charger portion of the circuit. TimerB outputs a PWM
which pulse charges a NiMH battery. The first ADC conversion always
has to take place while the PWM is in its high phase (which changes
depending on the condition of the battery). Using CONSEQ_3 will not
work for this purpose as the ADC start of sequence will not be
sincronized with the TimerB PWM output.

Thanks anyway,
Michael K.

--- In m..., Hugh Molesworth wrote:
>
> You're ok then, just use CONSEQ_3 and it should do what you are
> looking for. Then ENC is not required for repeats, and you get
> continuous sequences.
>
> Hugh
>
> At 03:54 PM 8/26/2008, you wrote:
> First, Thanks for your prompt response.
> I did check the Errata document but there is only one bug listed for
> ADC12 and that was not it.
>
> > A minor point, but without toggling ENC after each sequence in
> > CONSEQ_1 mode you will only get a single conversion sequence. Is
> > that that you intended?
> No, that's not what I intended. I wanted the ADC12 to start conversion
> each time TimerB counts to 0 (or at least near that instant) without
> having ever to touch ADC12 or TimerB again.
> But you're right, I didn't notice the need to toggle ENC after each
> sequence when using a source different than ADC12SC. I went over those
> (damned) bubble diagrams time and time again, and didn't understand
> why they used the ADC12SC instead of the (real) SHI to show a
> conversion-trigger event. Now I know why.
> (It seems I also didn't read or swept over the last sentence just over
> that buble diagram. Damn.)
>
> It seems I'll have to change my ADC12 strategy.
>
> Many, many thanks.
>
> Michael K.
>
> --- In m..., Hugh Molesworth wrote:
> >
> > A minor point, but without toggling ENC after each sequence in
> > CONSEQ_1 mode you will only get a single conversion sequence. Is that
> > that you intended? However, as you point out ADC12SC should not
> > trigger a sequence when in SHS_3.
> >
> > My only suggestion might be to try using a higher value than 1 as the
> > OUT1 toggle point (eg 10000); there are some issues when using a slow
> > ACLK and a fast MCLK. Also maybe try checking the part date code
> > against bugspray; there are a few ADC12 & TimerB errata for the
'1610.
> >
> > Hugh
> >
> > At 02:22 PM 8/26/2008, you wrote:
> > Hi there.
> > I'm having trouble with the ADC12 of an MSP430F1610. I'm using IAR
> > 3.42. I've used the ADC12 many times before, but not with this
> > particular configuration:
> > I'm trying to start a sequence of conversions each time TimerB rolls
> > over (TimerB IS working in UP mode).
> > For that I'm selecting the SHI signal to be sourced from TB1 (have
> > also tryed TB0), but conversions never start (there is no data change
> > on ADC12MEM 0 to 5). The strangest part is that if I set ADC12SC bit,
> > either by firmware or with the IAR Register window, conversion does
> > start. That shouldn't be possible with SHS0=1 and SHS1=1. I've
checked
> > with the register window and all ADC12 bits have the value they're
> > supposed to have.
> >
> > Here's my configuration:
> >
> > void Init_ADC12 (void)
> > {
> > ADC12CTL0 &= ~ENC;modified
> > ADC12CTL0 = SHT0_2 | MSC | ADC12ON;
> > //StartOfConversion source = Timer_B.out1
> > ADC12CTL1 = CSTARTADD_0 | SHS_3 | SHP | ADC12DIV_0 | ADC12SSEL_0 |
> > CONSEQ_1;
> >
> > ADC12MCTL0 = SREF_0 | 2; // Vbat
> > ADC12MCTL1 = SREF_0 | 3; // AN1
> > ADC12MCTL2 = SREF_0 | 4; // AN2
> > ADC12MCTL3 = SREF_0 | 5; // AN3
> > ADC12MCTL4 = SREF_0 | 6; // AN4
> > ADC12MCTL5 = SREF_0 | 1 |EOS; // Vt
> >
> > ADC12IFG = 0; //Reset interrupt flags
> > ADC12IE = 0; //Disable interrupts
> >
> > ADC12CTL0 |= ENC; // Enable conversions.
> > }
> >
> > void Init_TimerB (void)
> > {
> > TBR = 0;
> > TBCTL = TBSSEL_1; // TBclk = ACLK
> > TBCCR0 = 19999; // TB period = 2.5ms
> > TBCCTL0 |= CCIE | OUTMOD_4; //Toggle mode, interrupt enabled.
> > TBCCR1 = 1;
> > TBCCTL1 = OUTMOD_4; //Toggle mode
> > TBCTL |= MC_1; // Start Up Mode
> > }
> >
> > #pragma vector = TIMERB0_VECTOR
> > __interrupt void TimerB0 (void)
> > {
> > ....
> > }
> >
> > I really don't know what could be wrong. I've tryed to find the
source
> > of my problems, but as mentioned above, the fact that setting ADC12SC
> > bit starts a conversion sequence despite the SHS_3 configuration has
> > me clueless. Strangely enought, using SHS_2 which only changes SHI
> > source from TB1 to TB0, prevents ADC12SC bit from starting a
> > conversion sequence, but still does not start the sequence when TB0
> > rises. Any thoughts will be greatly appreciated.
> >
> > I should probably mention that I'm not enabling P4.0/TB0 or P4.1/TB1
> > peripheral function via P4SEL, as they are used as digital outputs.
> >
> > Best Regards,
> > Michael K.
>
I do something similar, since I also require synchronisation between
each group of ADC readings and the timer trigger. Are you sure it
isn't what you're looking for? The conversion sequence in CONSEQ_3 is
only started each repeat on the timer B trigger, so each repeat of
all the channels occurs at the timer B trigger, which doesn't
necessarily have to be at a constant rate. The individual channel
separation between measurements in each sequence is controlled by the
ADC sampling timer. Anyway, good luck.

Hugh

At 04:26 PM 8/26/2008, you wrote:
It'll not be that easy. It is absolutely necesary for the ADC12 to
execute the first conversion synchronously to the TimerB period. It's
for a battery charger portion of the circuit. TimerB outputs a PWM
which pulse charges a NiMH battery. The first ADC conversion always
has to take place while the PWM is in its high phase (which changes
depending on the condition of the battery). Using CONSEQ_3 will not
work for this purpose as the ADC start of sequence will not be
sincronized with the TimerB PWM output.

Thanks anyway,
Michael K.

--- In m..., Hugh Molesworth wrote:
>
> You're ok then, just use CONSEQ_3 and it should do what you are
> looking for. Then ENC is not required for repeats, and you get
> continuous sequences.
>
> Hugh
>
> At 03:54 PM 8/26/2008, you wrote:
> First, Thanks for your prompt response.
> I did check the Errata document but there is only one bug listed for
> ADC12 and that was not it.
>
> > A minor point, but without toggling ENC after each sequence in
> > CONSEQ_1 mode you will only get a single conversion sequence. Is
> > that that you intended?
> No, that's not what I intended. I wanted the ADC12 to start conversion
> each time TimerB counts to 0 (or at least near that instant) without
> having ever to touch ADC12 or TimerB again.
> But you're right, I didn't notice the need to toggle ENC after each
> sequence when using a source different than ADC12SC. I went over those
> (damned) bubble diagrams time and time again, and didn't understand
> why they used the ADC12SC instead of the (real) SHI to show a
> conversion-trigger event. Now I know why.
> (It seems I also didn't read or swept over the last sentence just over
> that buble diagram. Damn.)
>
> It seems I'll have to change my ADC12 strategy.
>
> Many, many thanks.
>
> Michael K.
>
> --- In m..., Hugh Molesworth wrote:
> >
> > A minor point, but without toggling ENC after each sequence in
> > CONSEQ_1 mode you will only get a single conversion sequence. Is that
> > that you intended? However, as you point out ADC12SC should not
> > trigger a sequence when in SHS_3.
> >
> > My only suggestion might be to try using a higher value than 1 as the
> > OUT1 toggle point (eg 10000); there are some issues when using a slow
> > ACLK and a fast MCLK. Also maybe try checking the part date code
> > against bugspray; there are a few ADC12 & TimerB errata for the
'1610.
> >
> > Hugh
> >
> > At 02:22 PM 8/26/2008, you wrote:
> > Hi there.
> > I'm having trouble with the ADC12 of an MSP430F1610. I'm using IAR
> > 3.42. I've used the ADC12 many times before, but not with this
> > particular configuration:
> > I'm trying to start a sequence of conversions each time TimerB rolls
> > over (TimerB IS working in UP mode).
> > For that I'm selecting the SHI signal to be sourced from TB1 (have
> > also tryed TB0), but conversions never start (there is no data change
> > on ADC12MEM 0 to 5). The strangest part is that if I set ADC12SC bit,
> > either by firmware or with the IAR Register window, conversion does
> > start. That shouldn't be possible with SHS0=1 and SHS1=1. I've
checked
> > with the register window and all ADC12 bits have the value they're
> > supposed to have.
> >
> > Here's my configuration:
> >
> > void Init_ADC12 (void)
> > {
> > ADC12CTL0 &= ~ENC;modified
> > ADC12CTL0 = SHT0_2 | MSC | ADC12ON;
> > //StartOfConversion source = Timer_B.out1
> > ADC12CTL1 = CSTARTADD_0 | SHS_3 | SHP | ADC12DIV_0 | ADC12SSEL_0 |
> > CONSEQ_1;
> >
> > ADC12MCTL0 = SREF_0 | 2; // Vbat
> > ADC12MCTL1 = SREF_0 | 3; // AN1
> > ADC12MCTL2 = SREF_0 | 4; // AN2
> > ADC12MCTL3 = SREF_0 | 5; // AN3
> > ADC12MCTL4 = SREF_0 | 6; // AN4
> > ADC12MCTL5 = SREF_0 | 1 |EOS; // Vt
> >
> > ADC12IFG = 0; //Reset interrupt flags
> > ADC12IE = 0; //Disable interrupts
> >
> > ADC12CTL0 |= ENC; // Enable conversions.
> > }
> >
> > void Init_TimerB (void)
> > {
> > TBR = 0;
> > TBCTL = TBSSEL_1; // TBclk = ACLK
> > TBCCR0 = 19999; // TB period = 2.5ms
> > TBCCTL0 |= CCIE | OUTMOD_4; //Toggle mode, interrupt enabled.
> > TBCCR1 = 1;
> > TBCCTL1 = OUTMOD_4; //Toggle mode
> > TBCTL |= MC_1; // Start Up Mode
> > }
> >
> > #pragma vector = TIMERB0_VECTOR
> > __interrupt void TimerB0 (void)
> > {
> > ....
> > }
> >
> > I really don't know what could be wrong. I've tryed to find the
source
> > of my problems, but as mentioned above, the fact that setting ADC12SC
> > bit starts a conversion sequence despite the SHS_3 configuration has
> > me clueless. Strangely enought, using SHS_2 which only changes SHI
> > source from TB1 to TB0, prevents ADC12SC bit from starting a
> > conversion sequence, but still does not start the sequence when TB0
> > rises. Any thoughts will be greatly appreciated.
> >
> > I should probably mention that I'm not enabling P4.0/TB0 or P4.1/TB1
> > peripheral function via P4SEL, as they are used as digital outputs.
> >
> > Best Regards,
> > Michael K.
> >
>