EmbeddedRelated.com
Forums

SD16 ADC on 2013

Started by Peter Lissenburg May 2, 2012
Hi Guys,
not used the SD16 module before, and am having trouble getting channel
0 working. I'm seeing some odd behavior, so it's reflecting my behavior!
void SD16_A_init(void)
{
SD16CTL = 0x0406;
SD16CCTL0 = 0x1008;
SD16INCTL0 = 0x00;
SD16AE = 0x05;
SD16CCTL0 |= SD16SC;
}

void SD16_A_intService(void)
{
if(SD16IV & SD16IV_SD16MEM0){
SD16_A.result[SD16INCTL0 & 0x07] = SD16MEM0;
if(SD16INCTL0 >= 0x07){
SD16INCTL0 = 0;
}else{
SD16INCTL0 += 1;
}
}
}

I can see reasonable values on input 1. But input 0 seems to stay at
very low values. Also I see input 2, which is not connected coming up
with near what I place on input 1.
Any ideas where I should look?
Thanks.
Cheers.
Pete L.

Beginning Microcontrollers with the MSP430

Hi Again,
eventually got back to this and found that having the ADC set to
continuous conversions and then switching them in the ISR gives odd
results. Set it to single conversion, change channels in the ISR and
restart, works much better.
Cheers.
Pete L.
Changed SD16_A_init->SD16CCTL0 = 0x1408;
Added at end of ISR->SD16CCTL0 |= SD16SC;
On 2/05/2012 1:36 PM, Peter Lissenburg wrote:
> Hi Guys,
> not used the SD16 module before, and am having trouble getting channel
> 0 working. I'm seeing some odd behavior, so it's reflecting my behavior!
> void SD16_A_init(void)
> {
> SD16CTL = 0x0406;
> SD16CCTL0 = 0x1008;
> SD16INCTL0 = 0x00;
> SD16AE = 0x05;
> SD16CCTL0 |= SD16SC;
> }
>
> void SD16_A_intService(void)
> {
> if(SD16IV & SD16IV_SD16MEM0){
> SD16_A.result[SD16INCTL0 & 0x07] = SD16MEM0;
> if(SD16INCTL0 >= 0x07){
> SD16INCTL0 = 0;
> }else{
> SD16INCTL0 += 1;
> }
> }
> }
>
> I can see reasonable values on input 1. But input 0 seems to stay at
> very low values. Also I see input 2, which is not connected coming up
> with near what I place on input 1.
> Any ideas where I should look?
> Thanks.
> Cheers.
> Pete L.
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1424 / Virus Database: 2411/4971 - Release Date: 05/01/12
>