This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Failure to DP83640's PPS setting

Other Parts Discussed in Thread: DP83640

Hi BU team

One customer wanted to output PPS signal by GPIO but it didn't work.

Below was the code. Would you help check it and share your comments?

Thanks

uint8 DP83640_SetPPS(void)
{
    uint32 value0 = 0;
    
    //-----------------------------------------------------------------
    //-----  1、关闭TRIGGER
    
    //-----  1.1 设置页地址
    DP83640_SetPage(PAGE4);
    
    //-----  1.2 读取配置寄存器
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_CTL, &value0);
    
    //-----  1.3 写地址,关闭TRIGGER
    value0 |= PTP_TRIG_DIS;
    
    HAL_ETH_WritePHYRegister(&EthHandle, PTP_CTL, value0);
    
    //-----------------------------------------------------------------   
    //-----  2、配置TRIGGER
    DP83640_SetPage(PAGE5);
    
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_TRIG, &value0);
    
    //-----  2.1 选择IO 、源、写、周期信号
    value0 |= (TRIG_GPIO4 + TRIG_CSEL0 + TRIG_WR + TRIG_PER);
    
    HAL_ETH_WritePHYRegister(&EthHandle, PTP_TRIG, value0);
    
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_TRIG, &value0);
    
    //-----------------------------------------------------------------   
    //-----  3、使能TRIGGER
    //-----  3.1 设置页地址
    DP83640_SetPage(PAGE4);
    
    //-----  3.2 读取配置寄存器
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_CTL, &value0);
    
    //-----  3.3 写地址,使能TRIGGER
    value0 |= (PTP_TRIG_EN + PTP_TRIG_SEL0);
    
    HAL_ETH_WritePHYRegister(&EthHandle, PTP_CTL, value0);
    
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_CTL, &value0);
    
    
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_TSTS, &value0);
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_TSTS, &value0);
    HAL_ETH_ReadPHYRegister(&EthHandle, PTP_TRIG, &value0);
    
}
  • Ted,

    What configuration is performed before they try to generate the PPS?  What is the current PTP time when they configure the trigger?  For what time is the trigger set to expire?

    Please note that we have detailed information on the configuration and some example code available on-line at:

    http://www.ti.com/lit/zip/snlc036

    We should make sure that the customer has reviewed this information.  It could be helpful in their efforts to configure the device.

    Patrick