Author Topic: Using PD6 on a Teensy 2.0 (the one with the LED)  (Read 978 times)

0 Members and 1 Guest are viewing this topic.

Offline suicidal_orange

  • * Global Moderator
  • Thread Starter
  • Posts: 2638
  • Location: England
Using PD6 on a Teensy 2.0 (the one with the LED)
« on: Sat, 13 June 2015, 10:23:27 »
I have a Teensy which I bought with pins as I couldn't find one without.  It didn't fit in my case so I removed the pins, killing some of the pads in the process.  This has left me one short of the 19 pins I need for my 60% (14x5 matrix) but the LED attached to PD6 (a dead pad) is still lit so I should be able to tap one of the LED pads and get it working.

From the Teensy schematic it's wired pin -> LED -> resistor -> ground so I thought the end of the LED near the ATMega would be the correct place to tap, but when I assign PD6 to strobe and touch the LED to another pin it presses each key in the column once before repeating the correct key until the connection is broken.

Help?! :))
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline Wilba

  • * Maker
  • Posts: 250
  • Location: Melbourne, Australia
  • Designer of PCBs likesuchas Zeal60, JD45, Planck
Re: Using PD6 on a Teensy 2.0 (the one with the LED)
« Reply #1 on: Sat, 13 June 2015, 11:29:47 »
I can help you with this... but I'd need to know more about what firmware you're using and how you're connecting  the matrix to the Teensy.

My guess would be, you're using PD6 as a row or column select (i.e. what you pull to ground so one row or column of switches is "read", with internal pull-up resistors). The pull-up resistors will make the inputs read as high if there's switches open, and low if there are switches closed.

TMK firmware, as an example, will output a low to select, and a high-Z state (i.e. effectively disconnected) for the pins not selected.
When PD6 is in a high-Z state, it's still connected to the LED and resistor to ground, so unlike the other pins, it won't be truly "disconnected" when that pin is not the "selected" row/column, and could cause the voltage on the input pins reading rows or columns to be not 0V but low enough to be read as a logic low.

Just a theory, though... if you are using TMK, you could fix this in matrix.c and change it to output high instead of switch to high-Z state.
Or (not that I suggest you do this yet), you could burn out the LED with high current so it's disconnected  ;D

Also... did you kill the pads on F5 and E6 too, or are you already using those and really need D6?

Offline suicidal_orange

  • * Global Moderator
  • Thread Starter
  • Posts: 2638
  • Location: England
Re: Using PD6 on a Teensy 2.0 (the one with the LED)
« Reply #2 on: Sat, 13 June 2015, 12:12:25 »
I'm planning to use EasyAVR to give the custom handwired matrix option a thorough test, but it's currently flashed with Soarer's controller 1.10 as I had a big matrix setup so just tweaked the pins to test the Teensy.

E6 and F5 are both good and will be used and I've scraped the trace going to C7 (the other corner) and am calling that working - every pin counts :))

So to confirm, I am poking the right place and as long as EasyAVR is outputting high all will be good?  I'd rather not lose the LED so if EasyAVR is wrong I'll have to learn TMK and use that instead.

Edit: Tried EasyAVR, touching a row to the trace near the proper D6 pad results in a brighter LED (assumedly bypassing the resistor) and outputs the wrong scancode, touching to the LED as I was before results in a dim LED and no keypress registering.  TMK here I come!

p.s.  Thanks Wilba for reminding me of the basics :)
« Last Edit: Sat, 13 June 2015, 13:31:38 by suicidal_orange »
                               
Ducky Zero, MX Reds    JD40, Jailhouse Blues           GH60
Soarer controller

Offline neverused

  • Posts: 571
Re: Using PD6 on a Teensy 2.0 (the one with the LED)
« Reply #3 on: Sat, 13 June 2015, 14:07:56 »
If you want you should be able to remove the LED and resistor, bridge those pads and use it like any other pin.

Offline bpiphany

  • Posts: 1004
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: Using PD6 on a Teensy 2.0 (the one with the LED)
« Reply #4 on: Tue, 23 June 2015, 23:39:10 »
Actually, simply removing the LED restores D6 to default working condition. The pad for D6 is in parallel with the LED and resistor. Side cutters, pliers + LED = no more trouble...