Hi ,
We are using MSP430F5132 and PMP7647 source code.
In PMP7647 sources ..ADC configuration as below:
P1.0 -- Analog input A0 – 10-bit ADC(3) -- Panel Voltage
P1.1 -- Analog input A1 – 10-bit ADC(3) -- Battery Voltage
P1.2 -- Analog input A2 – 10-bit ADC(3) -- Battery Current
P1.3 --Analog input A3 – 10-bit ADC(3) -- Load voltage
P1.4 -- Analog input A4 – 10-bit ADC(3) -- Load Current
//ADC INITIALISATION//
void init_ADC (void)
{
ADC10CTL0 = ADC10SHT_2 + ADC10MSC + ADC10ON; // 8clk cycles, Single trigger, conversion disabled
ADC10CTL1 = ADC10SHP + ADC10CONSEQ_1; // Sampling timer, Sequence of channels
ADC10CTL2 |= ADC10RES; // 10-bit conversion results
ADC10MCTL0 = ADC10INCH_4 + ADC10SREF_1; // A4,A3,A2,A1,A0(EoS), Vref+ = Vref, Vref- = gnd
REFCTL0 |= REFVSEL_2+REFON; // Select internal ref = 2.5V
//CONFIGURE DMA
DMACTL0 = DMA0TSEL_24; // ADC10IFG trigger
__data16_write_addr((unsigned short) &DMA0SA,(unsigned long) &ADC10MEM0);
// Source single address
__data16_write_addr((unsigned short) &DMA0DA,(unsigned long) &ADC_Readings[0]);
// Destination array address
DMA0SZ = 0x05; // 5 WORDS(Conversion Results) transferred
DMA0CTL = DMADT_4 + DMADSTINCR_3 + DMAEN + DMAIE; // Source unchanged, Destination increments, enabled, interrupts enabled
}
ADC sampling and conversion in WDT interrupt
//WDT to restart ADC
void init_WDT (void)
{
WDTCTL = WDT_MDLY_32; // WDT 32ms from 1MHz, SMCLK, interval timer
SFRIE1 |= WDTIE; // Enable WDT interrupt
}
// Watchdog Timer interrupt service routine
#pragma vector=WDT_VECTOR
__interrupt void WDT_ISR(void)
{
__data16_write_addr((unsigned short) &DMA0DA,(unsigned long) &ADC_Readings[0]);
ADC10CTL0 |= ADC10ENC + ADC10SC; // Sampling and conversion start
}
Now in present design , we have slightly changed ADC channel allocation
P1.0 -- Analog input A0 – 10-bit ADC(3) -- Panel Voltage
P1.1 -- Analog input A1 – 10-bit ADC(3) -- Battery Voltage
P1.2 -- Analog input A2 – 10-bit ADC(3) -- Battery Current
P1.3 --Analog input A3 – 10-bit ADC(3) -- Load voltage
P1.4 -- SDA for I2C
P3.6 -- Analog input A7 – 10-bit ADC(3) -- Load current
it is not possible to configure multi channel conversion. Can you suggest ADC configuration