Teensy 4.1 pullup on pin 3

MarcoM90

Member
Hi all!
I have a project which started with an Arduino Micro and among various peripherals there is an MCP23S17. After some modifications I realized the Micro is too small and moved to a Teensy 4.1. Everything worked correctly except the MCP23S17 which seemed to be unresponsive. After checking with an oscilloscope I have found that its INT pin is not able to pull down to 0V the pin 3 of the Teensy, but sets only to 2.8V. It is configured using INPUT_PULLUP, but using INPUT does not turn the internal pull-up off. So I randomly tested other pins (6 and 17) and they all worked correctly, both being pulled down to 0V by the MCP and responding to INPUT disabling the internal pull-up. So the MCP is working correctly with these other pins.
Are there additional configurations for the pin 3 to behave correctly? Or there are some limitations?

Thanks in advace.
 
It is configured using INPUT_PULLUP, but using INPUT does not turn the internal pull-up off.
I'm a bit confused by this sentence. Do you mean that pinMode(3, INPUT_PULLUP); works as expected (Teensy pin3 pulled high to 3V3) but that pinMode(3, INPUT); also pulls pin 3 of the Teensy high?

By the way, did you power the MCP23S17 by 3V3? Hopefully not by 5V since the Teensy 4.1 pins are NOT 5V tolerant.

1721421562978.png

How did you configure the INTx pins of the MCP23S17?

Paul
 
Hi Paul, thanks for the answer.
Yes the MCP is correctly configured the same the Micro did with the interrupt pins as open-drain (and internally connected, so INTB triggers INTA) using the same code and the SPI decoder in the oscilloscope decodes the correct bytes. The power has been changed to 3V3.

Using either pinMode(3, INPUT_PULLUP); or pinMode(3, INPUT); set pin 3 to 3V3 and the MCP is not able to pull it lower than 2.8V, but, as said, pins 6 and 17 (picked randomly) make the MCP work correctly.
 
This really should work on pin 3.

As a quick test, I programmed a Teensy 4.1 with this code that sets all pins to INPUT_PULLUP and then I connected a 1K resistor between pin 3 and GND.

Code:
void setup() {
  for (int i = 0; i < 42; i++) {
    pinMode(i, INPUT_PULLUP);
  }
}

void loop() {
}

My multimeter measures 0.133 volts. Here's a photo, so you can see how I tested.

1721429573456.png


Maybe you could remove your Teensy from the circuit and do a similar simple 1K resistor test?

Sometimes when a strange DC voltage is measured in a "real" application is it actually just the average voltage of a rapidly (but consistently) changing waveform. Just a completely blind guess.

Really the first thing to do is a simple test like this resistor to check if your hardware is still good, and if it is, hopefully the result can build confidence about INPUT_PULLUP behavior before you continue troubleshooting...
 
Thanks Paul, I tried with your code and the Teensy alone and on the resistor there are 130-140 mV, so it must be ok.
I will try a simple sketch with the MCP to see what happens.
 
Oops I have found the problem, pin 3 was free but there were few lines of forgotten code that probably caused the strange behavior. I will check asap.
 
Back
Top