This error not only come when you selected the wrong port and wrong board. It also come when if your bootlooder has crashed.IF you have run Infinite loop program where bootlooade hanged . So you need to update bootloader. YOu will get avr pocket programmer from sparkfun .You can use that for uploading bootloader. once its done you can use it normally
@AMPS-N
Thank you for your reply! However, I've already used a programmer to burn the bootloader to the 328P. I used usbasp.
I tried to upload the blink code using the programmer and it works. I think I get the stk500 error because of Atmega328P and PL2303's miscommunication but I don't know how to test.
Also, can anyone help me how to choose the right board in Tools>Board?
I made my own board and there's so many controller using 328. I don't know if what I burned was ok or not
Can you share your snapshot of IDE tool to select board option.Which board you purchased.
You made own board its fine , Have you made clone of arduino like uno , mega etc. Which version of clone you made.
You can go with Arduino UNO .When you connect board atomically depend on port it chooses board.
How are you achieving RESET of the chip being uploaded to (for uploading from IDE)?
You said that blink.ino worked when uploaded; how did you upload it? When you upload a sketch with a programmer (usbasp), it WILL erase the bootloader in the process of programming the sketch. Only the bootloader itself can upload a sketch AND leave the bootloader untouched.
AMPS-N:
You made own board its fine , Have you made clone of arduino like uno , mega etc. Which version of clone you made.
I made a clone of Gizduino-- it's a local version of arduino in my country. It uses ATmega328 SMD. I just checked and I was using ATmega328P. What is the difference in burning the bootloader of the two chips? Can you suggest what to select in the Tools>Board? I've tried Arduino UNO since it also has SMD version but I still get the error
westfw:
How are you achieving RESET of the chip being uploaded to (for uploading from IDE)?
I connected pin29(RESET) of ATmega328P to a pull up resistor to 5v, a push button switch to ground, a capacitor to the DTR of PL2303(USB to Serial Adapter), and a resistor to the RTS of PL2303.
westfw:
You said that blink.ino worked when uploaded; how did you upload it? When you upload a sketch with a programmer (usbasp), it WILL erase the bootloader in the process of programming the sketch. Only the bootloader itself can upload a sketch AND leave the bootloader untouched.
I uploaded it using usbasp programmer just to check if the controller chip causes the error. When I saw the LED blinks, I again burn the bootloader. the stk500 error appears again when I try to upload a code using serial
that doesn't sound right. There are some versions of schematics floating around that show components in the autoreset circuitry that are not actually populated on real boards, because alternate components provide the same functionality.
Probably, the RTS signal held the chip in RESET at the wrong times. The capacitive coupling ensures that only transitions of the signal (such as occur when the port is opened) cause the AVR to reset.