Pages: [1]   Go Down
Author Topic: ATtiny45 vs 328P using Arduino ISP  (Read 1015 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the difference is the auto reset that arduino uses, if you are using ISP to program another 328 you dont need it
Logged


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

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

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

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.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that is cause the cap absorbs the reset pulse
Logged


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

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?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6639
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

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.

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

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.
Logged

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

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.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged


Pages: [1]   Go Up
Jump to: