According to the 1062 programming manual, digital inputs can use either 22k, 47k, or 100k internal pull-up resistors:
According to https://github.com/PaulStoffregen/c...42c55a2278c6cd72b/teensy4/digital.c#L148-L156 the actual setting used for pinMode(pin#, INPUT_PULLUP) is 22 kohm pull-up (IOMUXC_PAD_PUS(3), and I've verified this experimentally).
It would be nice if there was extra #defines (after the line defining INPUT_PULLUP https://github.com/PaulStoffregen/c...3f1cbcc2b325fa59b886fa/teensy/core_pins.h#L29) for the other modes, such as INPUT_PULLUP_47K, INPUT_PULLUP_100K, and then also have INPUT_PULLUP_22K which is the same as the default INPUT_PULLUP.
I found that I can simply copy that entire pinMode function into my teensy program and modify it to use IOMUXC_PAD_PUS(2) for 100k pull-up or IOMUXC_PAD_PUS(1) for 47k pull-up, like so:
and then I can simply call my custom function. But the reason I bring this up is I think it would be more useful for everyone to modify those github files to have those extra #defines to select between these 3 different pullup modes. But I can also understand just wanting to keep it simple by supporting only one pull up define.
According to https://github.com/PaulStoffregen/c...42c55a2278c6cd72b/teensy4/digital.c#L148-L156 the actual setting used for pinMode(pin#, INPUT_PULLUP) is 22 kohm pull-up (IOMUXC_PAD_PUS(3), and I've verified this experimentally).
It would be nice if there was extra #defines (after the line defining INPUT_PULLUP https://github.com/PaulStoffregen/c...3f1cbcc2b325fa59b886fa/teensy/core_pins.h#L29) for the other modes, such as INPUT_PULLUP_47K, INPUT_PULLUP_100K, and then also have INPUT_PULLUP_22K which is the same as the default INPUT_PULLUP.
I found that I can simply copy that entire pinMode function into my teensy program and modify it to use IOMUXC_PAD_PUS(2) for 100k pull-up or IOMUXC_PAD_PUS(1) for 47k pull-up, like so:
Code:
void pinMode_INPUT_PULLUP_100K(uint8_t pin)
{
const struct digital_pin_bitband_and_config_table_struct *p;
if (pin >= CORE_NUM_DIGITAL) return;
p = digital_pin_to_info_PGM + pin;
*(p->reg + 1) &= ~(p->mask); // TODO: atomic
*(p->pad) = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_PKE | IOMUXC_PAD_PUE | IOMUXC_PAD_PUS(2) | IOMUXC_PAD_HYS;
*(p->mux) = 5 | 0x10;
}
void pinMode_INPUT_PULLUP_47K(uint8_t pin)
{
const struct digital_pin_bitband_and_config_table_struct *p;
if (pin >= CORE_NUM_DIGITAL) return;
p = digital_pin_to_info_PGM + pin;
*(p->reg + 1) &= ~(p->mask); // TODO: atomic
*(p->pad) = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_PKE | IOMUXC_PAD_PUE | IOMUXC_PAD_PUS(1) | IOMUXC_PAD_HYS;
*(p->mux) = 5 | 0x10;
}
and then I can simply call my custom function. But the reason I bring this up is I think it would be more useful for everyone to modify those github files to have those extra #defines to select between these 3 different pullup modes. But I can also understand just wanting to keep it simple by supporting only one pull up define.