cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the SOF pulse for the STM32F407 USB FS

chandu1
Associate II
Posted on August 07, 2014 at 11:00

Hi every one,

I'm working with the STM32F407 USB in FS mode, I want to see the SOF pulse but it is haveing some problem, I don't understand how to configure the timer and how to check the output. My timer and GPIO configurations are:

/* SOF Pin configuration */
GPIO_PIN_DATA_t st_gGpio_SofPinData =
{
.en_mPort = GPIO_PORTA,
.u8_mAltFunction = GPIO_AF_OTG_FS,
.u8_mMode = GPIO_MODE_AF,
.u8_mOutType = GPIO_OTYPE_PP,
.u8_mPin = PORT_PIN8,
.u8_mPupdOpt = GPIO_PUPD_NOPULL,
.u8_mSpeed = GPIO_SPEED_100MHz
};

/* Timer data for SOF */
ST_TIM_COMPARE_PARAMS_t st_gSofDelayParams =
{
.en_mChannel = TIMx_CHANNEL_1,
.en_mOCMode = TIMx_OC_MODE_PWM1,
.en_mOutputState = TIMx_ENABLE,
.u32_lFrequency = 1000,
.u32_lDutyCycle = 50,
.en_mOCPolarity = TIMx_POLARITY_HIGH,
};

I'm configured the timer for 1ms interrupt and enabled the ITR1_RMP bit in the Timer register and then enabled the SOFOUTEN bit in global control and configuration register. But i don't observe any pulse on the pin PA8, can any one explain about this my testing procedure is correct or wrong, please explain me correct testing procedure for observe SOF pulse on the PA8 pin. Thanks & Regards, Chandu.Kurapati. #stm32f407 #stm32f407 #usb-fs #fs #sof-pulse #sof #check #usb
1 REPLY 1
chandu1
Associate II
Posted on August 13, 2014 at 07:51

Hi every one,

To check the SOF just enable the clock for the timer 2 and enable the OTG FS bit in the timer registers. for the SOF process every 1 ms we get the pulse it contain 12 clock cycles check that one clock pulse width and compare with your clock frequency.

Thanks & Regards,

Chandu.kurapati.