Loading...
Pages: [1] 2 3   Go Down
Author Topic: Programming an ATtiny85 with Arduino Code and Arduino Uno as Programmer  (Read 1659 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Id like to program an ATtiny85 with Arduino code using an Arduino Uno as programmer as explained in the tutorial by MIT Media lab.

When uploading the blink sketch or trying to burn a bootloader it says:

Code:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I heard that I can ignore the first error.
What did I do wromg?
The arduino has an ATmega328 chip.

Also, here is a picture of my setup.
« Last Edit: October 15, 2012, 10:53:50 am by marian42 » Logged

Leeds, UK
Offline Offline
God Member
*****
Karma: 35
Posts: 982
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You *may* need a 10k pullup resistor on the reset pin (between pin1 and pin8).  All the other connections appear correct.
Logged

~Tom~

Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got the same results with the resistor.
Logged

Leeds, UK
Offline Offline
God Member
*****
Karma: 35
Posts: 982
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do the lights on the Arduino blink when you try and upload?
Logged

~Tom~

Denmark
Offline Offline
God Member
*****
Karma: 19
Posts: 674
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be easyer to troubleshoot if you connect the 3 LED's mentioned in the sketch

Quote
Put an LED (with resistor) on the following pins:
 9: Heartbeat - shows the programmer is running
 8: Error - Lights up if something goes wrong (use red if that makes sense)
 7: Programming - In communication with the slave

And you could try this core:
http://code.google.com/p/arduino-tiny/downloads/list
Logged

Offline Offline
Full Member
***
Karma: 6
Posts: 126
Knowledge is proportional to the number of parts destroyed.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is the setup I use. I have programmed over 30 ATTiny 85s and 45s  with this circuit and it works reliably for me:

1. The google core Erni mentioned.

2. The ISP sketch from Lady Ada, loaded onto my Uno R3:
https://raw.github.com/adafruit/ArduinoISP/master/ArduinoISP2.pde



3. The wiring in the attached image:
Note the capacitor from RESET to GROUND. I used a 47 microfarad, but anything from 10 to 100 should work.

EDIT! Link to incorrect image removed.

Sorry if the image looks odd, it's my first time using Fritzing.




« Last Edit: October 15, 2012, 03:10:03 pm by Telecommando » Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 116
Posts: 10134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The blue wire does not look correct.

Going from left-to-right, the second green wire is not necessary.
Logged

Leeds, UK
Offline Offline
God Member
*****
Karma: 35
Posts: 982
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The blue wire does not look correct.

In that diagram the black wire above the blue wire should be one hole to the left - I think the blue is correct.
Logged

~Tom~

Offline Offline
Full Member
***
Karma: 6
Posts: 126
Knowledge is proportional to the number of parts destroyed.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good catch! I traced it out from the version I built on a perfboard and missed that.

But the blue wire is correct. It's the black ground above it that's wrong.

This one should be better:



The second green wire is for the clock signal produced by the Ada ISP sketch; for chips that have the fuses set to use an external oscillator or crystal.
Not shown is a piezo transducer, which is handy for my personal use (signalling me when it is finished and time to change chips) but otherwise unnecessary.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay so I got it to work!

But I promise all I changed was attaching the three LEDs.
During the process the error led lights up shortly.
The power led stays on and the working led blinks.

The pullup resistor is not necesary.

Thanks for your help guys!

I tried it with another (small) ATtiny85 on a PCB with components attached and got this problem:

Code:
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

and after some tries its always this one
Code:
avrdude: stk500_getsync(): not in sync: resp=0x00

During the upload only the power led is on.
This ATtiny already has a sketch on it.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 116
Posts: 10134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I tried it with another (small) ATtiny85 on a PCB with components attached and got this problem:

Components?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Two LEDs, a light sensor, a piezo buzzer and a button. It also has a battery slot and some resistors.
I dont have the schematics but I think the components are simply wired up to the five pins.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 116
Posts: 10134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The LEDs are very unlikely to be a problem.

The light sensor may or may not be a problem.

If the piezoelectric buzzer is wired directly to an SPI pin it is a problem.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I watched the board being programmed with the ATtiny soldered on it so Im quite sure its possible. It has eight holes for programming.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 116
Posts: 10134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Enable verbose output for uploads and post the results.  Please use code tags.
Logged

Pages: [1] 2 3   Go Up
Print
 
Jump to: