uno as ISP bootloader for a ATmega162

Hi
I've got a ATmega162(from my x0xb0x) without a bootloader.
Can I use the Uno as a ISP to put the bootloader on the 162?
I've got the bootloader hex file but I dont know how to put it on.

Could anybody please help me out?

Hi,

evostars:
Can I use the Uno as a ISP to put the bootloader on the 162?

Let's find out. First stop, the datasheet... http://www.atmel.com/Images/doc2513.pdf We need to look through the Memory Programming section. We're looking for Serial Downloading. And, it's there.

Wiring is easy to remember...

MISO to MISO
MOSI to MOSI
SCK to SCK

GND to GND

SS on the Uno to RESET on the target

The target has to be powered close to 5V. As long as the current is within reasonable limits, the target can be powered from the Uno.

The target's SPI pins are listed in the Memory Programming / Serial Downloading section.

From when i did it,

SCLK = Pin8
MISO = Pin7
MOSI = Pin6
RESET = Pin9
VCC = Pin40
GND = Pin20

XTAL1 = Pin19
XTAL2 = Pin18

I used an uno to upload it as suggested above.

yes I got that far. Got the pins right.
But in the IDE, I dont get to bootload my own .hex file.
Instead I see I can only select different cpu's. I even tried selecting a 168, but when I bootload, it says error wrong cpu (or something like that).

I dont see how I can load my own bootloader.hex file into my 162 chip, with the IDE...

I've read and used these:

But they dont explain how to do it with a other cpu (162)
should I maybe copy paste the bootloader.hex file of the atmega162 to the right map (exeamples?)?

after reading this: http://www.atmel.com/Images/doc2513.pdf We need to look through the Memory Programming section. We're looking for Serial Downloading.

I learned I ned to pull down reset to ground, to program it, I had it tied down to 5V.

But still no clue how to proceed...

Have you edited the boards.txt file to include the Atmega162?

If so, select that as the current board (tools->board), and then select the programmer (tools->programmer-"Arduino as ISP"). Then click burn bootloader (tools->"burn bootloader")

That will locate the hex file specified in the boards.txt file, and burn it to the Atmega162.

Quick question, are you using the bootloader I modified? If so, I realised there is a mistake in the pins_arduino.h file which I will change in my other thread. If you did use mine, you will need to redownload the .h file.

TCWORLD:
Have you edited the boards.txt file to include the Atmega162?

If so, select that as the current board (tools->board), and then select the programmer (tools->programmer-"Arduino as ISP"). Then click burn bootloader (tools->"burn bootloader")

That will locate the hex file specified in the boards.txt file, and burn it to the Atmega162.

Quick question, are you using the bootloader I modified? If so, I realised there is a mistake in the pins_arduino.h file which I will change in my other thread. If you did use mine, you will need to redownload the .h file.

No, i didn't use your bootloader. Got a link for me?
I'll try to find the textfile, and change it.
Thanks!

There is another thread called "Making Bootloader for Atmega162", just below this one.

TCWORLD:
There is another thread called "Making Bootloader for Atmega162", just below this one.

Ah cool. Missed that.

Done! it worked :slight_smile: