AnsweredAssumed Answered

PTP PPS output on stm32f407

Question asked by avelino.renato on Sep 30, 2014
Latest reply on Oct 2, 2014 by waclawek.jan
Hello


I have a STM32F407ZGT6, silicon revision Z, and I'm trying to generate a 1PPS output (Pulse Per Second) on pin PG8, using the PTP. The PTP is working fine, correctly timestamping the PTP packets. 
In the reference manual (RM0090, rev. 7), there is a section called "PTP pulse-per-second output signal", and it says:


"The PPS output is enabled through bits 11 and 10 in the TIM2 option register (TIM2_OR)."


However, in the description of the TIM2_OR, there isn't an option to activate the PTP PPS:


Bits 11:10 ITR1_RMP: Internal trigger 1 remap
    Set and cleared by software.
    00: TIM8_TRGOUT
    01: PTP trigger output is connected to TIM2_ITR1
    10: OTG FS SOF is connected to the TIM2_ITR1 input
    11: OTG HS SOF is connected to the TIM2_ITR1 input
     
but these bits only control the TIM2_ITR1.


Still, I tried to set the bits to 00, 01, 10 and 11, without success. The code I'm using is:


     RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);


     // Configure pin PG8 = PTP PPS Out
     GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_8;
     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
     GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;
     GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
     GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_NOPULL;
     GPIO_Init(GPIOG, &GPIO_InitStructure);
     GPIO_PinAFConfig(GPIOG, GPIO_Pin_8, GPIO_AF_ETH);
     
     RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);
     TIM_DeInit(TIM2);
     
     TIM_RemapConfig(TIM2, TIM2_ETH_PTP);
     
Can anyone help me?

Outcomes