Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Teensy 4 & rtc_second interrupt

  1. #1
    Member
    Join Date
    Nov 2018
    Location
    Canada
    Posts
    24

    Teensy 4 & rtc_second interrupt

    I've ordered a couple of Teensy 4's, but until I receive them I've been playing around with possible problems I might encounter on current 3.6 programs migrating to 4.0. I use the rtc_second interrupt to trigger a call to rtc_get(), but it looks like the rtc_second interrupt is not currently supported in Teensyduino 147 with the Teensy 4.0.

    Am I missing something? Will it be available for the Teensy 4 in the near future?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,012
    Quick look at the sources and it seems that was a Kinetis (T_3.x) supported interrupt?

    Even less knowing look didn't find the same interrupt pre-Defined on T_4. RM suggests one could be created using one of its features?

  3. #3
    Member
    Join Date
    Nov 2018
    Location
    Canada
    Posts
    24
    Thanks defragster, you've confirmed my suspicions.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,294
    Quote Originally Posted by quadrupel View Post
    Am I missing something? Will it be available for the Teensy 4 in the near future?
    On Teensy 4.0, use attachInterruptVector().

  5. #5
    Member
    Join Date
    Nov 2018
    Location
    Canada
    Posts
    24
    Thanks Paul. Is the vector number 63, the same as for Teensy 3.6? I've looked thru the Teensy4 core code, and I can't find a list of interrupt vectors like the Teensy3 in mk20dx128.c?

  6. #6
    Member
    Join Date
    Nov 2018
    Location
    Canada
    Posts
    24
    Paul, I located attachInterruptVector(), and it answered my question. Actually, in reality, it's made me do a lot more investigation, but what the heck, I don't have the Teensy 4's yet, so I've got time :-)

  7. #7
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,072
    may not be relevant, but here is a sketch that does T4 RTC interrupts ...
    https://github.com/manitou48/teensy4...ster/rtchp.ino

    also see https://forum.pjrc.com/threads/54711...l=1#post195387

  8. #8
    Member
    Join Date
    Nov 2018
    Location
    Canada
    Posts
    24
    Thanks manitou, all I need now are my T4s. There's only so much I can do without actually testing. Fingers crossed they'll arrive next week some time :-)

  9. #9
    Senior Member bmillier's Avatar
    Join Date
    Apr 2016
    Location
    Halifax, N.S. Canada
    Posts
    136
    Quadrapel- I ordered my T4s when Paul announced them last week and they showed up in Eastern Canada today (using the cheap mail shipping option. Regards

  10. #10
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,012
    Quote Originally Posted by manitou View Post
    may not be relevant, but here is a sketch that does T4 RTC interrupts ...
    https://github.com/manitou48/teensy4...ster/rtchp.ino

    also see https://forum.pjrc.com/threads/54711...l=1#post195387
    Doh - ran that sketch in beta - more than once … of course I see 142 sketches in the T4 folder … I was going to mention @manitou … should have searched the sketches ...

  11. #11
    Member
    Join Date
    Nov 2018
    Location
    Canada
    Posts
    24
    Hi bmiller,
    I ordered mine last Thursday, and I just got an email from Robin saying they were shipped today. I live in Edmonton, and typically stuff from PJRC takes 7+ days to get here. Still have lots of prep work to sort out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •