Teensy 3.6: interrupt configured for falling edges fires on both edges

Status
Not open for further replies.
I'm working with Teensy 3.6 and I set the interrupt function with the following simple code:
attachInterrupt(digitalPinToInterrupt(RPM_Pin), RPM_PulseTimeDifference, FALLING);
I'm using a signal generator to send a square wave to the RPM_Pin, and check it with the oscilloscope. I found that the interrupt on that pin, fires on both the rising and falling edges, as if I had set the interrupt with the CHANGE option instead of FALLING.
Am I missing some info about the interrupts on Teensy 3.6?
 
That "shouldn't happen", but how do you know it is also triggering on the rising edge?
Post some demo code.

Pete
 
does the tick count from this sketch increase by 1000 each second? (jumper pin 12 to pin 23)
Code:
volatile uint32_t ticks;

void ding() {
  ticks++;
}
void setup() {
  while (!Serial);
  analogWriteFrequency(23, 1000);    //jumper 23 to 12
  analogWrite(23, 128);
  attachInterrupt(12, ding, FALLING);
}

void loop() {
  Serial.println(ticks);
  delay(1000);
}

try counting ticks with your signal generator.
 
I'm running that test here. Indeed it is incrementing 1000 times per second, so only 1 interrupt per cycle.

sc.png
 
Status
Not open for further replies.
Back
Top