0

I'm trying to generate PPS signals for PTP synchronization using stm32f429 microcontroller.

I configured GPIOG 8 pin as AF pin and TIM2 as SLave in trigger mode with ITR1 trig source.

TIM_TimeBaseInitTypeDef tim_pps; GPIO_InitTypeDef gpio_pps;

RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE); RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);

// Configure pin PG8 = PTP PPS Out
gpio_pps.GPIO_Pin   = GPIO_Pin_8;
gpio_pps.GPIO_Speed = GPIO_Speed_100MHz;
gpio_pps.GPIO_Mode  = GPIO_Mode_AF;
gpio_pps.GPIO_OType = GPIO_OType_PP;
gpio_pps.GPIO_PuPd  = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOG, &gpio_pps);
GPIO_PinAFConfig(GPIOG, GPIO_PinSource8, GPIO_AF_ETH);

TIM_DeInit(TIM2);

TIM_RemapConfig(TIM2, TIM2_ETH_PTP);

TIM_TimeBaseStructInit(&tim_pps);
tim_pps.TIM_Period = 0;
TIM_TimeBaseInit(TIM2, &tim_pps);

TIM_SelectSlaveMode(TIM2, TIM_SlaveMode_Trigger);
TIM_SelectInputTrigger(TIM2, TIM_TS_ITR1);    

TIM_Cmd(TIM2, ENABLE);

But i have no signal on PG8. What can you suggest?

1 Answer 1

0

If you set TIM_Period = 0 - so your timer won't work.

It is good practice to read datasheets for understand hardware limitations. Open reference manual according to your MCU and see description of TIM1_ARR register.

usual TIM_ARR description

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.