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

Thread: Timer GPT question

  1. #1
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    545

    Timer GPT question

    Is the timer GPT2 used for some internal tasks? Disabling it by setting GPT2_CR to zero crashes the system. GPT1 works as expected.

    Code:
    void setup()
    {
      pinMode(LED_BUILTIN, OUTPUT);
      GPT1_CR = 0; // fine
      GPT2_CR = 0; // crashes Teensy
    }
    
    void loop()
    {
      digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN));
      delay(250);
    }
    I searched the core files but do not find anything using the GPTs so that is quite strange.

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    545
    Ok, seems like the clock for GPT2 is not enabled at startup. Enabling it prior to usage of the timer fixed the issue.

Posting Permissions

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