void adc_Initialize(void)函数里面有错误,通道号写错了,要改成:
ADC_SetRegularGroupSequence(ADC, 1, ADC_CHANNEL_AD0); ///set ADC_CHANNEL_AD0 for AD Sample
ADC_SetRegularGroupSequence(ADC, 2, ADC_CHANNEL_AD1); ///set ADC_CHANNEL_AD1 for AD Sample
ADC_SetRegularGroupSequence(ADC, 3, ADC_CHANNEL_AD2); ///set ADC_CHANNEL_AD2 for AD Sample
ADC_SetRegularGroupSequence(ADC, 4, ADC_CHANNEL_AD3); ///set ADC_CHANNEL_AD3 for AD Sample
ADC_SetRegularGroupSequence(ADC, 5, ADC_CHANNEL_AD4); ///set ADC_CHANNEL_AD4 for AD Sample
ADC_SetRegularGroupSequence(ADC, 6, ADC_CHANNEL_AD5); ///set ADC_CHANNEL_AD5 for AD Sample
ADC_SetRegularGroupSequence(ADC, 7, ADC_CHANNEL_AD6); ///set ADC_CHANNEL_AD6 for AD Sample
ADC_SetRegularGroupSequence(ADC, 8, ADC_CHANNEL_AD7); ///set ADC_CHANNEL_AD7 for AD Sample
ADC_SetRegularGroupSequence(ADC, 9, ADC_CHANNEL_AD8); ///set ADC_CHANNEL_AD8 for AD Sample
ADC_SetRegularGroupSequence(ADC, 10, ADC_CHANNEL_AD9); ///set ADC_CHANNEL_AD9 for AD Sample
ADC_SetRegularGroupSequence(ADC, 11, ADC_CHANNEL_AD10); ///set ADC_CHANNEL_AD10 for AD Sample
ADC_SetRegularGroupSequence(ADC, 12, ADC_CHANNEL_AD11); ///set ADC_CHANNEL_AD11 for AD Sample
ADC_SetRegularGroupSequence(ADC, 13, ADC_CHANNEL_AD12); ///set ADC_CHANNEL_AD12 for AD Sample
ADC_SetRegularGroupSequence(ADC, 14, ADC_CHANNEL_AD13); ///set ADC_CHANNEL_AD13 for AD Sample
ADC_SetRegularGroupSequence(ADC, 15, ADC_CHANNEL_AD14); ///set ADC_CHANNEL_AD14 for AD Sample
ADC_SetRegularGroupSequence(ADC, 16, ADC_CHANNEL_AD15); ///set ADC_CHANNEL_AD15 for AD Sample
|