Skip to main content
1205336750
Associate
September 26, 2014
Question

u8 SVPWMEOCEvent(void) function in motor library V2.0

  • September 26, 2014
  • 2 replies
  • 583 views
Posted on September 26, 2014 at 04:52

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())

{

......

This topic has been closed for replies.

2 replies

Gigi
ST Employee
September 29, 2014
Posted on September 29, 2014 at 09:05

Ciao Murphy Ding

Usually the ADC triggering is enabled during the update event of the timer (when the counter reach zero).

Ciao

Gigi

1205336750
Associate
October 1, 2014
Posted on October 01, 2014 at 10:26

Ciao Gigi:

Thank you very much for your reply,i have found the reason.