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

Thread: Teensy LC Port registers pinout

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    3

    Teensy LC Port registers pinout

    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

  2. #2

  3. #3
    Junior Member
    Join Date
    Mar 2019
    Posts
    3
    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

  4. #4
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    494
    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...imple-firmware

    They'll show you some ways that you could build a USB keyboard using Teensy libraries that are readily available for LC.

  5. #5
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,106
    Quote Originally Posted by marce View Post
    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...with-Teensy3-0

    So yes, you are searching for the wrong thing, because you don't need to do port writes at all.

  6. #6
    Senior Member
    Join Date
    Nov 2012
    Location
    Boston, MA, USA
    Posts
    1,106

  7. #7
    Junior Member
    Join Date
    Mar 2019
    Posts
    3
    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...rd-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

    In the end all that matters is that its working

    Thanks guys again
    Last edited by marce; 03-13-2019 at 10:08 PM.

Posting Permissions

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