0

I've been trying to follow the official Arduino instructions on how to program and power an external breadboard, and I've gotten a pack of ATmega328p's that may or may not have been preloaded with the bootloader (found here). From the title, I assumed that they were, in fact, preloaded, but I followed the instructions to "reload it" from a working Arduino (with its original microcontroller), and I did it with the following circuit setup (this is the best image that I have of it, unfortunately, I promise I've checked that the wiring actually is equivalent to the original diagram, just shifted around for convenience on the breadboard):

enter image description here

I'm not sure whether I should've kept the original microcontroller in, as the guide ambiguously shows a void in the area where the controller should be in the provided diagram...

enter image description here

...but my thinking was that the Arduino basically isn't anything without its attached microcontroller, so attempting to "send" bootloader code to a separate microcontroller would require a plugged in microcontroller, and that was the only way I got it to work.

With all this set up, I tried to test using this new microcontroller, and it worked perfectly when mounted in the provided microcontroller area. However, when I tried to follow this up with the steps detailed in the guide, found here, with the following circuit (slightly better angle):

enter image description here

...I was faced with errors of being unable to connect.

enter image description here

From what I understand, it seems like the Arduino should automatically detect that no microcontroller is plugged in, hence allowing the stated "FTDI chip can talk to the microcontroller on the breadboard instead" from the guide. However, the error I'm getting seems to be the same as the error I got when I just plainly tried to send code or program without any microcontroller connected, so I'm assuming this implies that it can't find any microcontroller, either internal or standalone.

From googling this error, it seems that others have had this problem with seemingly no solution, and I have absolutely no idea how I could fix this. If there's something I'm missing, would greatly appreciate the help.

side note, when I was idly testing out the program with a tiny test circuit that lights up an LED, after programming it with a program that turns on a GPIO pin, connecting that pin to the LED, it did in fact light up. I'm concluding this means that the setup of the actual microcontroller is functional, but it's unable to be written to. this has also happened with the original microcontroller that I tried to simply program externally.

any help is appreciated, thanks for reading!

10
  • If you have been able to put the new MCU chip into your Uno and it works, say you can upload a sketch, then it has a bootloader. Clearly, a chip must be present in the Uno when the Uno is used to burn a bootloader onto another chip because the Uno must run the ISP sketch. For the second part, that is loading a sketch onto the chip on the breadboard, check your wiring carefully between TX, RX and Reset on the Uno and the breadboard. It does look wrong but that could be the picture quality. For this part it is correct that the Uno has no MCU chip.
    – 6v6gt
    Oct 28, 2022 at 3:13
  • 1
    Simply to eliminate variables, I would not put the crystal away from the chip that way. You can angle that crystal at roughly 45 degrees, connecting the crystal directly to the same breadboard tie points that the MCU's crystal related pins go to. Your load caps can then connect those same exact tie point to the nearby ground bus. In the end, you have jumpers involved in the purely crystal-related part of the circuit. Less crap to go wrong. Or worse, go wrong intermittently while you're troubleshooting.
    – timemage
    Oct 28, 2022 at 3:48
  • Can you please see my page about detecting chip signatures. Using your Uno and 6 wires (MOSI, MISO, SCK, SS, 5V, Gnd) you can see if it recognises the chip at all, and if so, is there a bootloader on it, and also the fuse settings. Please edit your question with the results of that.
    – Nick Gammon
    Oct 28, 2022 at 5:35
  • Also see my page about breadboard Arduinos which describes something very similar to what you are attempting.
    – Nick Gammon
    Oct 28, 2022 at 5:37
  • apologies for the late responses y'all, getting to this! @6v6gt, I didn't include a Reset as I figured that I didn't need to use the reset (would just rerun the code if I needed a reset). will try to add this in in a bit, I'm fairly certain the TX/RX is right but will try that in a bit
    – Daneolog
    Oct 28, 2022 at 7:30

1 Answer 1

1

In the case of using an Arduino as a USB/UART (FTDI) adapter to upload a sketch onto a barebones Arduino (ATMEGA328P) via its own bootloader, a reset of that MCU chip must preceed the sketch upload. That is because, immediately following the reset, the bootloader watches the serial traffic to see if this is marked as a sketch upload and, if so, processes it. If this reset operation fails, for example through a bad or missing connection, the sketch upload attempt will also fail. A good description of the sketch upload process can be found here: https://www.instructables.com/Overview-the-Arduino-sketch-uploading-process-and-/

1
  • this makes a lot of sense! thanks for explaining the reasoning behind it, was very curious why it couldn't just send a reset signal through the TX/RX, lol
    – Daneolog
    Oct 30, 2022 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.