Hi all,
For my application, I need the MCU to trigger the ADC14 and sample as soon as it wakes up from LPM3 via GPIO ISR. I've set everything up before going to LPM3, but it seems like it will take at least 30us before anything is executed. Is there any faster way to trigger the ADC other then calling MAP_ADC14_toggleConversionTrigger(). Can I somehow tie the GPIO to trigger to the ADC trigger? Below is the relevant setup.
CS_setExternalClockSourceFrequency(32000,48000000); //Clock is connected to PortJ.0~1 MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ, GPIO_PIN0 | GPIO_PIN1, GPIO_PRIMARY_MODULE_FUNCTION); MAP_CS_startLFXT(false); MAP_CS_initClockSignal(CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1); MAP_CS_initClockSignal(CS_BCLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1); PCM_setPowerState(PCM_AM_LDO_VCORE1);
BITBAND_PERI(ADC14->rCTL0.r, ADC14ON_OFS) = 1;
MAP_ADC14_configureConversionMemory(ADC_MEM0, ADC_VREFPOS_AVCC_VREFNEG_VSS,ADC_INPUT_A0, ADC_NONDIFFERENTIAL_INPUTS);
MAP_ADC14_setResolution(ADC_8BIT);
MAP_ADC14_initModule(ADC_CLOCKSOURCE_MCLK, ADC_PREDIVIDER_1, ADC_DIVIDER_4,0);
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN5, GPIO_TERTIARY_MODULE_FUNCTION);
MAP_ADC14_configureSingleSampleMode(ADC_MEM0, false);
MAP_ADC14_enableSampleTimer(ADC_MANUAL_ITERATION);
MAP_ADC14_enableConversion();
/* Going to LPM3 */
while (1)
{
MAP_PCM_gotoLPM3();
}
}
/* GPIO ISR */
void gpio_isr(void)
{
MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P2, GPIO_PIN2);//blue on
uint32_t status;
status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);
if (MAP_ADC14_toggleConversionTrigger())
{
MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P2, GPIO_PIN2);//blue off
}
}

