FlexCAN free running timer clocked by an external time tick

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FlexCAN free running timer clocked by an external time tick

1,012 Views
David_Lindqvist
Contributor II

I would like the free running timer of FlexCAN3 in my MIMXRT1062CVJ5A to be clocked by something other than the baud rate.

CTRL2[TIMER_SRC] indicates that this should be possible, but leaves out all info on how to achieve it.

From other posts it has been suggested that it might be the PIT_TIMER0 that is the mysterious device-specific source of the external time tick. But I haven't had any success at getting the free running timer to tick at all except by the baud rate. Not even when I had all PIT timers running.

I also tried to get the PIT_TRIGGER0 out on pin GPIO_AD_B0_04 by selecting ALT6 in SW_MUX_CTL_PAD_GPIO_AD_B0_04, but no luck there either. The pin stays constantly high. Related?

Has anyone had any luck at getting the timer to spin by something other the baud rate? And if so how?

Labels (1)
0 Kudos
6 Replies

959 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi David, 

Unfortunately, we don't have any examples that do this. I apologize for the inconvenience that this might cause you. There are a couple of things to keep in mind when you want to clock the free-running timer by an external tick. For example:

  • The time tick must be synchronous to the peripheral clock, with a minimum pulse width of one clock cycle.
  • You can only change the TIMER_SRC bit when the module is in Freeze mode. 

Regards, 

Victor

0 Kudos

951 Views
David_Lindqvist
Contributor II

Hi!

  • My peripheral clock (ipg_clk) runs at 120 MHz and the PIT_TIMER is clocked by perclk_clk which in my case is ipg_clk divided by 2 i.e. 60 MHz, so if it is the PIT_TIMER that is the external tick it should have worked already.
  • Since I said my free running timer is stuck at zero (i.e. not clocked by the CAN bit timer) when I am sending/receiving CAN messages, I'm pretty sure I managed to set the TIMER_SRC bit during freeze mode.
  • Could you (NXP) have a look at this particular family of chips (imxrt106x) and see what clock signal is actually connected as external time tick to FLEXCAN3? It clearly states in the reference manual: "See the device-specific section for details about the external time tick", but as I have said I can't find anything more on this. The only thing I have found is that in a completely different family of chips (S32k1xx) the LPIT channel 0, is the external time tick, and in MPC5748G cut 3 it is supposed to be PIT_RTI module channel 14 or 15 depending on flexcan channel. I would like to know if anything is actually connected to this optional external time tick and if so what is it?
0 Kudos

926 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello David, 

You are right, we do mention that there should be more information but we don't provide it. I'm currently checking this internally. I will give you an update as soon as possible. 

Regards, 

Victor 

0 Kudos

896 Views
David_Lindqvist
Contributor II

Hello, @victorjimenez !

Any progress on the update?

BR,

David

0 Kudos

887 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello David, 

I just got the response from the IP owner that the FlexCAN3 interface actually doesn't support this feature. The timestamp is only based on the free-running timer and it cannot be supplied by an external time tick. The reference manual will be updated to remove this information. I apologize for the inconvenience that this might cause you. 

Regards, 

Victor 

0 Kudos

1,005 Views
David_Lindqvist
Contributor II

Oops... Measured the wrong pin. The PIT_TRIGGER0 out on pin GPIO_AD_B0_04 works like a charm. As well as chaining the PIT timers, so nothing wrong with my PIT timers.

0 Kudos