HARDWARE INTERRUPT PIN NOT WORKING ON TEENSY 4.1

Rennie Johnson

Active member
I am sending quadrature encoder inputs into a T4.1. The 'A' signal goes to D3, 'B' goes to D4, and 'I' goes to D32. The A/B pins work fine. The D32 interrupt does not fire. I checked signals and levels, all OK. Then I jumpered the Index signal to pin D17, and it works just fine.

I've manufactured a lot of these boards, and assembled 10 of them, so I really need D32 to work. I have fully used all easily available pins on the T4.1 pin headers. Can anyone suggest what the problem might be? Could there be a conflict with other pins on the same bus as 32? Is it an interrupt priority issue?

Very confused.
 
Last edited:
I am sending quadrature encoder inputs into a T4.1. The 'A' signal goes to D3, 'B' goes to D4, and 'I' goes to D32. The A/B pins work fine. The D32 interrupt does not fire. I checked signals and levels, all OK. Then I jumpered the Index signal to pin D17, and it works just fine.

I've manufactured a lot of these boards, and assembled 10 of them, so I really need D32 to work. I have fully used all easily available pins on the T4.1 pin headers. Can anyone suggest what the problem might be? Could there be a conflict with other pins on the same bus as 32? Is it an interrupt priority issue?

Very confused.
Can you show your code?
 
I tried a quick test on a Teensy 4.1 with this simple program:

Code:
const int pin = 32;

void setup() {
  pinMode(pin, INPUT_PULLUP);
  attachInterrupt(pin, mycount, CHANGE);
}

volatile unsigned int count = 0;

void mycount() {
  count = count + 1;
}

void loop() {
  Serial.print("count = ");
  Serial.println(count);
  delay(500);
}

Here is the result I see after brushing a wire across the pin several times.

1770391176966.png
 
I will load Paul's script without any other code and see what happens. As far as showing code, the script is very big, but I all the interrupt does it to increment a single variable.
 
This is really weird! I modified Paul's script to enable a multiplexer circuit to select the correct index pulse source, and it works perfectly. Then I ran my original script, and it worked. I removed the jumper connecting D32 to D18, and it stopped working. I examined the traces on the PCB program, and they look excellent. Any way, it's clearly a circuit board problem. Sorry to bother everyone.
 
Back
Top