Part Number: MSP432P401R Tool/software: Code Composer Studio CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48); CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_2); ADC14_enableModule(); ADC14_initModule(ADC_CLOCKSOURCE_SMCLK,ADC_PREDIVIDER_4,ADC_DIVIDER_5,0); //40K ADC14_setSampleHoldTrigger(ADC_TRIGGER_ADCSC ,false); ADC14_setSampleHoldTime(ADC_PULSE_WIDTH_64,ADC_PULSE_WIDTH_16); /* Configuring GPIOs (5.4 A1) */ GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN7|GPIO_PIN6, GPIO_TERTIARY_MODULE_FUNCTION); P8SEL1|=BIT6; P8SEL0|=BIT6; /* Configuring ADC Memory */ MAP_ADC14_configureSingleSampleMode(ADC_MEM0, true); MAP_ADC14_configureConversionMemory(ADC_MEM0, ADC_VREFPOS_EXTPOS_VREFNEG_EXTNEG, ADC_INPUT_A19, false); /* Configuring Sample Timer */ ADC14_enableSampleTimer(ADC_MANUAL_ITERATION); //ADC14_enableSampleTimer(ADC_AUTOMATIC_ITERATION); /* Enabling/Toggling Conversion */ MAP_ADC14_enableConversion(); MAP_ADC14_toggleConversionTrigger(); /* Enabling interrupts */ MAP_ADC14_enableInterrupt(ADC_INT0); MAP_Interrupt_enableInterrupt(INT_ADC14); MAP_Interrupt_enableMaster(); /*Set resolution*/ ADC14_setResolution(ADC_14BIT); ADC14_setSampleHoldTime(ADC_PULSE_WIDTH_64,ADC_PULSE_WIDTH_16),this configration does influence ADC sample rate,does it mean ADC sample rate 48M/2/4/5/(64+16)=15KHz? and what difference between ADC14_enableSampleTimer(ADC_MANUAL_ITERATION) and ADC_AUTOMATIC_ITERATION?
↧