Go Down

Topic: Trouble with Programming a ATTiny85 (Read 164 times) previous topic - next topic

ericgrphone

I'm trying to program an ATTiny 85 and having some difficulty.  When trying to upload a sketch to the ATTiny85 I simply get an error "An error occurred while uploading the sketch" with no other details.

I've double checked my setup and still can't seem to figure out why this is happening.  The sketch I'm trying to upload is just the Blink sketch so I can test.

Here's how I set everything up:

Uploaded ArduinoISP to the board
Wired the chip per the schematic:

1 - 10
4 - Ground
5 - 11
6 - 12
7 - 13
8 - 5V

I put a 10UF capacitor to Ground and Reset
I then go to Tools | Boards | ATTIny 25/45/85

I then try to upload the sketch and get the error. Any help would be appreciated.


Grumpy_Mike

Quote
I then try to upload the sketch
How?
Are you using the normal upload icon on the top of the IDE window?

Or are you using the Sketch -> Upload Using Programmer menu selection.

You should use the latter.

ericgrphone

So close but so far - I changed the programmer to Arduino as ISP and uploaded via programmer.  The LED flashes like crazy for about a second and then turns off.  Any ideas?

Grumpy_Mike

Quote
Any ideas?
Yes it has stopped working.

Got any schematics, photographs and code.

pert

So close but so far - I changed the programmer to Arduino as ISP and uploaded via programmer.  The LED flashes like crazy for about a second and then turns off.  Any ideas?
Did the upload complete successfully, or did it still fail?

justone

Try it without the cap between RST and GND. My arduino as ISP works without it.

pert

Try it without the cap between RST and GND. My arduino as ISP works without it.
But does it not work with the capacitor? I'm aware it's not always necessary, but I've never heard anything about it causing a problem.

Grumpy_Mike

Unless you disable the auto reset an Arduino pretending to be a programmer will reset itself when it should reset the chip it is trying to program.

A large capacitor on the reset line is one way to do it. I have a miniature slide switch fitted to one of my Arduinos so I can simply switch the auto reset on and off.

pert

I've used Arduino as ISP programmers many times and I never once needed a capacitor (or any other auto-reset disabling trick) until the change to using the arduino protocol instead of the stk500v1 protocol for Arduino as ISP in Arduino AVR boards 1.6.22 (which will be reverted on the next release).

Go Up