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

Thread: Teensy 3.6 pins 37/38 can't seem to disable pullups

  1. #1

    Teensy 3.6 pins 37/38 can't seem to disable pullups

    I am using a Teensy 3.6 with I2C enabled for pins 18/19 which makes sense to have pullups, but I can't seem to disable the pullups on pins 37/38 (A18_PWM_SCL1/A19_PWM_SDA1).
    I know there are pullups because I set the pins to INPUT setting in order to measure an analog voltage level and I am seeing the pin affect the voltage measurement due to the pullup.
    Does anybody know of a low level command I can use to disable pullups for specific pins manually?
    I can provide my full code if necessary, but I would prefer not to.

    Thanks.
    Tim

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,423
    If you want to do analog readings, you should not configure the pins as GPIO input pins to prevent ugly side effects from the pin mux into the ADCs. After booting, pins are by default in analog mode and as soon as you invoke analogRead, the ADC mux (not to confound with the primary pin mux) will route the signal directly to the ADC.

  3. #3
    Thanks for the quick reply.
    I tried that, I do not do any pinMode settings at all, then do an analogRead on the pin and it is still pullup up the voltage I want to measure.
    As a side note, I compiled and ran the code on a Teensy 3.2 and there is no pullup on that analog pin and I measure the voltage just fine.
    I suspect either there is a bug with this pin on Teensy 3.6, or I need to find a low-level command of forcing the pullup to go away on that pin.
    Thanks.
    Tim

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,423
    An internal pull-up on PTC10/11 can only come either by the GPIO engine or by the I2C engine. Both should normally not play a role as long as these pins are neither configured as GPIO nor as I2C pins.
    It might be that a I2C library which you include (just guessing, since you do not want to share your code) does a hidden initialisation of Wire1 with pull-ups which would then wrong your analog reads.
    To exclude this and other software issues, I’d write a simple test sketch which does only analogRead() on these 2 pins without including or activating anything else.

  5. #5
    Thanks. That is good advice, I made a dummy sketch where the only command is to do an analogRead on pin 37 and it is still acting like there is a pullup.
    Here is the circuit:
    1.481V source --> 1k --> 1k --> GND
    I have Teensy pin 37 tied to the node between the 2 1k resistors and am measuring 1.60V. This voltage measured should be 1.481V/2.


    Code:
    void setup() {
    // put your setup code here, to run once:
    int16_t aRead;
    aRead = analogRead(37);
    }

    void loop() {
    // put your main code here, to run repeatedly:

    }

    Thanks.
    Tim

  6. #6
    Is there a low level command where I can readback the MUX settings for that pin? And is there a datasheet page you would recommend looking at for the uC?
    Thanks

  7. #7
    Dumb me. Sorry, it was a pullup on the hardware (non-teensy). We can disregard this whole thread. Thanks for your time!
    Tim

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,558
    I figured that was too obvious a question to ask. Reading the provided details in p#5 it seemed the only thing connected to the pin was the voltage divider ...

Posting Permissions

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