Skip to content

Support for Nano modules based on ATMEGA328PB #15

@Kris-Sekula

Description

@Kris-Sekula

I recently bought a batch of Nano modules based on the newer ATMEGA328PB microcontroller without even realizing it. Although the microcontroller is practically backward compatible with the ATMEGA328P, I experienced issues when using the EPROM Emulator with those modules, for example, the upload of the binary image was failing randomly, this would look like a successful upload is happening, the red LED would be lit up for a short moment and then would go off. When monitoring with a logic analyzer I was seeing that the microcontroller gets reset at the end of the upload when the python script disconnects. This was "unexplained". As per this repo: https://github.com/watterott/ATmega328PB-Testing the reset level for the PB version is: 1.6V @ Vcc=5 and 2.1V @ Vcc=5V for the P version... this leads me to believe that the reset control is the problem. To confirm I removed the 100nF capacitor between the DTR line on the CH340 and the ATMEGA328PB Reset line. This fixed the issue. See the picture of the modified board:

Nano_328PB

Not sure how to deal with this further, my workaround for the batch of Nano modules will be to remove the 100nF capacitor and ask users to press the "reset" button during firmware upload (not a big deal as this is not often required).

Removing the 100nF capacitor also means that when the python program connects to the emulator it doesn't automatically reset the emulator - this is a good thing, but this also exposed a small bug in the original firmware where the address bus was not fully set before data was re-uploaded via the serial connection. This bug is now fixed and updated firmware has been added to the repository.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions