• AVR Freaks

Hot!Precision Time Protocol PTP IEEE1588

Author
domble
Super Member
  • Total Posts : 156
  • Reward points : 0
  • Joined: 2007/01/25 04:11:53
  • Location: UK
  • Status: offline
2020/06/11 05:05:43 (permalink)
4 (1)

Precision Time Protocol PTP IEEE1588

Customer has specced a system with PTP IEEE-1588 timestamping of data.  The data in question is at a low rate and nanosecond or microsecond accuracy isn't needed. 
 
I know that TI have a PTP demo app for their processors, but I'd rather not have to learn a new processor family / IDE / hardware. 
 
Can anyone point me towards a PTP implementation for PIC32 Harmony?
 
Thanks
Dominic.
 
#1

6 Replies Related Threads

    magnusbc
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2020/09/18 01:35:14
    • Location: 0
    • Status: offline
    Re: Precision Time Protocol PTP IEEE1588 2020/09/21 23:35:11 (permalink)
    0
    Hi Dominic,
     
    I am trying to achieve something similar, have you had any luck with getting PTP to work?
    #2
    domble
    Super Member
    • Total Posts : 156
    • Reward points : 0
    • Joined: 2007/01/25 04:11:53
    • Location: UK
    • Status: offline
    Re: Precision Time Protocol PTP IEEE1588 2020/09/29 09:01:42 (permalink)
    0
    I haven't. I'm sure there's some on here who would 'simply' port the ptpd linux code into PIC32, but that's not me. 
     
    And it turns out that the Texas chip (F28M35H52C) we've selected has demo code for PTP.  But it's PTP v1 (2002) not the current PTP v2 (2008), and the two are incompatible. 
     
    So... I'm rather at a loss too.  The Texas chip is a dual core beasty (Texas C28 family with an ARM Cortex M3 alongside it) with fancy shared memory comms between the two cores.  But it seems to be unsupported by current versions of Texas libraries and code examples, and it seems Microchip and Texas compete to see who can hide their documentation the best.  Texas Code Composer Studio is free, and very mplabx like, but I can't prove as yet if it's any better or worse.  Texas support pointed me to a newer version of the processor (TMS320F2838x family) .  But... can't buy it, and it's a 337 ball BGA so we couldn't prototype it easily either.
     
    BTW. The NTP code in Harmony 3 for the PIC32 seemed to work well for a previous project.  Literally a drag and drop to make that work.
     
    dom.
    post edited by domble - 2020/09/29 09:07:06
    #3
    Mysil
    Super Member
    • Total Posts : 3796
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: Precision Time Protocol PTP IEEE1588 2020/09/29 11:57:31 (permalink)
    0
    Hi,
    According to Wikipedia, https://en.wikipedia.org/..._implementations 
    Microsemi which is a Microchip company have done some PTP stuff.
    I do not know if there is something you can use.
     
        Mysil
    post edited by Mysil - 2020/09/29 12:00:16
    #4
    domble
    Super Member
    • Total Posts : 156
    • Reward points : 0
    • Joined: 2007/01/25 04:11:53
    • Location: UK
    • Status: offline
    Re: Precision Time Protocol PTP IEEE1588 2020/09/30 01:50:23 (permalink)
    3 (1)
    They do, but it's all physical network sort of devices - switches and PHYs with PTP timestamping - but as far as I can find no ready made examples or libraries for any of that in PIC32 land.
     
    dom.
     
    #5
    Mysil
    Super Member
    • Total Posts : 3796
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: Precision Time Protocol PTP IEEE1588 2020/09/30 05:51:48 (permalink)
    0
    Hi,
    As far as I understand, and assuming that the customer already have PTP in use and Master clock available,
    In order to run a ordinary Slave clock, only UDP/IP application code should be needed.
    This should be all C code, with little need to be different from application code for other platforms.
     
    Doing a search on GitHub, there is more than a dozen hits, including one implementation for PIC32MX
    https://github.com/ab1aw/PTP4PIC
     
    Since Microchip seem to be trying to get into the market of precision frequency and time,
    you might try to challenge their Sales staff to provide an example for a end user timestamp clock.
     
        Mysil
    #6
    domble
    Super Member
    • Total Posts : 156
    • Reward points : 0
    • Joined: 2007/01/25 04:11:53
    • Location: UK
    • Status: offline
    Re: Precision Time Protocol PTP IEEE1588 2020/09/30 07:15:30 (permalink)
    4 (1)
    Ok. I clearly need a lesson in how to search on GitHub! 

    That code looks like a single file, and perhaps even possible for me to understand (looks like the diagrams on how PTP works) as compared to the daunting number of files in the linux ptpd source...
     
    I might have to be attempting to insert that in our previous (Harmony3, NTP) project to add PTP (will have to go software timestamp as not using a PTP hardware PHY) and make the customer happy (that particular one doesn't actually need the precision, but customer wants to standardise on PTP).
     
    Would be nice if Microchip could add it into Harmony3 especially as I think I noticed some of their PHY drivers in Harmony already support the hardware timestamping.
     
    dom.
     
    #7
    Jump to:
    © 2020 APG vNext Commercial Version 4.5