你好,我按照下面配置多通道ADC读取的时候,ADC12_B_MEMORY_0的中断可以进去,但是ADC12_B_MEMORY_1的中断一直进不去,麻烦帮忙看下是怎么回事,谢谢。
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,GPIO_PIN0,GPIO_TERNARY_MODULE_FUNCTION);
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,GPIO_PIN1,GPIO_TERNARY_MODULE_FUNCTION);
GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1,GPIO_PIN1,GPIO_TERNARY_MODULE_FUNCTION);
ADC12_B_configureMemoryParam configureMemoryParam = {0};
configureMemoryParam.memoryBufferControlIndex = ADC12_B_MEMORY_0;
configureMemoryParam.inputSourceSelect = ADC12_B_INPUT_A0;
configureMemoryParam.refVoltageSourceSelect = ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS;
configureMemoryParam.endOfSequence = ADC12_B_NOTENDOFSEQUENCE;
configureMemoryParam.windowComparatorSelect = ADC12_B_WINDOW_COMPARATOR_DISABLE;
configureMemoryParam.differentialModeSelect = ADC12_B_DIFFERENTIAL_MODE_DISABLE;
ADC12_B_configureMemory(ADC12_B_BASE, &configureMemoryParam);
ADC12_B_configureMemoryParam configureMemoryParam1 = {0};
configureMemoryParam1.memoryBufferControlIndex = ADC12_B_MEMORY_1;
configureMemoryParam1.inputSourceSelect = ADC12_B_INPUT_A1;
configureMemoryParam1.refVoltageSourceSelect = ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS;
configureMemoryParam1.endOfSequence = ADC12_B_NOTENDOFSEQUENCE;
configureMemoryParam1.windowComparatorSelect = ADC12_B_WINDOW_COMPARATOR_DISABLE;
configureMemoryParam1.differentialModeSelect = ADC12_B_DIFFERENTIAL_MODE_DISABLE;
ADC12_B_configureMemory(ADC12_B_BASE, &configureMemoryParam1);
configureMemoryParam.memoryBufferControlIndex = ADC12_B_MEMORY_0;
configureMemoryParam.inputSourceSelect = ADC12_B_INPUT_A0;
configureMemoryParam.refVoltageSourceSelect = ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS;
configureMemoryParam.endOfSequence = ADC12_B_NOTENDOFSEQUENCE;
configureMemoryParam.windowComparatorSelect = ADC12_B_WINDOW_COMPARATOR_DISABLE;
configureMemoryParam.differentialModeSelect = ADC12_B_DIFFERENTIAL_MODE_DISABLE;
ADC12_B_configureMemory(ADC12_B_BASE, &configureMemoryParam);
ADC12_B_configureMemoryParam configureMemoryParam1 = {0};
configureMemoryParam1.memoryBufferControlIndex = ADC12_B_MEMORY_1;
configureMemoryParam1.inputSourceSelect = ADC12_B_INPUT_A1;
configureMemoryParam1.refVoltageSourceSelect = ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS;
configureMemoryParam1.endOfSequence = ADC12_B_NOTENDOFSEQUENCE;
configureMemoryParam1.windowComparatorSelect = ADC12_B_WINDOW_COMPARATOR_DISABLE;
configureMemoryParam1.differentialModeSelect = ADC12_B_DIFFERENTIAL_MODE_DISABLE;
ADC12_B_configureMemory(ADC12_B_BASE, &configureMemoryParam1);
ADC12_B_clearInterrupt(ADC12_B_BASE, 0, ADC12_B_IFG0|ADC12_B_IFG1);
ADC12_B_enableInterrupt(ADC12_B_BASE, ADC12_B_IE0|ADC12_B_IE1, 0, 0);
ADC12_B_enableInterrupt(ADC12_B_BASE, ADC12_B_IE0|ADC12_B_IE1, 0, 0);
ADC12_B_startConversion(ADC12_B_BASE, ADC12_B_MEMORY_0, ADC12_B_SINGLECHANNEL);
ADC12_B_startConversion(ADC12_B_BASE, ADC12_B_MEMORY_1, ADC12_B_SINGLECHANNEL);
ADC12_B_startConversion(ADC12_B_BASE, ADC12_B_MEMORY_1, ADC12_B_SINGLECHANNEL);
灰小子:
你用的哪一款msp430?
灰小子:
你好,你用的那个msp430?能否上传工程,我试试
Daryl Wei:
回复 灰小子:
您好,我使用的是msp430FR5969,附件是工程,使用的如下图所示的工程,同时使用A0(使用memory_0)、A1(使用memory_1)做ADC读取,A0可以正常读取,A1无法读取,麻烦帮忙看看,谢谢。
Daryl Wei:
回复 灰小子:
请问这个可以了吗?