Choose pullup resistor ohms

On your site, you state:

Variable Drive Strength
The output impedance of each digital output may be controlled in 7 steps, ranging from 150 ohms (weakest) up to about 21 ohms (strongest).

I assume that means that with software, the pullup resistor can be chosen?

Where can I find more info on this?

Wayne Sallee
Wayne@WayneSallee.com
 
At the bottom of the T4.x product page (below your quoted section) you will find links to the NXP reference manuals. It would be good to read up on the topic there, but here is a thread I found via google that apparently has working code.

https://forum.pjrc.com/threads/66407-T4-Pin-Drive-Strength?p=278409&viewfull=1#post278409

Thanks!

I did not fine NXP in that T4.x product page, but found "IMXRT1060 Manual" wich when downloaded "https://www.pjrc.com/teensy/IMXRT1060RM_rev3.pdf" shows "NXP" in the page. Just posting this for anyone else needing this.

Following the link to the forum post, it look like the key command for this is

#define INPUT_PULLUP 2

I'll do some more reading on this.
Thanks
 
No, it means the output drive strength can be varied in 7 steps. Nothing to do with pull-ups or pull-downs, everything to do with EMI generation.

Yes it's pull up resistors.

Those pull up resistors are located in the processor.

The manufacture document says that those resistors are in series, but that's not logical. They must be in parallel.

https://www.pjrc.com/teensy/IMXRT1060RM_rev3.pdf

IMXRT1060RM_rev3.pdf
5–3
DSE

Drive Strength Field
Select one out of next values for pad: POR_B

000 DSE_0 — HI-Z
001 DSE_1 — Dual/Single voltage: 262/260 Ohm @ 1.8V, 247/157 Ohm @ 3.3V
010 DSE_2 — Dual/Single voltage: 134/130 Ohm @ 1.8V, 126/78 Ohm @ 3.3V
011 DSE_3 — Dual/Single voltage: 88/88 Ohm @ 1.8V, 84/53 Ohm @ 3.3V
100 DSE_4 — Dual/Single voltage: 62/65 Ohm @ 1.8V, 57/39 Ohm @ 3.3V
101 DSE_5 — Dual/Single voltage: 51/52 Ohm @ 1.8V, 47/32 Ohm @ 3.3V
110 DSE_6 — Dual/Single voltage: 43/43 Ohm @ 1.8V, 40/26 Ohm @ 3.3V
111 DSE_7 — Dual/Single voltage: 37/37 Ohm @ 1.8V, 34/23 Ohm @ 3.3V

So contrary to instructions, it seems to be 3 resistors in parallel being turned on, or off. (inst says series)

1.8v
62 ohms, 134 ohms, 262 ohms
001 = 262 Ohm
010 = 134 Ohm
011 = 88 Ohm
100 = 62 Ohm
101 = 50 Ohm
110 = 42 Ohm
111 = 37 Ohm


3.3v
57 ohms, 126 ohms, 247 ohms
001 = 247 Ohm
010 = 126 Ohm
011 = 83 Ohm
100 = 57 Ohm
101 = 46 Ohm
110 = 39 Ohm
111 = 34 Ohm



Teensy 4.1 uses:
MIMXRT1062DVJ6B
chip
https://www.mouser.com/datasheet/2/302/IMXRT1060CEC-1396580.pdf

22 k ohms, 47 k ohms, 100 k ohms

001 = 100 K Ohm
010 = 47 K Ohm
011 = 32 K Ohm
100 = 22 K Ohm
101 = 18 K Ohm
110 = 15 K Ohm
111 = 13 K Ohm
 
Last edited:
Most likely on chip it is 3-MOSFETs sized to carry 0.125x output current, 0.25x & 0.5x all connected in parallel. On chip resistors are difficult to make, but, FETs are smaller and more reproduce-able.
 
Most likely on chip it is 3-MOSFETs sized to carry 0.125x output current, 0.25x & 0.5x all connected in parallel. On chip resistors are difficult to make, but, FETs are smaller and more reproduce-able.


Yes, I think they are probably some kind of transistor. FETs are a type of transistor (for other reading this). They would have to use transistors anyway, to turn resistors on and off, so just using a transistor as a resistor could simplify it. The fact that 2 different voltage modes determines the resistance, makes me think it's transistors without a resistor.
 
As mentioned previously, the DSE registers are used to control GPIO drive strength; this is typically used to curb EMI issues associated with fast signal transitions. Lowering the drive strength is roughly equivalent to having a series resistor between the GPIO pin & connected load.
Pull-up/pull down can be controlled via the corresponding PUS registers:
Code:
00 PUS_0_100K_Ohm_Pull_Down — 100K Ohm Pull Down
01 PUS_1_47K_Ohm_Pull_Up — 47K Ohm Pull Up
10 PUS_2_100K_Ohm_Pull_Up — 100K Ohm Pull Up
11 PUS_3_22K_Ohm_Pull_Up — 22K Ohm Pull Up

Marc
 
As mentioned previously, the DSE registers are used to control GPIO drive strength; this is typically used to curb EMI issues associated with fast signal transitions. Lowering the drive strength is roughly equivalent to having a series resistor between the GPIO pin & connected load.
Pull-up/pull down can be controlled via the corresponding PUS registers:
Code:
00 PUS_0_100K_Ohm_Pull_Down — 100K Ohm Pull Down
01 PUS_1_47K_Ohm_Pull_Up — 47K Ohm Pull Up
10 PUS_2_100K_Ohm_Pull_Up — 100K Ohm Pull Up
11 PUS_3_22K_Ohm_Pull_Up — 22K Ohm Pull Up

Marc

Ok thanks, and it looks like the command pinMode(pin, INPUT_PULLUP); is already using the highest pullup resistance, so I am chasing the wrong solution.

I have a keyboard that the keys are not easily detected. I think the laptop may have used higher voltage that made a larger voltage swing, than the 3.3 volts from the teensy. Other keyboards work fine, and that keyboard worked fine on the laptop while the laptop worked.
 
Just a completely blind guess, but if the keyboard is arranged in a row-column requiring scanning to read out all the keys, often extra delay is needed between driving the rows and reading the columns.
 
Just a completely blind guess, but if the keyboard is arranged in a row-column requiring scanning to read out all the keys, often extra delay is needed between driving the rows and reading the columns.

Are you saying that some keyboards might need more delay than others?

The keys on my desired keyboard work if I press a little harder. But since they worked fine on the laptop while the laptop was working, I was surprised to have this problem, when the other keyboards that I tested worked. It does have fewer pins for a full sized keyboard (with number pad) compared to others. Usually full sized laptop keyboards have 32 pins. This keyboard has only 24 pins. So that's more keys per some pins, but I would not think that would be an issue.
 
Note in p#11: "if I press a little harder" suggests it works either from a firmer press making the button 'close' fully to indicate the press as needed, or added dwell time from a longer 'harder' press allows the scanning code to actually register the closed 'key'

Not seeing any info on the 'keyboard' in use? Is this a 'keypad like arduino.cc/Code/Keypad/ from pjrc.com/teensy/td_libs_Keypad.html ? And using that common library?

Without 'Complete source code' or Images or other details it isn't clear if that is the library in use for a manually wired Col/Row button array or using another premade 'keyboard' with DIY interface to connect the switches?

Also it seems the problem is 'missing' key presses and not 'phantom' keypresses from the unused/unbalanced layout?

Reading that seems it is a DIY interface to an existing keyboard. It may have resistors or caps built in to do a hardware debounce and that might be why a harder press works as it allows the polling line voltage to complete the circuit and register the press. Maybe the keyboard normally runs on 5V not 3.3V and it takes the harder press and longer dwell to pass any hardware debounce to show the needed voltage change on a press.

As @PaulStoffregen notes in p#10 - lots of avenues for blind guessing without hardware/software details on what is configured.
 
Yes, I think they are probably some kind of transistor. FETs are a type of transistor (for other reading this). They would have to use transistors anyway, to turn resistors on and off, so just using a transistor as a resistor could simplify it. The fact that 2 different voltage modes determines the resistance, makes me think it's transistors without a resistor.

In CMOS chips pullups and pulldowns are implemented as weedy little MOSFETs with a long narrow channel, giving resistances in the 10's of kohm range (and I repeat nothing to do with drive strength at all). Drive strength is varied by paralleling a subset of output drive MOSFETs in order to select various low resistances in the hundred ohm sort of region. Those MOSFETs have short wide channels. I repeat pullup and pulldowns are a different thing to drive-strength settings. Drive strength limits the output current and thus the output voltage transition speed (aka dV/dt) for outputs, pullups and pulldowns define a default logic state for inputs.

Pretty much everything(*) on a CMOS logic chip is MOSFETs, diodes and capacitors, resistors are implemented as MOSFET channels of suitable geometry and are of very lax tolerance (+/-30% or so), and non-linear.

If you want help with interfacing this keyboard it would be good to identify it, provide a datasheet or product webpage, something concrete...

(*) Discounting the magic analog wizardry of the VCOs perhaps.
 
Note in p#11: "if I press a little harder" suggests it works either from a firmer press making the button 'close' fully to indicate the press as needed, or added dwell time from a longer 'harder' press allows the scanning code to actually register the closed 'key'

Not seeing any info on the 'keyboard' in use? Is this a 'keypad like arduino.cc/Code/Keypad/ from pjrc.com/teensy/td_libs_Keypad.html ? And using that common library?

Without 'Complete source code' or Images or other details it isn't clear if that is the library in use for a manually wired Col/Row button array or using another premade 'keyboard' with DIY interface to connect the switches?

Also it seems the problem is 'missing' key presses and not 'phantom' keypresses from the unused/unbalanced layout?

Reading that seems it is a DIY interface to an existing keyboard. It may have resistors or caps built in to do a hardware debounce and that might be why a harder press works as it allows the polling line voltage to complete the circuit and register the press. Maybe the keyboard normally runs on 5V not 3.3V and it takes the harder press and longer dwell to pass any hardware debounce to show the needed voltage change on a press.

As @PaulStoffregen notes in p#10 - lots of avenues for blind guessing without hardware/software details on what is configured.


I Tried adding more delay, more and more until it was slowing down my typing. The delay made no improvement.

I think maybe it just got some oxidation from sitting while the laptop was not in use. I thought it would be carbon tracks, but maybe it uses copper. I really don't want to take the keys off. The tracks going into the keyboard are carbon. If I wiggle a key that is being difficult, it is easier the next time I press it. I also cleaned the contacts with 70% isopropyl on the ribbon cable with no improvement. So I am moving forward with the build, and hoping the keys will work in over time.
 
In CMOS chips pullups and pulldowns are implemented as weedy little MOSFETs with a long narrow channel, giving resistances in the 10's of kohm range (and I repeat nothing to do with drive strength at all). Drive strength is varied by paralleling a subset of output drive MOSFETs in order to select various low resistances in the hundred ohm sort of region. Those MOSFETs have short wide channels. I repeat pullup and pulldowns are a different thing to drive-strength settings. Drive strength limits the output current and thus the output voltage transition speed (aka dV/dt) for outputs, pullups and pulldowns define a default logic state for inputs.

Pretty much everything(*) on a CMOS logic chip is MOSFETs, diodes and capacitors, resistors are implemented as MOSFET channels of suitable geometry and are of very lax tolerance (+/-30% or so), and non-linear.

If you want help with interfacing this keyboard it would be good to identify it, provide a datasheet or product webpage, something concrete...

(*) Discounting the magic analog wizardry of the VCOs perhaps.


It's a keyboard (13h839c0rbs) from a Gigabyte laptop P27GV2 (rebranded clevo w370).
 
Back
Top