Author Topic: use arduino to program ATMEGA168  (Read 3354 times)

0 Members and 1 Guest are viewing this topic.

Offline christosTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: gr
use arduino to program ATMEGA168
« on: August 09, 2014, 09:16:25 am »
i have the arduino uno rev 3 and i would like to program some ATMEGA168...can i just remove the chip and place the new one and program it to?use it like a chip programmer
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2085
  • Country: sk
Re: use arduino to program ATMEGA168
« Reply #1 on: August 09, 2014, 09:21:38 am »
you need to load one arduino with the ISP programmer sketch and use is as a programmer for the other atmega.
the ISP programmer sketch is included in the arduino software and it's documented on the arduino page.
or just google it ;) lot of related stuff over there ;)
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: nz
Re: use arduino to program ATMEGA168
« Reply #2 on: August 09, 2014, 09:26:31 am »
Be aware that the letter P means the chip is a slightly different version and may have a different signature when programming.
Check if you have  ATMEGA168P   or   ATMEGA168.
Pinouts and functionality are the same, so both will work. The difference is to do with power consumption and other electrical parameters.

Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline christosTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: gr
Re: use arduino to program ATMEGA168
« Reply #3 on: August 09, 2014, 09:26:56 am »
thx
 

Offline christosTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: gr
Re: use arduino to program ATMEGA168
« Reply #4 on: August 09, 2014, 09:29:16 am »
http://arduino.cc/en/Hacking/Programmer 

very easy to do...so if i do this i will be able to program multiple chips (same chips)?

thx
 

Offline christosTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: gr
Re: use arduino to program ATMEGA168
« Reply #5 on: August 09, 2014, 09:31:22 am »
does the chip itself have the bootloader in it ?
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: use arduino to program ATMEGA168
« Reply #6 on: August 09, 2014, 09:54:53 am »
You need to ask more unambiguous questions.

http://arduino.cc/en/Hacking/Programmer 

very easy to do...so if i do this i will be able to program multiple chips (same chips)?

thx

Once you have a programmer, you can program a whole variety of chips. Typically, if you have a single PCB with multiple microcontrollers (which is sort of unusual to be honest), each microcontroller will have its own ISP header*; if you want to program chip X, plug your programming into header X. If you want to simultaneously program several different chips with the same programmer, that seems possible in principle but let's leave that for later.

* If you use JTAG instead of ISP to program, there are ways to program multiple chips through a single header, but that's not relevant while you're working with ISP.

does the chip itself have the bootloader in it ?

Do you mean "do brand new AVR chips have the Arduino bootloader (or any bootloader) installed by default?"? The answer is no, the chips will not have the Arduino bootloader installed. But if you're programming with ISP, you don't need any bootloader, so don't worry about this. The Arduino bootloader is only there to accept a program from the USB line via a fairly ugly hack. You'll be sending the program via ISP, which requires no bootloader at all, so you're fine.
 

Offline ion

  • Regular Contributor
  • *
  • Posts: 142
Re: use arduino to program ATMEGA168
« Reply #7 on: August 09, 2014, 10:24:49 am »
http://arduino.cc/en/Hacking/Programmer 

That link is for using a dedicated programmer.  I think this might be more like what you were asking about:

http://arduino.cc/en/Tutorial/ArduinoISP

You can skip the last step - as rs20 wrote - you don't need a bootloader on the target chip.
 

Offline Bryan

  • Frequent Contributor
  • **
  • Posts: 618
  • Country: ca
-=Bryan=-
 

Offline christosTopic starter

  • Regular Contributor
  • *
  • Posts: 217
  • Country: gr
Re: use arduino to program ATMEGA168
« Reply #9 on: August 09, 2014, 11:12:18 am »
thx all
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2320
  • Country: au
Re: use arduino to program ATMEGA168
« Reply #10 on: August 09, 2014, 11:12:31 am »
This works well.

https://www.tindie.com/products/jeffmurchison/arduinoisp-deluxe-shield-kit/

Yikes, $25? Why not just get an actual programmer without the need for all those fiddly DIP switches and a spare Arduino?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf