Part Number:MSP430F5529
Tool/software: Code Composer Studio
Hi everybody,
I hope that you are doing well. I have a question about the programmation of the MSP430F5529 launchpad, I want to use internal ADC like P7.0 as an example because I already uses all the ADC pins where we can connect what we want. I would like to know if it is possible to use a pin on the board to connect a sensor and uses the internal ADC to make the conversion to numeric values and if so how to manage to do it.
I wrote the code below for the P7.0 configuration, can you tell me how to make a link between the P7.0 port and as an example the P2.0 port where my sensor is connected ?
int ADCDigData;
P7SEL |= 0x0F; // Enable A/D channel A12
ADC12CTL0 = ADC12ON + ADC12MSC + ADC12SHT0_2; // Turn on ADC12, set sampling time
ADC12CTL1 = ADC12SHP + ADC12CONSEQ_1; // Use sampling timer, single sequence
ADC12MCTL12 = ADC12INCH_12 + ADC12EOS; // ref+=AVcc, channel = A12
ADC12CTL0 |= ADC12ENC; // Enable conversions
ADC12CTL0 |= ADC12SC; // Start conversion-software trigger
ADCDigData = ADC12MEM12;
Thank you :)