Arduino Forum

Using Arduino => Microcontrollers => Topic started by: chuff014 on Nov 14, 2012, 09:54 pm

Title: Pickit 2 with the ATMega
Post by: chuff014 on Nov 14, 2012, 09:54 pm
Can I use it to program the chip on an Arduino board with the FTDI interface?
Title: Re: Pickit 2 with the ATMega
Post by: CrossRoads on Nov 14, 2012, 09:56 pm
What is "pickit 2"?
Title: Re: Pickit 2 with the ATMega
Post by: nickgammon on Nov 14, 2012, 10:02 pm
An ICSP programmer device for the MicroChip range of processors.

I think the simple answer is: No.
Title: Re: Pickit 2 with the ATMega
Post by: dhenry on Nov 14, 2012, 10:13 pm
Quote
Can I use it to program the chip on an Arduino board with the FTDI interface?


Yes, you can.
Title: Re: Pickit 2 with the ATMega
Post by: nickgammon on Nov 14, 2012, 10:38 pm
Hmm. It looks like the PicKit has got a UART mode, so with the right connections it may work. I haven't tested it. Which Arduino board do you have? Why not just use the USB interface?
Title: Re: Pickit 2 with the ATMega
Post by: chuff014 on Nov 15, 2012, 03:51 pm

Hmm. It looks like the PicKit has got a UART mode, so with the right connections it may work. I haven't tested it. Which Arduino board do you have? Why not just use the USB interface?


I want to use a pair of barebones arduinos in my project, to cut costs. I just wanted to know if I can use my existing programmer, or if I'd have to buy a programmer.
Title: Re: Pickit 2 with the ATMega
Post by: nickgammon on Nov 15, 2012, 09:04 pm
Right, then we have to get the terminology right. Will these barebones boards have a bootloader on them? If not, the FTDI interface won't put it there. You need an ICSP programmer (one that uses the SPI interface) and I strongly doubt that the Pic Kit will do that. Its interface will be for PIC chips.

To save costs, if you have at least one Arduino already you can use that as an ICSP programmer. Search for "Arduino as ISP". I wrote a sketch that lets you put code onto SD cards and program bare baords, as described here:

http://www.gammon.com.au/forum/?id=11638

Example in use:

(http://www.gammon.com.au/images/Arduino/Chip_Programmer3.jpg)

However you can get cheap ISP programmers.  eg. This one for $20:

http://www.pololu.com/catalog/product/1300

(http://b.pololu-files.com/picture/0J1324.200.jpg)
Title: Re: Pickit 2 with the ATMega
Post by: dhenry on Nov 15, 2012, 09:07 pm
Quote
I want to use a pair of barebones arduinos in my project, to cut costs.


A standalone programmer for the price of a cup of latte.

Quote
I just wanted to know if I can use my existing programmer, or if I'd have to buy a programmer.


Yes you can. But standalone programmer for avr is easier.
Title: Re: Pickit 2 with the ATMega
Post by: chuff014 on Nov 15, 2012, 10:26 pm
So would the $15 pocket AVR programmer from Sparkfun be able to burn the bootloader?
I do have a couple of unburnt ATMegas in transit.

I can use the Pickit 2 to flash in place, but not to burn.
Title: Re: Pickit 2 with the ATMega
Post by: fungus on Nov 15, 2012, 10:37 pm

So would the $15 pocket AVR programmer from Sparkfun be able to burn the bootloader?
I do have a couple of unburnt ATMegas in transit.


Yes. You can also use it to program ATtiny chips like the ATtiny84 and ATtiny85, etc. Make really small devices.

Title: Re: Pickit 2 with the ATMega
Post by: dhenry on Nov 15, 2012, 10:43 pm
Quote
So would the $15 pocket AVR programmer from Sparkfun be able to burn the bootloader?


Yes. Better yet, $5 avr programmers can do that too.
Title: Re: Pickit 2 with the ATMega
Post by: chuff014 on Nov 16, 2012, 12:35 am
Where's a $5 AVR programmer?
Title: Re: Pickit 2 with the ATMega
Post by: pito on Nov 16, 2012, 01:27 am
http://www.ebay.com/sch/i.html;jsessionid=B963627E40ECEEA2581357A48E3273E6?_sacat=0&_from=R40&_nkw=usbasp&_nkwusc=uspasp&_rdc=1
Title: Re: Pickit 2 with the ATMega
Post by: oric_dan on Nov 16, 2012, 06:21 pm
Quote
Yes, you can.


Maybe in a parallel universe, ie programming a PIC. [would be nice if "just once" there was some
explanation attached to those comments, so we wouldn't have to be mind readers all the time].

I have PICKIT2 and PICKIT3 and actually do most of my programming on PICs. The PICKITs and PICs in
general use completely different programming algorithms from AVR, and have 3 output pins, Mclr/Vpp
[typically 13V for programming], plus SCLK and SDA lines, which are not Sclk, MOSI, MISO.

Also, I've used the UART mode of the PICKIT and it really doesn't work all that well for some reason,but
maybe could be jiggered for downloading sketches to an Arduino bootloader [which is unnecessary in any
case], but doubtful for recoding a raw AVR. Better to use an FTDI Friend/etc on a board without a USB
chip.

I also bought one of the AVR programming dongles from Pololu, but never could get it installed properly on
my notebook, so to burn bootloaders, I use 2 Arduino boards connected via the ICSP headers, and run the
bootloader sketch from the IDE on the master board.






Title: Re: Pickit 2 with the ATMega
Post by: westfw on Nov 17, 2012, 03:10 am
http://dangerousprototypes.com/2010/04/07/program-your-avr-with-pickit2/

the owner seems to have disappeared, though.
Title: Re: Pickit 2 with the ATMega
Post by: oric_dan on Nov 17, 2012, 09:08 am
Quote
http://dangerousprototypes.com/2010/04/07/program-your-avr-with-pickit2/


I guess that shows how much I know, LOL.
Title: Re: Pickit 2 with the ATMega
Post by: nickgammon on Nov 17, 2012, 09:33 am
Another wasting of time thread. Go buy a $5 programmer.