我已成功的 用TIME1 TRGO 来控制ADC1的启动!
ADC1_DeInit();
//////////////////////////////////////
_asm("rim");
////////////////////////////////////
/* Configure the conversion mode and the channel to convert */
ADC1_ConversionConfig(ADC1_CONVERSIONMODE_SINGLE, ADC1_CHANNEL_4, ADC1_ALIGN_LEFT);
/* Configure the schmitt trigger channel and state */
ADC1_SchmittTriggerConfig(ADC1_SCHMITTTRIG_ALL, DISABLE);
ADC1_DataBufferCmd(ENABLE); //CR3_DBUF
ADC1_ScanModeCmd(ENABLE); //CR2_SCAN
/* Enable the ADC2 peripheral */
ADC1_Cmd(ENABLE); //CR1_ADON
/* Enable EOC interrupt */
ADC1_ITConfig(ADC1_IT_EOCIE, ENABLE); //ADC1_IT
/* Configure the TIM1 Master/Slave mode */
TIM1_SelectMasterSlaveMode(ENABLE);
/*Configure the ADC2 external trigger */
ADC1_ExternalTriggerConfig(ADC1_EXTTRIG_TIM, ENABLE);
/* Trigger the conversion */
TIM1_SelectOutputTrigger(TIM1_TRGOSOURCE_UPDATE);
TIM1_Cmd(ENABLE);
我设置成单次扫瞄,但我采到数据为0. 只有ADC_DB0R有数据变化。
我看了资料,只有单次模式是能用TRGO来控制。
单次扫瞄模式,不知道可不可以用TRGO来触发! |