I just got done pulling my hair out over a low pin voltage issue. I had an RGB led on pins PB0, PB1, and PB2 and a pushbutton on pin PB4. All my sketch (created and uploaded in the Arduino IDE) did was turn on the leds when the button was pressed. The chip was powered with a 5V bench supply.
Nothing was happening, and when I measured the voltage at the pins, I was only reading about 1.5 volts. With the leds having a forward bias of ~2V, it's no wonder they were not lighting. I ended up using a new ATTiny85 chip and now all is right with the world and the pins are sitting near ~5V.
I had done some mess-around programming using direct writes to the registers instead of the usual pinMode, digitalWrite, ect. I was also messing around with putting the chip to sleep.
Is there anything I could have screwed up programmatically to cause the low pin voltage or was this a hardware problem caused by either a defective chip or over-programming. I've burned the chip at least 20-25 times.
Unfortunately, in my frustration I deleted everything so I could start from scratch and only have the bare bones blink sketch which is working perfectly with the new Tiny85.
It could have been, although I thought I was being careful. I had current limiting resistors (150 Ω) on the LEDs which, given the voltage should have held the current to 20mA.
Yes, I had series resistors to start. 5v supply - 2v forward voltage = 3v / 20 mA = 150Ω. It worked great for a while, and then the pin voltage dropped to 1.5V.
The data sheet doesn't guarantee I/O current above test conditions of 10mA/5V and limits total I/O current to 60mA but I don't know if exceeding those limits would kill the chip. Maybe a substandard chip.
Ones in a while it happens to everyone, even if careful... Anyway, I wouldn't be concerned about programming or flashing the chip, just go on and if something like that ever happens again, examine the setup better.
Yes. I've been working with Arduinos for years. This is my first foray into direct register writes on a ATTiny85 chip. The hardware/software has been working (constantly for a day now) perfectly with a new chip. My original question was, could I have messed up the chip with direct register writes code.