Pages: [1]   Go Down
Author Topic: using arduinoISP to program standalone atmega328  (Read 2276 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys, I have a quick question smiley

I have set up the following:

PC ---> arduino (seeeduino 168) ---> standalone atmega328

What I mean by 'standalone atmega328' is a small pcb with a 328, 16MHz oscillator and a ISP header.  I want to develop my ardiuno program and upload it to the standalone board using arduinoISP, saving having to buy a programmer.

I've triple checked all my connections and I think everything is right.  I have set upload.using=arduinoisp in my preferences file and burnt arduinoisp to my arduino.

However, when I try to program the 328, it tries to program the arduino!  E.g. I select 328 from the board list and it gives the error:
avrdude: Expected signature for ATMEGA328P is 1E 95 0F

When I select 168 from the boards list it ends up programming the arduino!

So it seems that the upload.using=arduinoisp isn't working for me.  Any ideas?

Thanks!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34541
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So what software have you running in the arduino (seeeduino 168)?

This software has to make the arduino look like a programmer as far as the serial port is concerned.

The 328 board from the menu only tells the compiler how to compile the code it doesn't go off and look for a 328 board.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The seeeduino is running arduinoISP. (Sorry, just realised I didn't actually say that :-[)  I have now run avrdude from the commandline and successfully uploaded the blink example sketch to the atmega328.  It seems the arduino IDE is broken, or I am misunderstanding the documentation!  What I want to do is press the upload button and have it send the firmware to the 328, via arduinoISP.  I thought this would be possible using the 'upload.using=arduinoisp' but it doesn't seem to work.

The blink sketch is also running very slowly, presumably because I haven't set the fuses correctly to match the crystal.  I'm using a 16MHz crystal and a one second delay takes 16 seconds.  I will see if I can burn the standard arduino fuse values now.
« Last Edit: July 14, 2010, 11:49:05 am by wolfie » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34541
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I thought this would be possible using the 'upload.using=arduinoisp' but it doesn't seem to work.

This could be because the auto reset circuit is being triggered and making your seeeduino think the sketch is for it. You could try disabling it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You're right! Disabled the autoreset and now everything is working perfectly.

Thanks very much smiley

If someone with the relevant permissions to could update the arduinoISP page (http://arduino.cc/en/Tutorial/ArduinoISP) it might save other people a headache too! E.g. add a step between 2 and 3: 'Disable auto reset, if available, on the arduinoISP board'.
« Last Edit: July 15, 2010, 04:30:04 am by wolfie » Logged

Pages: [1]   Go Up
Jump to: