D21G Timers

Trying to follow

https://industruino.com/blog/our-news-1/post/d21g-timer-library-33#blog_content

but it seems to be a little outdated on the changing of the Adafruit_ZeroTimer.cpp

line numbers don't seem to match up.

So wondering what is the current status?

Josh Nijenhuis
Josh Nijenhuis
34
| 2 1 1
Asked on 1/18/19, 1:23 AM
0
vote
1913 Views

Hi, indeed i see Adafruit has upgraded the library to include other SAMD boards now; the version i used for that blog post is still available at https://github.com/adafruit/Adafruit_ZeroTimer/releases/tag/1.0.0 

For reference i paste the updated section below. With this info i think it will not be difficult to update the latest version of the .cpp if you prefer to use that.

extract of Adafruit_ZeroTimer.cpp (version 1.0.0 modified for Industruino D21G)::

    if (_timernum == 3) {

      if (channum == 0) {

if (pin == 10) {

  pinout = PIN_PA18E_TC3_WO0; pinmux = MUX_PA18E_TC3_WO0;

}

if (pin == 2) {

  pinout = PIN_PA14E_TC3_WO0; pinmux = MUX_PA14E_TC3_WO0;

}

      } 

      if (channum == 1) {

if (pin == 0) {   // TT was 12   *******************************************

  pinout = PIN_PA19E_TC3_WO1; pinmux = MUX_PA19E_TC3_WO1;

}

if (pin == 5) {

  pinout = PIN_PA15E_TC3_WO1; pinmux = MUX_PA15E_TC3_WO1;

}

      } 

    }

 

    if (_timernum == 4) {

      if (channum == 0) {

if (pin == 20) { // a.k.a SDA

  pinout = PIN_PA22E_TC4_WO0; pinmux = MUX_PA22E_TC4_WO0;

}

//#if defined(__SAMD21G18A__)                                          // ***********

// if (pin == A1) {

//   pinout = PIN_PB08E_TC4_WO0; pinmux = MUX_PB08E_TC4_WO0;

// }

//#endif // ***********

      } 

      if (channum == 1) {

if (pin == 21) {  // a.k.a SCL

  pinout = PIN_PA23E_TC4_WO1; pinmux = MUX_PA23E_TC4_WO1;

}

#if defined(__SAMD21G18A__)

if (pin == 6) {    // TT was A2   **************************************************

  pinout = PIN_PB09E_TC4_WO1; pinmux = MUX_PB09E_TC4_WO1;

}

#endif

      } 

    }

Tom
Tom
5675
| 1 1 3
Answered on 1/18/19, 6:23 AM
0
vote

Thanks, Will give it a try this weekend

Josh Nijenhuis
on 1/18/19, 1:19 PM






Ciao, sono fuori ufficio per motivi di salute, vi risponderò al mio rientro: 21/1. Per urgenze contattatemi al cellulare.

 

Thank you for your email. Due to sickness, I am currently out of the office and will probably be back on 21/1. I apologize for the delay and any inconvenience.
In urgent cases, please call me on my mobile.
Best regards
fabrizio
on 1/18/19, 1:19 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

54 follower(s)

Stats

Asked: 1/18/19, 1:23 AM
Seen: 1913 times
Last updated: 1/18/19, 6:23 AM