imx1170 ENET IRQHandler

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx1170 ENET IRQHandler

1,861件の閲覧回数
Haha_plum
Contributor II

      Recently I had some problems with the ENET 1588 timer, I set the timer to output comparison mode, but I looked at the manual and found that the ENET module only has two timestamp related interrupts, Transmit Timestamp Available and Timestamp Timer, corresponding to the ENET_TimeStampIRQHandler() and ENET_ TransmitIRQHandler() in enet.c , and ENET_TimeStampIRQHandler can only enter once a second for second timing, I want to implement multiple comparisons for one channel in a second. I currently found another function ENET_Ptp1588IRQHandler(), I want to know ENET_Ptp1588IRQHandler() and ENET_ TimeStampIRQHandler() and how to achieve the above multiple output comparisons.

Looking forward to answers

0 件の賞賛
返信
5 返答(返信)

1,802件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @Haha_plum ,

You can add code in ENET_Ptp1588Handler() directly. Check TCSRn[TF]. If it is set, it indicate that an output compare has occurred.

We haven't such sample code.

 

Regards,

Jing

0 件の賞賛
返信

1,698件の閲覧回数
Haha_plum
Contributor II

@jingpan 

    Hi,I'm so sorry to disturb you again after such a long time.Continuing with the previous description.

    Is the interrupt corresponding to 142 in the interrupt vector table a comparison interrupt of ptp1588 timer? What does the explanation of MAC 0 1588 Timer Interrupt synchronous correspond to 142 in the interrupt vector table in the figure?

Haha_plum_0-1702867051568.png

 

0 件の賞賛
返信

1,793件の閲覧回数
Haha_plum
Contributor II

Hi,@jingpan

 I will give it a try.

 Thank you for your reply.

 

0 件の賞賛
返信

1,835件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @Haha_plum ,

Have you referred to enet_txrx_ptp1588_transfer demo in SDK? ENET_Ptp1588IRQHandler() and TimeStampIRQHandler() has been enabled in ENET_Ptp1588ConfigureHandler().

ENET_EnableInterrupts(base, (ENET_TS_INTERRUPT | ENET_TX_INTERRUPT));

The  ENET_TS_INTERRUPT is ((uint32_t)kENET_TsTimerInterrupt | (uint32_t)kENET_TsAvailInterrupt).

These two source will generate interrupt and call ENET_Ptp1588IRQHandler(). And ENET_Ptp1588IRQHandler will call TimeStampIRQHandler().

ENET module has 4 TCC register will has compare function.When the ENET free-running counter value matches the output compare reference value in the TCCRn register, the corresponding flag, TCSRn[TF], is set, indicating that an output compare has occurred. The corresponding interrupt, if enabled by TCSRn[TIE], will be generated. Please see 60.3.8.6.2 in reference manual.

 

Regards,

Jing

0 件の賞賛
返信

1,824件の閲覧回数
Haha_plum
Contributor II

@jingpan 

Hi,jing.

    Thank you very much for your reply.

    I have referred to the demo in SDK.As you said, ENET_ Ptp1588IRQHandler is triggered and only  appears TS_ AVAIL or the adjustable timer reached the period event.Then ENET_Ptp1588IRQHandler will call TimeStampIRQHandler(). 

   I know the mechanism of TCCRn and TCSRn register.

   For example, what I want to achieve is to set a GPIO to 1 after the first comparison on a channel, then set the second comparison value, reverse the GPIO, and then set the last comparison value. If these comparison values are separated by 100000 (1588timer cycle is 10 ^ 9=1s), and the corresponding comparison interrupts are generated, where should I write these codes? TimeStampIRQHandler() is triggered every second, which cannot meet my requirements, So I should put it in ENET_Ptp1588IRQHandler() or other functions?

    Looking forward to your reply.

    With best wishes!

 

0 件の賞賛
返信