Unable to programm atmega328p-pu with PL2303HX [NEED HELP]

Go To Last Post
37 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have pl2303hx programmer and i want to program atmega328p-pu with arduino.

it does not have auto reset so i followed this circuit for auto reset.

I have also attached and LED to check the LED on off.

When switch is unpressed then it is off.

 

I have used this diagram:

http://postimg.org/image/ou9x0pkz5/

 

Firstly i press and hold the reset and then click on upload.

And when it show uploading i count to 3 then release the switch.

 

But then it gave me following error:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x01

And the only light which is on in pl2303 programmer is green.

 

-------------

Now new problem.

When i plug in pl2303 programmer green and blue light both of then are on by default.

 

And the same error is comming up while send the sketch.

The only addition is blue light with green light.

 

I have checked my programmer with checkChipVersion tool which tells which chip i have.

So it is confirmed that my programmer is still working.

--------------------

One more thing i would i like to tell is the first time i tried to programm the atmega328p-pu i also connected an LED with PIN 19 and it was glowing it seems the the atmega328 was already having the code now the PIN 19 LED is not glowing.

 

I am using the 5V provided by the pl2303hx to power atmega328p-pu

 

Last Edited: Tue. Mar 10, 2015 - 01:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Disconnect AREF from VCC, you are likely to damage something later on when using ADC. Just use a 100nF cap on that pin to GND.

 

Show how your programmer is wired up.

 

Maybe a link to your programmer? No idea what a pl2303hx is.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:

Disconnect AREF from VCC, you are likely to damage something later on when using ADC. Just use a 100nF cap on that pin to GND.

 

Show how your programmer is wired up.

 

Maybe a link to your programmer? No idea what a pl2303hx is.

 

Here's my programmer:

http://www.ventor.co.in/index.ph...

 

I am new to these things and i don't know what AREF is

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here's my programmer:

Err just one small but probably vital detail: that is NOT a programmer!

 

I began to wonder when the thread title mentioned PL2303 but that link to the site confirms it. The device you have there is a UART to USB converter.

 

Now if you had an AVR that had already been programmed once to put some bootloader code into it (as they do with "arduino chips") then, yes, that USB-UART converter is all you might need to program it.

 

But is that really the case - do you have an AVR that you know already contains bootloader code? It's true that some mega328's are sold as "Arduino chips" and what makes them different to plain mega328's is the very fact that the person supplying them to you has already programmed them once to put the Arduino bootloader code (usually "Optiboot") into them first. Maybe that's what you bought? I see that same site has:

 

http://www.ventor.co.in/index.ph...

 

Is that the chip you bought? If it is then you need to show the complete avrdude command you are trying to use.

 

If not you probably need to buy something like this:

 

http://www.ventor.co.in/index.ph...

 

which is a USB programmer that can load code into an "empty" AVR.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I purchased this one:

http://www.ventor.co.in/index.ph...

 

But when i connected led at PIN 19 it was turned on.

I think the supplier supplied me it with bootloader.

But now when i connect LED at 19 it does not turns on.

 

So do you mean pl2303 can not burn bootloader to blank avr chips ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No where on your vendor's product page does he say that the atmega328 is pre-programmed with a bootloader. It is a blank chip (empty of any program).

 

The PL2303 product is, as Cliff has already stated, a USB to UART converter. It is not a programmer of blank atmega328 chips.

 

If the atmega328 had already been programmed with the Arduino bootloader program, you could then use the PL2302 device to load Arduino programs via the bootloader and the Arduino IDE. Here is an instructable that provides step by step instructions. http://www.instructables.com/id/... Admittedly, you have to bring out the DTR pin from the PL2302, but it works.

 

So... how to resolve this problem? The easiest way is to obtain an atmega328 chip which already has the bootloader loaded. The next easiest is to to take your blank atmega328 to someone who has an arduino board and get him to load the bootloader for you. The arduino people have prepared instructions for this at http://arduino.cc/en/Tutorial/Ar...

 

Cheers,

 

Ross

 

Ross McKenzie ValuSoft Melbourne Australia

Last Edited: Tue. Mar 10, 2015 - 02:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The chip at that link appears to be a blank chip.

itscoldice wrote:

But when i connected led at PIN 19 it was turned on.

I think the supplier supplied me it with bootloader.

But now when i connect LED at 19 it does not turns on.

That is quite contradictory and does not make much sense.

itscoldice wrote:

So do you mean pl2303 can not burn bootloader to blank avr chips ?

Correct, the PL2303 USB to TTL- UART Converter Module is not a programmer and as such cannot be used to program blank AVR chips.

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." - Marcus Aurelius               

Last Edited: Tue. Mar 10, 2015 - 05:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The site claims that the PL2303 is original (ie not fake) but can you really trust them?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As we have said you either need to buy this:

 

http://www.ventor.co.in/index.ph...

 

as a replacement for the 328 you already have (once you buy the above you will be able to make use of the existing 328 as you will be able to use the new one as a programmer).

 

An alternative is to buy this:

 

http://www.ventor.co.in/index.ph...

 

As the chip+bootloader is 330Rs and the programmer is 350Rs I think I'd be tempted to simply buy the programmer for the extra 20Rs.

 

You do need to buy one of these two options. The chip alone that you have is useless unless you can find a friend with some kind of programming device.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Personally,   I would be happier with a proper Chinese clone UNO.   But this appears to be an Indian one: http://www.ventor.co.in/index.php?main_page=product_info&cPath=16&products_id=86

 

Or you could go for this: http://www.ventor.co.in/index.php?main_page=product_info&cPath=16&products_id=130

 

Neither of these are exact clones.   i.e. they use PL2303 or CH340 instead of a ATmega16u2 for the USB bridge.

 

I bet that there will be Indian shops that sell proper Chinese boards.    You may have to pay more than a UK or US citizen,    but at least we will know what you are getting.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So i made a mistake in buying pl2303.

 

Since i have blank atmega328 now,i would like to know that USBASP can burn the arduino bootloader optiboot and other like firmata.

Now what i want is,

i want to burn bootloader and the use arduino ide to program different avr chips.

I have listed few more,can these burn the bootloader as well as the my codes using arduino ide

 

http://www.ventor.co.in/index.ph...

http://www.digibay.in/usbisp-pro...

http://www.digibay.in/usbasp-usb...

 

And one thing,since i purchased pl2303 can it be used to burn bootloader to atmega328(any how)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sure, once you have access to a USBAsp or some other ISP programmer you can use it to put the Arduino bootloader into the 328 that you have. When you have done that THIS is when that PL2303 device is going to be useful because a "real Arduino" is effectively a 328+bootloader and a UART to USB converter. Well the PL2303 is that (UART to USB) bit of the jigsaw.

 

So you would use USBAsp or similar to put "Optiboot" into the 328 then you would wire the PL2303 to the TXD/RXD pins on the AVR (oh and add a crystal to the 328 to match the speed the bootloader was built for - probably a 16MHz crystal in fact). Make sure the fuses are set to the same values as an Arudino uses and then what you have will, effectively be an Arudino and the Arduino IDE software on your PC should be able to "see" it and send programs to it.

 

But the first step in all that is getting a USBAsp or other ISP programmer and using it to put Optiboot into the 328.

 

EDIT: forgot to say that once you have the 328 looking and acting like an Arduino you can then download the Arduino ISP "sketch" into it and turn the whole thing into an ISP programmer that can be used to program other AVRs. At this point you no longer need the separate USBAsp/other device so, like I said, if you can find someone who has one you probably only need to use it just once to get started.

Last Edited: Tue. Mar 10, 2015 - 12:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson thanks for telling me about this.

 

Now what i understood from this thread is:

pl2303 can't be used to burn bootloader

USBASP/ISP is used to burn bootlaoder and sketches.

 

Now tell me one thing which will clear my mind:

I want to use usbasp

http://www.digibay.in/usbasp-usb...

http://www.digibay.in/usbisp-pro...

 

will anyone of them be able to use to program avr chips using avrstudio and avr dude.

And can this be used instead of my pl2303 to send sketches to my atmega chips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

USBASP/ISP is used to burn bootlaoder and sketches.

Not quite - while I guess it can be used to burn sketches as well the usual technique would be to just use it to burn the bootloader and then for the following sketches you would deliver those via the PL2303 and the bootloader doing its job.

 

As to the two links you gave. The top one looks far better than the bottom one. USBAsp is a well know programmer design based around an 8K micro. You can generally find a LOT of support for using USBAsp (though some of the ones made in India seem to diverge from the "normal" design). There is another programmer called USBtinyISP that is based on a 2K AVR and is a very basic design (it's supposed to be cheaper but that's it's only advantage). The second device you linked to calls itself "USBISP". It's not clear to me whether than means it is a USBAsp or a USBtinyISP or even something else.

 

It's likely that with any of these programmer you will be able to use avrdude to program anything you build in the Arduino IDE (sketches) or in Atmel Studio but I still think it's better to get something based around the Fischl USBAsp design.

 

Again, while I say you can use such a programmer to put sketches into the 328 (or even Studio code) there's no real need. Once you have put a bootloader into the 328 you can lock the USBAsp/USBISP away in a draw and never use it again and only ever use the PL2303 link and the bootloader to program code into the 328. One advantage of this is that you cannot have an "accident" and accidentally change fuses to make the chiup uncontactable (as can happen when using ISP). So it's "safer". The only "cost" of using a bootloader is it occupies 1K..2K at the top of the chip so of the 32K in a 328 you only get to use 30K or 31K of it. That is very unlikely to matter!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am pretty sure that we have discussed all these points:

 

1.  the Rs.299 USBASP will work with avrdude.

2.  the Rs.329 USBISP will not work with avrdudeit only works with the Chinese progisp GUI

3.  neither avrdude.exe nor progisp.exe will work natively with AS6

4.  you can add the avrdude commands to the 'Post-Build' stage of AS6.

5.  you can add the avrdude commands to the Tools Menu of AS6.

6.  with progisp,   you just need to learn to speak Chinese.    AFIK,   it only works with a GUI.

 

7.  once you have turned your bare ATmega328 chip into an Arduino,   you can use the PL2303 to talk to the bootloader.

8.  as I have said numerous times.    Buy a proper UNO clone.   e.g. http://www.digibay.in/110-dbduino-uno-r3-atmega328-arduino-compatible-clone?filter_name=uno for Rs.1099

 

We can only help by guesswork.    Only Indians can know what is on Indian websites or in Indian shops.    I suggest that you ask for local advice.    Of course,   we have lots of Indian members here.    Perhaps one may be able to help.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

I am pretty sure that we have discussed all these points:

 

1.  the Rs.299 USBASP will work with avrdude.

2.  the Rs.329 USBISP will not work with avrdudeit only works with the Chinese progisp GUI

3.  neither avrdude.exe nor progisp.exe will work natively with AS6

4.  you can add the avrdude commands to the 'Post-Build' stage of AS6.

5.  you can add the avrdude commands to the Tools Menu of AS6.

6.  with progisp,   you just need to learn to speak Chinese.    AFIK,   it only works with a GUI.

 

7.  once you have turned your bare ATmega328 chip into an Arduino,   you can use the PL2303 to talk to the bootloader.

8.  as I have said numerous times.    Buy a proper UNO clone.   e.g. http://www.digibay.in/110-dbduino-uno-r3-atmega328-arduino-compatible-clone?filter_name=uno for Rs.1099

 

We can only help by guesswork.    Only Indians can know what is on Indian websites or in Indian shops.    I suggest that you ask for local advice.    Of course,   we have lots of Indian members here.    Perhaps one may be able to help.

 

David.

 

I want to build my own UNO because if any of the SMDs are damaged it will be a big problem for me to fix it.

So using my own and placing them on PCB will be a good idea and i will also be able to fix the damaged parts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson

david.prentice

 

Thanks for letting me know the difference between these.

Now i am going to purchase this one USBASP(Rs 300)

http://www.digibay.in/usbasp-usb...

 

I will also go for my local shops to check if its available(I know it is available here).

As you said i can use USBASP to burn bootloader and use mypl2303 to send my sketches to micro controller.

But instead of this can i use USPASP to burn bootloader and sketches to micro instead of using pl2303.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes.    Of course you can use it to program the AVR.    I am sure that I have discussed this too.

I suggest that you take the time to read through every reply to your threads.

 

1. If you choose to use the USBASP to upload sketches,   remove the BOOTRST fuse.

2. If you choose to use the bootloader via the PL2303,   install the bootloader via the USBASP from the Arduino IDE Tools menu.    (this sets the correct fuses)

 

I suspect that you are just using a breadboard lash-up.   Option (1) will probably be more convenient.   The USBASP can supply power to your breadboard.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you everyone for your help.

Now i can continue my work. laugh