Project with ATMega328P Surface Mount IC

I am working on a cellular project involving a SIM808 GSM chip and want to put the ATMega328P surface mount IC on the same board in order to run it. I want to be able to program it and make sure it runs correctly before I go ahead and order a custom-made PCB. I know my schematic is really messy…sorry about that. I have never used an ATMega before other than on a standard arduino board, never standalone. I have attached a picture of my schematic below. Please let me know if I have anything wired incorrectly or if you need a better image of the schematic.

Thanks a million,
Joe

Schematic_STEM Project_Sheet_1_20200123094735.pdf (123 KB)

Keep in mind that you used a 328pb in your schematics. That's an extended version of the 328p used in an UNO.

Yes that is what I planned on using. So I take it that my circuit diagram is correct then in order to run the Atmel standalone then?

So I take it that my circuit diagram is correct then in order to run the Atmel standalone then?

Me thinks you be confused but of course I could be wrong.

Pylon pointed out you said you wanted to use a 328P and then used a 328PB in your schematic. It’s not the same chip. For example, the P has one SPI port, the PB two. As shown, you will not be able to program the device since you used the wrong SPI port.

For prototyping and proving out your design, which Arduino board do you have that uses a 328PB?

So I take it that my circuit diagram is correct then in order to run the Atmel standalone then?

I never used a 328pb myself, I have a lot of 328p in use here though.

According to the datasheet at least the pinout should be similar enough to probably work.

Your circuit is not complete but as you don't use the ADC it should work for the ATmega328 part except for the ICSP which is connected to the wrong port I guess. I would use the hardware serial interface (PD0/PD1) to communicate with the SIM808 but that's up to you. Also I don't see the voltage of the Vcc pin. 5V would be necessary for the ATmega328 but that's over-voltage for the SIM808, so I think you have to fix here something.
If CN1 is a battery connector, you would power the ATmega directly from the battery. That won't work at 16MHz and is not recommended. You should provide a regulated voltage to the ATmega.

WattsThat:
Me thinks you be confused but of course I could be wrong.

Pylon pointed out you said you wanted to use a 328P and then used a 328PB in your schematic. It’s not the same chip. For example, the P has one SPI port, the PB two. As shown, you will not be able to program the device since you used the wrong SPI port.

For prototyping and proving out your design, which Arduino board do you have that uses a 328PB?

Yes, I am sorry. I am using the ATmega328PB-AU.

pylon:
I never used a 328pb myself, I have a lot of 328p in use here though.

According to the datasheet at least the pinout should be similar enough to probably work.

Your circuit is not complete but as you don't use the ADC it should work for the ATmega328 part except for the ICSP which is connected to the wrong port I guess. I would use the hardware serial interface (PD0/PD1) to communicate with the SIM808 but that's up to you. Also I don't see the voltage of the Vcc pin. 5V would be necessary for the ATmega328 but that's over-voltage for the SIM808, so I think you have to fix here something.
If CN1 is a battery connector, you would power the ATmega directly from the battery. That won't work at 16MHz and is not recommended. You should provide a regulated voltage to the ATmega.

The VCC pin is 3.7 volts (4.2 when charged). It comes from a LiPoly battery. The SIM808 has an input range of 3.4-4.4vdc as shown in the SIM808 datasheet. Would 8MHz work better?

pylon:
I never used a 328pb myself, I have a lot of 328p in use here though.

According to the datasheet at least the pinout should be similar enough to probably work.

Your circuit is not complete but as you don't use the ADC it should work for the ATmega328 part except for the ICSP which is connected to the wrong port I guess. I would use the hardware serial interface (PD0/PD1) to communicate with the SIM808 but that's up to you. Also I don't see the voltage of the Vcc pin. 5V would be necessary for the ATmega328 but that's over-voltage for the SIM808, so I think you have to fix here something.
If CN1 is a battery connector, you would power the ATmega directly from the battery. That won't work at 16MHz and is not recommended. You should provide a regulated voltage to the ATmega.

My question is why do I need an ADC. This is a legit question...I have no idea why I would need one. Enlighten me lol.

The VCC pin is 3.7 volts (4.2 when charged). It comes from a LiPoly battery. The SIM808 has an input range of 3.4-4.4vdc as shown in the SIM808 datasheet. Would 8MHz work better?

Yes.

My question is why do I need an ADC. This is a legit question...I have no idea why I would need one. Enlighten me lol.

I don't said you need one. You didn't told use what your system should do, so I won't tell you what you need or what you don't need.

Josephm3502:
I am using the ATmega328PB-AU.

Just going to reiterate... It's not the same chip as the ATmega328P. You might not be able to program it using the Arduino IDE. It might work, but it might be a lot of headaches too. I don't know; I have never used the PB version.

No hard feelings, but just be aware that if you don't have the skills to ensure the schematic is correct, you probably don't have the skills to troubleshoot why the chip isn't behaving as you expect.

John_S:
Just going to reiterate... It's not the same chip as the ATmega328P. You might not be able to program it using the Arduino IDE.

You have to install MiniCore, then can program it with the Arduino IDE over SPI or (after installing the bootloader) either Serial interface.

pylon:
You should provide a regulated voltage to the ATmega.

Battery voltage is regulated enough - minimum 3.2V means you should bring down the frequency to no more than about 12 MHz. As that frequency is not supported by MiniCore (it supports only a small number of frequencies) use 8 MHz instead. If you use the internal oscillator you can even use the crystal pins as extra I/O pins.