Teensy LC Port registers pinout

Status
Not open for further replies.

marce

New member
Hey,

I wanted to build a usb keyboard with tmk. For that i need to create a matrix with port registers pin names(e.g. a3, c2 and so on).

Question: where do i find a table that shows which gpio pin corrospond to which register port pin?

The teensy 2.0 seems to have the pinouts labeled, but the lc version does not. https://www.pjrc.com/teensy/pinout.html

I followed multiple tutorials and none of them mentioned where to find it... Very frustrating :S

I also loked into the datasheet, but i think i am searching for the wrong keywords?

Hope you can help me.

Thanks in advance
 
Mmmh okay,but a few problems:
- i cant find gpio pins 24-25 maybe i am blind
And
-Gpio 0 is for example PTB16
I thought that these just can have values between 0 and 7. The tools i use dont accept other values :s

But thanks for the link
 
Pin 24 is PTE20 and Pin 25 is PTE21 (A10 and A11 in the schematic). The problem is that TMK is for Atmel AVR boards and Teensy 3.x and LC are ARM - they're completely different and I would expect TMK not to work without a major re-write.

Check out this tutorial: https://www.pjrc.com/teensy/td_keyboard.html
And this blog post: https://forum.pjrc.com/threads/55395-Keyboard-simple-firmware

They'll show you some ways that you could build a USB keyboard using Teensy libraries that are readily available for LC.
 
I wanted to build a usb keyboard with tmk. For that i need to create a matrix with port registers pin names(e.g. a3, c2 and so on).

Question: where do i find a table that shows which gpio pin corrospond to which register port pin?

You are asking all the right questions - if you were using an old, slow, Atmel 8-bit MCU that required using port writes to set 8 pins to the same value at once, and constrained which pins you could use because they had to be on the same port.

But you are using a Teensy LC which, despite being small and cheap, is super fast. So instead, use digitalWriteFast and digitalReadFast on any pins which are convenient. Just trust that this is super optimized and you wouldn't get any faster sng direct port writes or coding in assembler. Or, if that trust is too hard, read

https://forum.pjrc.com/threads/24573-Speed-of-digitalRead-and-digitalWrite-with-Teensy3-0

So yes, you are searching for the wrong thing, because you don't need to do port writes at all.
 
Ok first of: thank you both for your answers.

Mistakes were made:
I initially started this whole project to turn a laptop keyboard into a normal usb keyboard by following this tutorial https://www.instructables.com/id/How-to-Make-a-USB-Laptop-Keyboard-Controller/ The creator also went the teensyduino route. My mistake was that i shorted out pins of the fpc adapter on the backplate of the keyboard *huge facepalm*, because the fpc was too short. So while testing i had some ghosting, which made sense because i looked in the matrix and the values that were pressed at the same time were always next to each other (thought it had to do with timing). As a result i thought i would need a more robust firmware solution like tmk or qmk.

@brtaylor I went the teensyduino route and it worked pretty well.

@Nantonos The problem is that i am relying on already existing tools and all the tools i tested wanted these port values. I also found the site you mentioned, but had errors all over the place (probably because of windows)

Despite i am more confused than before with all the tmk and qmk stuff, i am a bit hooked :d I might take a look into it again in the future. But when i do, i will start with a teensy 2.0 and linux :D

In the end all that matters is that its working

Thanks guys again
 
Last edited:
Status
Not open for further replies.
Back
Top