Teensy 2++ Pin Question

tedfs3

17 Mar 2019, 00:16

I was wondering if it's possible to mix LEDs with ports used for columns on the Teensy 2++ ? I know you can't mix rows and columns but am wondering if it's possible to mix LEDs in a port ?

Only need two LEDs for the design I'm working on, which opens up more pins for columns IF it's possible to mix LEDs in a column port.
Using all D pins as a port as an example: PD01 and PD02 for the LEDs but using PD04, PD05, PD06 and PD07 for columns.

Is it possible to mix LEDs in like this ? Hopefully so, that would simplify the design process on my end.

Findecanor

17 Mar 2019, 05:03

On a single port: yes.

Normally you would want to use PWM for driving the LEDs so that you could control the brightness in firmware. PWM could allow a wider range of brightness control than if you would limit the brightness with just a resistor.
Only some pins are capable of PWM, and each is driven by a specific timer. Do check the firmware you are planning to use: for if its documentation recommends any specific pins for indicator LEDs, or for which pins other keyboards with the same µC use.
If you don't use PWM, the datasheet might also mention that some port/ports would be more preferable than other/s for higher current draw.

tedfs3

17 Mar 2019, 20:15

The pins I'm thinking about using, PB6 and PB5 do have PWM. I just wasn't sure you could mix LEDs in with columns or rows and didn't want to assume.

Post Reply

Return to “Workshop”