0

I have an Arduino-like device with few GPIO pins (DigiSpark clone). It is based on an 8-pin AtTiny85 IC so there are Power, Ground and six other pins, two of those six are being used for USB keyboard simulation which leaves 4 GPIO which I want to connect 4 buttons to with minimal circuitry. The normal way to do this is to enable the internal pullups and have the buttons connect the pin to ground. This works well for most pins.

The problem is the equivalent to Pin 13 (Pin 1 in this case) which is connected via a resistor and LED to ground. The internal pullup is too weak to raise the voltage enough. Consequently that pin always appears to be in a "button pressed" state.

One solution is to cut the tracks connecting the LED, but the board is so tiny and crowded that I doubt I have the eyesight and steadiness of hand to do this.

DigiSpark PCB
Problematic resistor + LED are at bottom right of AtTiny85 IC

It occurs to me I could either

  1. Add an external pullup to this input,
  2. Change the button wiring so when pressed, it connects the pin to 5v. Change the code to look for high, not low.

Are there any problems with either of these approaches?

  • You have forgotten the reset pin. So effectively you only have 3 pins left (8 pins minus Vcc, ground, reset and 2 pins for USB = 3) – chrisl May 6 at 8:32
  • @chrisl - I plan to disable the reset fuse using avrdude. I don't have a high voltage programmer but I don't need to use ICSP or change the bootloader so should be OK. I was considering adding Pin 5 issues as a separate question if I hit problems. – RedGrittyBrick May 6 at 8:38
  • 1
    For me it's option 2. I would not expect any problem. – the busybee May 6 at 10:40
  • 1
    I'd remove the LED. Takes but a moment with a soldering iron. – Majenko May 6 at 12:51
0

In the end, stimulated by Majenko's advice to desolder the LED, I instead carefully studied the PCB layout online, checked that it corresponded to my PCB, checked the location of nearby traces I didn't want to cut and then used multiple magnifying glasses and a fresh blade in my smallest utility knife and carefully cut the track leading from the LED to the IC. All was well.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.