Go Down

Topic: ATtiny45 vs 328P using Arduino ISP (Read 1 time) previous topic - next topic

stonent

I'm a tad confused on some of the Arduino as ISP stuff.

So far I can program an ATtiny45 just find as ISP using these pinmappings:

SCK   > Digital 13
MISO   > Digital 12
MOSI   > Digital 11
RST   > Digital 10

VCC   > +5V
GND   > GND

I can burn the 8MHz Bootloader and the 1MHz one, uploading sketches works great also.

Now all the diagrams to do something similar with a 328p show using a jumpered 10uF cap across RST and a crystal.

Is there something different in the way the 328p behaves that you need the hardware?

I don't have any crystals and the closest cap I have is a 100uF or a 100nF

Osgeld

the difference is the auto reset that arduino uses, if you are using ISP to program another 328 you dont need it
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

stonent

Well I'm using the Arduino as ISP sketch on a Rev 3 Uno.

stonent

Ok tried the 328 with the Arduino as ISP sketch and it programmed it into the chip on the board.

I put the 100uF across rst and gnd and got a sync error when programming.

Osgeld

that is cause the cap absorbs the reset pulse
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

stonent

I find it interesting that it doesn't need the cap for the ATTiny.
But with the cap nothing gets programmed.

Does the 328 that has never been programmed before work without a crystal like the ATTiny does?

dc42


Does the 328 that has never been programmed before work without a crystal like the ATTiny does?


Yes. However, if you use the "burn bootloader" option of the Arduino IDE, then that also sets the fuses; so after that you do need a crystal. If you just use ArduinoISP to program a sketch directly into the atmega328p, then the fuses are not changed and it will run your sketch using the internal oscillator (8MHz with a prescaler of 8, so 1MHz).
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

stonent

Ok, so I've got a couple of things to try.
1. Try the 328 that wouldn't program in the arduino itself to see if it will take a sketch.
2. Try the 328 that I've never removed from the packaging to see if it will take a sketch as is.

stonent

Ok results:

Putting the 328p into the Arduino did work when I loaded the blink sketch on it.
Trying to flash the never-been-touched 328p just got me a sync error.

Osgeld

from the factory its running at 1mhz, with no bootloader, with an ISP you can set the clcok and install the bootloader (its physical software that sits at the start of flash just like the bootloader to your PC)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Go Up