Part Number: MSP432P401R
Tool/software: Code Composer Studio
i use AD1,AD16,AD17 to sample data,but resbuffer does not have number. I wonder what i do wrong?
ADC14_enableModule(); ADC14_initModule(ADC_CLOCKSOURCE_SMCLK, ADC_PREDIVIDER_1, ADC_DIVIDER_1, 0); /* Configuring GPIOs for Analog In */ GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN7|GPIO_PIN6 |GPIO_PIN4, GPIO_TERTIARY_MODULE_FUNCTION); GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P9, GPIO_PIN0 | GPIO_PIN1, GPIO_TERTIARY_MODULE_FUNCTION); /* Configuring ADC Memory (ADC_MEM1,16,17 with repeat)*/ ADC14_configureMultiSequenceMode(ADC_MEM1, ADC_MEM17, true); ADC14_configureConversionMemory(ADC_MEM1,ADC_VREFPOS_EXTPOS_VREFNEG_EXTNEG, ADC_INPUT_A1, false); ADC14_configureConversionMemory(ADC_MEM16,ADC_VREFPOS_EXTPOS_VREFNEG_EXTNEG, ADC_INPUT_A16, false); ADC14_configureConversionMemory(ADC_MEM17,ADC_VREFPOS_EXTPOS_VREFNEG_EXTNEG, ADC_INPUT_A17, false); /* Enabling the interrupt when a conversion on channel 7 (end of sequence) * is complete and enabling conversions */ ADC14_enableInterrupt(ADC_INT17); /* Enabling Interrupts */ Interrupt_enableInterrupt(INT_ADC14); Interrupt_enableMaster(); /* Setting up the sample timer to automatically step through the sequence * convert. */ ADC14_enableSampleTimer(ADC_AUTOMATIC_ITERATION); /* Triggering the start of the sample */ ADC14_enableConversion(); ADC14_toggleConversionTrigger(); /*Set resolution*/ ADC14_setResolution(ADC_14BIT); void ADC14_IRQHandler(void) { uint64_t status; status = MAP_ADC14_getEnabledInterruptStatus(); MAP_ADC14_clearInterruptFlag(status); if(status & ADC_INT17) { MAP_ADC14_getMultiSequenceResult(resultsBuffer); ADC14_getResultArray(ADC_MEM1, ADC_MEM17,resultsBuffer); } }
during ADC IRQ, ADC14_getResultArray(ADC_MEM1, ADC_MEM17,resultsBuffer) and
ADC14_getMultiSequenceResult(resultsBuffer) don't have any result