Using K60 Enet to generate and receive PPS

cancel
Showing results for 
Search instead for 
Did you mean: 

Using K60 Enet to generate and receive PPS

715 Views
jesperevertsson
Contributor IV

Hi, I have some questions about the IEEE 1588 module of the MAC in the Kinetis K60. In the chapter 47.5.10.5 in the K60 reference manual there is a description of something called Input Capture and Output Compare. In the K60 pin assignment table I can see that there are 4 pins on the cpu related to this named ENET0_1588_TMR0 to ENET0_1588_TMR3. What I don't quite understand is if it is one timer with four pins or if it is four separate timers.

Anyhow, we would like to use two of these pins to genrerate an exact pps pulse on, and use the other one to receive a pps pulse and sync our own module from it. Can both those functionalities be used at the same time? (Input capture and Output compare). I also can't figure out how to configure them to work in the different modes.

EDIT:

I've done some tinkering with the registers but I still can't get it to work. What I've done is:

  • Configured Pin PTB2 for ALT4 which is ENET0_1588_TMR0
  • Set ENET_ATCR[EN] to 1
  • Set ENET_ATINC[INC] to 20 (50 MHz clock)
  • Set ENET_ATPER[PERIOD] to 1 000 000 000
  • Set ENET_TCSR0[TMODE] to 5 (Output compare - toggle output on compare)
  • Set ENET_TCCR0[TCC] to 1 000 000 000

I have also rebuilt MQX with the ENETCFG_SUPPORT_PTP flag set in user_config.h.I expected this to give me a pin that toggles once/second but nothing happens. Is there something I've forgotten?

Tags (2)
0 Kudos
5 Replies

202 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi jesper,

MQX provides IEEE 1588 library and examples. Please see attached video showing where to get it.


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

202 Views
jesperevertsson
Contributor IV

I know about the 1588 libraries but they don't show how to use the ENET0_1588_TMRX functionality.

0 Kudos

202 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Jesper,

what K60 version are you using? I don't find the chapter you refer to in the reference manual.

Regards,

Carlos

0 Kudos

202 Views
jesperevertsson
Contributor IV

I may have used an old revision of the K60 manual. I also made a new post since I made some progress and then ran in to a new problem. Could you take a look at it? Problems using certain modes for Output Compare on K60 ENET_TMR

In the K60 Sub-Family Reference Manual, Rev. 3, November 2014 the chapter I've used and where I've ran into problem is 47.4.95 Timer Control Status Register(ENET_TCSRn)

0 Kudos

202 Views
Carlos_Musich
NXP Employee
NXP Employee

Ok,

I will take a look.

Carlos

0 Kudos