arduino mini pro program (icsp) 20mhz atmega328

Hi all,

I have a mini pro 3v3, 8mhz that i wanna use as icsp to program a 328p that has a 20mhz running. the 328p is running at 5v and has miso, mosi and rst connected to a level shifter to the mini pro.

Now my biggest problem is the programming. From what i have seen you should add 10uf to the mini's reset so it won't reset right? but i found some tutorials that did not do that. What do i do? Also i heard that you have to burn the bootloader because it sets the fuses correct? Another thing is that is has to be modified so it knows its running at 20mhz because it wont work if i dont.

I saw a tutorial where they programmed a 328p standalone using a uno, he presses shift "upload using programmer". But the configuration at that time is set to the uno or mini in my case. So how do i let the IDE know that it has to take in mind that the 328p is running at 20mhz?

hope this makes sense.

Put 10uf cap (approx - this value is not critical. Anything over 1uf will probably do it) between reset on ground on the Arduino running Arduino as ISP.

Arduino as ISP is fiddly, I recommend you invest the $3 in a USBAsp so you have a real programmer that just works.

To run it at 20mhz you need a board definition that defines 20mhz F_CPU and has fuses configured for an external crystal. I think hansibull's minicore provides this clock option - I recommend using this so you don't have to go modifying your boards.txt - his core provides a bunch of sub-menus in tools menu to configure the speed, BOD voltage and other applicable settings.

When doing upload using programmer, the tools -> programmer option must be set to the programmer you are using (Arduino as ISP, or USBAsp if you took my advice and bought one of those), and the tools -> board option and all other options must refer to the board you are programming.

I tried hansibull’s minicore, with the Arduino, waiting on a real programmer. to set the fuses on a empty chip i need to burn the bootloader first right?

Also whats the difference between “Arduino as isp” and “Arduinoisp”.

At this moment it is unable to read the signature. Im thinking my level convertion is screwing up at this moment.

Update: i was able to program using the mini pro now. So my last 2 questions remain:

to set the fuses on a empty chip i need to burn the bootloader first right? (hansibull's minicore)

Also whats the difference between "Arduino as isp" and "Arduinoisp".

From the MiniCore readme file:

Select your microcontroller in the boards menu, then select the clock frequency. You'll have to hit "Burn bootloader" in order to set the correct fuses and upload the correct bootloader.

You can't just set the fuses with this core, it will also upload the bootloader (512b allocated).

Arduino as ISP is what it says; You use your Arduino as an ISP programmer. However, the ArduinoISP is a confusing name. You can read more about the ArduinoISP here. It's basically a clone of the FabISP, which runs the USBtinyISP firmware.

I'll recommend you to either buy the USBasp or the USBtinyISP, as these works with almost all AVR microcontrollers and are widely supported on all platforms.

EDIT: disregard the information below. I thought you meant that you were using a minipro programmer.

You can set the fuse bits using the minipro programmer without burning a bootloader. The fuse bit options are in the minipro interface.

If you are going to use the minipro programmer exclusively to program the chip, you can load the program hex file (compiled by arduino when you click the "verify" sketch button in the arduino interface and stored as a .hex file in your windows user/appdata/local/temp/build/ folder) directly into the minipro interface and program your chip that way. A bootloader is only necessary if you use the traditional sketch upload method without using the minipro programmer. Not adding a bootloader will save you some program memory space.

DrAzzy: Arduino as ISP is fiddly,

Since when? I've used it many times and never had an issue.

I don't have problems with it either, but if you look around these forums, the rate of "having trouble making Arduino as ISP work" is very high - much higher than the rate of people having trouble using a USBAsp or similar. It certainly has a much longer list of things that could be wrong.

I swapped the level shifter and i am able to program using arduino mini pro just fine now.

Im just guessing here but if i change the fash size to the max does the "upload" not overwrite the bootloader at the end? as i do not need this anyway and my fuses will be set.

DrAzzy: I don't have problems with it either, but if you look around these forums, the rate of "having trouble making Arduino as ISP work" is very high - much higher than the rate of people having trouble using a USBAsp or similar. It certainly has a much longer list of things that could be wrong.

Maybe that's because I bought an ISP shield that was made for 328Ps and I wired up my own with a ZIF socket and protoshield when I started using ATtiny84s. Never bothered fiddling with jumper wire crap, and they've worked flawlessly every time.

You know, planning, forethought.

Jiggy-Ninja: Maybe that's because I bought an ISP shield that was made for 328Ps and I wired up my own with a ZIF socket and protoshield when I started using ATtiny84s. Never bothered fiddling with jumper wire crap, and they've worked flawlessly every time.

You know, planning, forethought.

Both you and DrAzzy is right. The Arduino ISP isn't inherently bad, it's just that people (often newbies) that doesn't have an ISP adapter would have to fiddle with jumper wires, breadboards, capacitors and crystals. There's so many things that can go wrong :P When I'm working on my Arduino cores I need a programmer and a setup that I can trust. That's why I'm using "proper programmers" such as the USBtinyISP and USBasp. All my AVR dev boards got ISP connectors as well, so there's no need to make a DIY fix :)

The boards I design all get an ICSP header and an FTDI header for easily plugging on a programmer for bootloading and a USB/Serial adapter for debugging. I may not install headers, and I often just hold male pins in the holes when bootloading, then th end user can populate as they wish, but the holes are there for use when needed.