Home > other >  MSP430ADC12 module configuration
MSP430ADC12 module configuration

Time:12-03

ADC12 module to do functional testing of MSP430F5529 microcontroller, signal sampling ADC channels A11, namely AVCC half, but after I have configuration data has been read 0, for bosses to reassure

CodePudding user response:

Thanks for invitation, but I'm sorry, never use this kind of chicken, egg

CodePudding user response:

Void ADC_init ()
{
P6SEL |=BIT3 + BIT4;
ADC12CTL0=ADC12ON + ADC12SHT0_1 + ADC12MSC;
ADC12CTL1=ADC12SHP + ADC12CONSEQ_1;
ADC12MCTL3=ADC12INCH_3;
ADC12MCTL4=ADC12INCH_4 + ADC12EOS;
ADC12CTL0 |=ADC12ENC;
}

While (1)
{
ADC12CTL0 |=ADC12SC;
while(! (ADC12IFG1 & amp; BIT1));
V_date=ADC12MEM3;
V_date1=ADC12MEM4;
}
  • Related