Problem with atmega 328p-au serial communication

Hello
I’m having issues with atmega 328p-au (arduino nano). I created a custom board using an ADC and the micro controller, flashed a new boot loader and programmed it successfully. Then I tried to upload an sketch which scans for I2C devices to check if my ADC is being recognized. half of the time it managed to find it, but failed the other half. I realized the RESET pin of the ADC is controlled by the arduino and that’s what’s causing the issue, so I added a single line of code to pull that pin high. That’s where all hell broke loose!

After finishing upload, I opened the serial monitor and instead of the messages I was expecting, I was met with a bunch of gibberish … I checked the baud rate and it was correct.I tried re uploading the code but to my surprise, that failed too! I dropped the baudrate from 115200 to 9600 and this time it worked! but the output was still junk! I thought I might have killed the chip so I replaced it, but it’s still the same issue with the new chip as well. I washed the board with 70% alcohol and let it dry, tried checking for shorts, etc but still no luck! does anybody know why my serial communication is broken? how can I troubleshoot this issue?

I attached a picture of the output.

Please post a copy of your board schematic as its likely to be a hardware issue. A photo of the board, top and bottom, would also be a good idea.

I seriously think this is a bug with the arduino software rather than hardware. as you can see the schematic is pretty minimalistic and I have ran DRC for the PCB, as well as manually checking for errors. I had issues burning the bootloader with the IDE 1.8.8 and had to modify the “breadboard” files for the fuses in order for it to not completely crash on me and it still failed! rolling back to 1.0 to burn the bootloader worked fine! (I was using the breadboard 1.6.x files which was the newest build available before rolling back to 1.0)
Then I went back to the 1.8.8 to write my codes … I will check again with the 1.0 to see if the “atmega 328p on the breadboard with internal oscillator” which is the breadboard file might be the issue or it’s something else.

Here is the schematic:


as you can see, it’s mostly passive discrete components which shouldn’t be causing an issue. even then, half of them are for input filtering of the ADC which can’t be causing the issue and the other half are decoupling capacitors.

PCB design is also attached.

top.pdf (31.9 KB)

bottom.pdf (21.6 KB)

I’m suprised you were able to bootloader the new chip as you’re missing the 10k pull-up resistor on the reset line. The processor is probably oscillating between reset and run.

Do not connect Aref (to 5volt).

Maybe better to add external 10k pull up resistors (assuming distance between the I2C divices is short) on the SCL and SDA lines than to rely on the ~30k pull up that the Wire library provides.

Why the external voltage reference. The ADS1219 has the same thing internally.

You will get better/faster help if you post according the forum rules.
Leo..

I followed the description provided by the devs here:

as you can see, there are no extra parts required, not even a resistor! I'm guessing the other arduino which is set as the ISP (another arduino nano in my case!) has pullup resistors built in?

And I can confirm that the issue was indeed the 1.8.8 IDE not working with the 1.6.x breadboard files which are provided ... I'm rolling completely back to 1.0 for now which is painful! you don't even have the library manager! but it works fine and I don't have time to mess around with getting the latest IDE to work ...

Is there somewhere that I can report this issue? also I see there is a new bootloader available for arudino nanos ... where can I find it in order to flash that onto my existing nano boards? I couldn't find a link anywhere. It seems they just changed it last year but I couldn't find any details as to why or how to upgrade to the newer version

Wawa:
Do not connect Aref (to 5volt).

Maybe better to add external 10k pull up resistors (assuming distance between the I2C divices is short) on the SCL and SDA lines than to rely on the ~30k pull up that the Wire library provides.

Why the external voltage reference. The ADS1219 has the same thing internally.

You will get better/faster help if you post according the forum rules.
Leo..

I know the ADS1219 has an integrated 2.048V voltage reference, but it's quite unstable! anything past 16 bit realistically requires an external voltage reference, a decent one at that! the one I used has superb thermal performance 1ppm/c typical and at most +-1mV initial accuracy. they're not cheap either! about 10 bucks a pop but it's well worth the price in my application. I'm not sure which rule I'm violating, sorry in advance!

OM222O:
And I can confirm that the issue was indeed the 1.8.8 IDE not working with the 1.6.x breadboard files which are provided ... I'm rolling completely back to 1.0 for now which is painful! you don't even have the library manager! but it works fine and I don't have time to mess around with getting the latest IDE to work ...

Why, have you gone back to 1.8.5.. back to the ancient 1.0 is a bit dramatic.
Just because the dev guys say one thing, you need to listen to the guys in the field about solutions too.

Did you try the I2C pull up resistors?
Did you tie the reset to 5V with 10K?
Have you disconnected Vref from the 5V supply?

If was in your shoes, and I will be soon with a Nano development, I'm going to make my PCB with headers on it to take a Nano board.
Not as much work and a tried and true controller assembly and its easily replaceable, less than $3 for Nano, no brainer.
Tom... :slight_smile:

TomGeorge:
Why, have you gone back to 1.8.5.. back to the ancient 1.0 is a bit dramatic.
Just because the dev guys say one thing, you need to listen to the guys in the field about solutions too.

Did you try the I2C pull up resistors?
Did you tie the reset to 5V with 10K?
Have you disconnected Vref from the 5V supply?

If was in your shoes, and I will be soon with a Nano development, I'm going to make my PCB with headers on it to take a Nano board.
Not as much work and a tried and true controller assembly and its easily replaceable, less than $3 for Nano, no brainer.
Tom... :slight_smile:

As I mentioned before, going back to 1.0 fixed all the issues. There wasn't an issue with I2C, even the UART output was garbage. I'm guessing the hex file which was created using 1.8.8 is somehow corrupt or won't work with the previous boot loaders? honestly no idea , but they need to fix their breadboard library.

I see where you're coming from and I have about 10 nano boards, but I also buy the atmega328p-au in bulk for my other projects but I previously bought them with boot loader burned on to them and they never acted weird. this time around I went with the cheaper chip (less than 1$) which is great as I'm planning to make a commercial product after these prototypes are finished.

Hi,
Sounds like the 328 has an old bootloader.
Tom... :slight_smile:

TomGeorge:
Hi,
Sounds like the 328 has an old bootloader.
Tom... :slight_smile:

Where can I find the new bootloader? XD It's not on the tutorial page of this website

Hi,
It will be already in the latest IDE.
Under tools.

Tom.. :slight_smile:

Not for the atmega328p on the breadboard!

Hi,
Google ...

Tom... :slight_smile:

Missing some basics for reliable operation of the 328P.
10K pullup on Reset as mentioned above.
0.1uF cap on each VCC and AVCC pin. You have 1 for all 3.
4.7K pullup on I2C lines as mentioned above.
Aref - do not connect to 5V, only have a 0.1uF cap to Gnd. I think also mentioned above.

When will folks learn? This kind of stuff has been brought up over and over and over since 2011.