Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction for enet_ieee1855_adjust_timer #57

Open
wants to merge 2 commits into
base: ieee1588-2
Choose a base branch
from

Conversation

SavilleBelcher
Copy link

Thank you for all your work on this library. This branch has been essential in my project.
Found an error when creating a AES67 teensy project. Also added a define for the interrupt enable for the compare timers.

add define to enable interrupt for compare timer TCSR_TIE.
Corrected enet_ieee1588_adjust_timer with ENET_ATINC_INC_CORR
added interrupt enable to set channel
@ssilverman
Copy link
Owner

ssilverman commented Nov 17, 2023

Thanks for the information. (Side note: I've been maintaining a separate IEEE 1588 branch locally that is far ahead of this one because it's rebased on top of the latest master. It also has some other fixes.)

I'm so glad it's helping your project! :)

Some questions as I look into this flag:

  1. Is the "TIE" interrupt connected to the regular ENET interrupt flags? (ENET_EIR) i.e. if the TF flag in TCSR is set, will the main Ethernet ISR get called?
  2. This interrupt is related to input capture and output compare?
  3. How is the TIE interrupt helping your project?

One other note is that I don't consider the input capture or output compare code complete. :)

@SavilleBelcher
Copy link
Author

No problem, I am somewhat new to the microcontroller world, so I am glad to help anyway I can.

  1. The TIE interrupt is connected to the IRQ_ENET_TIMER (115) for the teensy 4.1. The information in the reference manual is not
    very detailed on it.

  2. yes, the TIE is set with the compare flag. see 41.3.10.6 of reference manual

  3. I was trying to use the interrupt to trigger my RTP audio packet to send at exactly 1 millisecond intervals of the ptp clock. I got it to work, but I keep getting an error and rebooting randomly. I originally started by just using the output compare flag, so I just went back to that and have not had anymore problems. I didn't look to much in to the reboots yet, because using the flag was working just fine. I am also not that familiar with interrupts yet. I just though having it enabled allows the option to use it, but there may be a downside to having it enabled all the time that I am unaware of.

I would love to try your more updated version of the IEEE1855 branch if you don't mind sharing. I was thinking of trying to bring this fork up to date with the master, but this is my first time ever commenting/contributing to GitHub. I use your master for another sketch as a webserver for display sensor data and to control some LEDs, and it works great. I was using NativeEthernet but I was getting random reboots from an error in the fnet code.

@ssilverman
Copy link
Owner

I haven't forgotten about this. When I next have a chance, I'll have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants