Can you put a Atmega168 into a Arduino Mega?

Hello forum.

I recently started working with the arduino. I bought the Arduino Mega and an additional atmega168 to bread board it out(with crystal etc).

My question is, is it possible to put an atmega168 into the arduino mega just to upload the sketch?

Thx,

gabber

Nope, this isn't possible. The mega uses a SMD atmega chip, which is soldered to the board. The atmega168 you bought is in a DIP package. Now if it were a duemilanove or uno board (or diecimila even), this wouldn't be a problem, but since the controller is soldered to the mega board as opposed to using a DIP cradle, this isn't possible.

However, you should still be able to program it using your mega as a ICP (is this the correct term?) programmer to upload the bootloader and/or sketch.

Thank you for the fast reply.

Could you please put it in my easy words, I do not quite follow you thereā€¦

Can I pull out the atmega328 out of: http://www.sparkfun.com/products/9950 (Arduino Uno) and then put in the Atmega168 without losing all of the functionalities, expect for that it might be slower because the micro-controller is not exactly the same speed?

thx,

Gabber

Can I pull out the atmega328 out of: http://www.sparkfun.com/products/9950 (Arduino Uno) and then put in the Atmega168 without losing all of the functionalities, expect for that it might be slower because the micro-controller is not exactly the same speed?

You might not be able to put a ATMega168 into the Uno, since the IDE assumes there is a 328 in it.

The processors are the exact same speed, both run at 16MHz. The major difference is the amount of code storage and SRAM. (The 168 has half of the 328.)

But since its sufh a small difference, why can't I replace them?

I mean, it is possible on the arduino 2009, its made for both 168 and 328.

I thought the arduino uno was too, but as far as I understand it's not?

Good point. All you need to do is modify the boards.txt.

I just created a new board called "Uno w/ 168", made the appropriate changes, and uploaded the blink example.

Could you please tell me what changes I should make, this is how my arduino uno looks like (Atmega328)

uno.name=Arduino Uno
uno.upload.protocol=stk500
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino