Problems when trying to burn the bootloader

Hi. I am trying to make a remote and receiver for rc cars. I made 2 custom PCBs with the atmega328p mn. I bought an USBasp programmer online, but I keep getting the same error while trying to burn the bootloader to the microcontroller.

avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Failed chip erase: uploading error: exit status 1

I left iscp pins for this purpose, the pins are 1mm pitch.




I also tried to use the spi pins for the nrf24l01 module (the shared spi ones) but I get the same error.
The seller of the programmer advised using a piece of software called PROGISP.
but still, no luck.

I really want to finish this project,since its my first major one.

Thanks! (it is my first time doing this, and English isn't my first language

Is there anything connected to J5 while you are attempting to program?

If it is a USBasp programmer with stock firmware, it is a bit too fast for a factory fresh AVR. You need to slow the bit clock down. On the USBASP there should be a jumper, JP3 I think, that you should insert.

Hi. i did what you said, and i get this error:
avrdude: Expected signature for ATmega328P is 1E 95 0F
Double check chip, or use -F to override this check.
Failed chip erase: uploading error: exit status 1

I think that now it sees the microcontroller, but can;t communicate with it..

I saw an youtube tutorial on this error, and the solution seems to be changing the adress in some arduino document.But i dont kow where to find the adress for me, since i am using an atmega 328pb mu

Just to be sure.
You first said 328P and now you say 328PB.
Which is it?
The bootloaders are different.

Nope. nothing is connected

It is an atmega 328PB-MU. Sorry, my mistake...
Where can i get a bootloader for this?

You need to install this board package

I installed Mini core, selected the board, but i get this error

Warning: cannot query manufacturer for device: Broken pipe
Warning: cannot query product for device: Broken pipe
Error: cannot find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'
Error: unable to open port usb for programmer usbasp
Failed chip erase: uploading error: exit status 1

I'd reboot everything and try again.
Which operating system are you using?

I see quite a few mistakes on you layout.
Please post the schematics as a pdf or image. No screen captures please

It worked!!!! I managed to burn the bootloader using the github repository you gave me. Thanks. It worked after i changed the usbasp driver. Can i also upload sketches using this usbasp progerammer?

Yes but now that you have a bootloader you can use the serial port to upload programs.
I'd still like to see your schematic, there may be other problems.

schema.pdf (34.1 KB)
pcb1.pdf (32.7 KB)

i left the rx/tx pins on the board. I just need to solder wires to them

I tried uploading via programmer, but i get this error
Warning: no eeprom data found in Intel Hex file C:\Users\burle\AppData\Local\Temp\arduino\sketches\09925D581CF28136619BFC8A8DF96E9F/Blink.ino.eep

The xtal connections are completely wrong.
What is the exact part number for X1 on your schematic?

3225-16M-SR SR PASSIVES - Rezonator: de cuarţ | 16MHz; ±10ppm; 9pF; SMD; 3,2x2,5x0,7mm | TME - Componente electronice România

It connected wrong. The capacitors are supposed to connect between the XTAL pins in ground. You have them in series with the pins so the 328PB will never work.

Did you study the 328PB data sheet before you designed this board?

I assumed it is the same atmega 328 from the arduino nano. I basically copied arduino nano schematic