I built small LED badge powered by coin cell and Attiny85 SOIC chip.
It's charlieplexing setup with 4 pins driving 12 LEDs. However after I soldered everything I wasn't able to program processor, was getting invalid signature error. So I soldered another board, adding one component at time. Long story short, I found issue is cased by Resistor/LED that's between MOSI and MISO lines (pins 5 and 6). I'm using USBTiny ISP to program chip from Arduino IDE environment. Everything works when I remove that resistor (R7), but that only gives me 6 LEDs instead of 12. Is there anything that can be done, and why is this happening? I'm attaching schematics if that helps...
I've had similar problems a few times. Basically there is more load present than the programmer can drive. One workaround would be to program the MCU before installing the LEDs and their associated current-limiting resistors.
I have a 3V ATtiny85 circuit that drives some ordinary 5mm LEDs through 100? resistors, not charlieplexed or anything, and if the batteries aren't fairly fresh, programming will fail.
Thanks! Oh well I might try that once I iron out the code
All components I'm using SMD, so it's a pain to solder/desolder resistor each time I need to reprogram chip ![]()
BTW, I was wrong about 6 LEDs, looks like I can still control 10!
Debug with through-hole parts on a breadboard? Another alternative, use larger resistors, say between 470? and 1K, build one board with those and use that to debug. I have some SMT LEDs that are plenty bright with 1K.
bratan:
It's charlieplexing setup with 4 pins driving 12 LEDs. However after I soldered everything I wasn't able to program processor, was getting invalid signature error. So I soldered another board, adding one component at time. Long story short, I found issue is cased by Resistor/LED that's between MOSI and MISO lines (pins 5 and 6).
Yep. Anything that puts a load on MISO/MOSI/SCK can cause problems with uploading.
bratan:
and why is this happening?
The programmer doesn't have enough current to drive the lines properly.
bratan:
Is there anything that can be done
a) Put in a switch/jumper to disconnect your circuit when uploading.
b) Put the chip in a socket, pull it out to program it.
c) etc.
Most people do not try to program an ATtiny85 in the target PCB. It is generally plugged into somithing like a TinyISP and then moved to the target board after programming. Why don't you just breadboard the Arduino as ISP UNO - ATtiny85 programming circuit on a small breadboard and upload your sketches in that and then transfer the tiny to the target board. Wouldn't that be much easier that trying to troubleshoot an unusual problem ?
You could make a high-power ISP adapter. Programmer connects on one end, target connects on the other end. Transistors you add in between will drive heavier loads (at least for SCK and MOSI, not sure how much you can help MISO).
raschemmel:
Most people do not try to program an ATtiny85 in the target PCB. It is generally plugged into somithing like a TinyISP and then moved to the target board after programming. Why don't you just breadboard the Arduino as ISP UNO - ATtiny85 programming circuit on a small breadboard and upload your sketches in that and then transfer the tiny to the target board. Wouldn't that be much easier that trying to troubleshoot an unusual problem ?
Kinda tough with a SMT device.
When I build Tiny85 devices I try to assign the pins taking this problem into account. Anything that doesn't produce any load (eg. a push button which is normally open) goes straight onto the SCK/MOSI lines. After that it goes in order of impedance/loading.
Here are some examples of loading pins to support ISP programming.
Oooh , new replies! I wonder why I stopped receiving notifications, I'm still subscribed ![]()
Thanks guys, I really like idea of high power ISP programmer, I'm gonna try building one.
Yeah adding any kind of extra switch or programming chip off board is challenging since size of this device is tiny. Here's a video of my digital butterfly in action ![]()
bratan:
Thanks guys, I really like idea of high power ISP programmer, I'm gonna try building one.
Just use your Uno.
Why? I like USBTiny ISP
Does UNO provide higher voltage?
BTW, for some reason USBTiny won't program ATTiny85 SOIC version unless I have power jumper on. It does program ATTiny85 thru the hole version tho without extra power...
bratan:
Does UNO provide higher voltage?
If you do not include series resistors then yes.
bratan:
BTW, for some reason USBTiny won't program ATTiny85 SOIC version unless I have power jumper on. It does program ATTiny85 thru the hole version tho without extra power...
So going back to your original problem, does that mean the USBTiny failed because you didn't have the power jumper on?
Were you trying to program the attiny85 with it powered via coin cell? Or do you remove the coin cell before programming?
Also depending on which version USBTiny you have and how it was built, the series resistor was optional. Like the Adafruit USBTinyISP version it was recommended not to include the series resistor for most applications.
