2014-09-25 07:52 PM
This routine to be performed inside the end of conversion ISR,from the function ,we can see that the ext. adc triggeringis disable when the motor state is RUN.So,how can we to trigrer AD conversion for the next time?
/******************************************************************************* * Function Name : SVPWMEOCEvent * Description : Routine to be performed inside the end of conversion ISR It computes the bus voltage and temperature sensor sampling and disable the ext. adc triggering. * Input : None * Output : None * Return : None *******************************************************************************/ u8 SVPWMEOCEvent(void) { // Store the Bus Voltage and temperature sampled values h_ADCTemp = ADC_GetInjectedConversionValue(ADC2,ADC_InjectedChannel_2); h_ADCBusvolt = ADC_GetInjectedConversionValue(ADC1,ADC_InjectedChannel_2); if ((State == START) || (State == RUN)) { // Disable EXT. ADC Triggering ADC1->CR2 = ADC1->CR2 & 0xFFFF7FFF; } return ((u8)(1)); } void ADC1_2_IRQHandler(void) { //if(ADC_GetITStatus(ADC1, ADC_IT_JEOC) == SET)) if((ADC1->SR & ADC_FLAG_JEOC) == ADC_FLAG_JEOC) { //It clear JEOC flag ADC1->SR = ~(u32)ADC_FLAG_JEOC; if (SVPWMEOCEvent()) { ......2014-09-29 12:05 AM
Ciao Murphy Ding
Usually the ADC triggering is enabled during the update event of the timer (when the counter reach zero). Ciao Gigi2014-10-01 01:26 AM
Ciao Gigi:
Thank you very much for your reply,i have found the reason.