#include "stm32f10x.h" #define ADC1_DR_Address ((u32)0x4001244C) void TIM1_UP_IRQHandler(void) { round1++; TIM_ClearITPendingBit(TIM1, TIM_IT_Update); } void TIM2_IRQHandler(void) { TIM_ClearITPendingBit(TIM2, TIM_IT_Update); ADC_SoftwareStartConvCmd(ADC1,ENABLE); // while(!(ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC))); while(!(DMA_GetFlagStatus(DMA1_FLAG_TC1))); adc_current=adc_value[0]; adc_voltagea=adc_value[1]; adc_voltageb=adc_value[2]; // while(!times); // while(!(times==3)); // times=0; DMA_ClearFlag(DMA1_FLAG_TC1); // ADC_ClearFlag(ADC1, ADC_FLAG_EOC); i++; LED_on; if(i==7) { i=0; Max_cu=adc_current[0]; Min_cu=adc_current[0]; sum_cu=adc_current[0]; Max_voa=adc_voltagea[0]; Min_voa=adc_voltagea[0]; sum_voa=adc_voltagea[0]; Max_vob=adc_voltageb[0]; Min_vob=adc_voltageb[0]; sum_vob=adc_voltageb[0]; for(i=1;iMax_cu) Max_cu=adc_current; if(adc_currentMax_voa) Max_voa=adc_voltagea; if(adc_voltageaMax_vob) Max_vob=adc_voltageb; if(adc_voltageb |
RE:ADC+DMA采集三通道AD值不对,代码如下,求大神解答!