Hi, I have some questions about the IEEE 1588 module of the MAC in the Kinetis K60. In the chapter 126.96.36.199 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.
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?