I am tearing my hair out, as I cannot figure out what is going on here.
I designed a circuit for a project and decided to test it on a breadboard prior to getting a custom PCB made.
After assembling the components on the breadboard I was unable to upload a sketch, either by using a FTDI USB device or using a Arduino Uno with the ATMEGA328 removed.
To eliminate the possibility that this was due to my circuit, I built a very basic circuit on the breadboard, but the end result was the same.
The basic circuit consists of the following:
- Pins 9 and 10 connected to 16M crystal with 2 x 22nF ceramic capacitors connected to ground
- Pin 1 connected to 10K resistor then to +5V
- Pin 1 connected to NO switch and then to ground
- Pins 7, 20 and 21 connected to +5V (tested with and without VREF connection)
- Pins 8 and 22 connected to ground
- 10uF capacitor connected between pins 20 and 22
- External +5V regulated power supply
After many failed attempts to upload a sketch to the above setup I decided to take another approach...
I loaded the blink example onto a working Arduino Uno, after modified the timing to have the LED turn on and off every 100 microseconds.
That works exactly as you would expect.
I then removed the ATMEGA328P-PU chip and placed onto the breadboard setup described above.
The LED does blink, but it would appear to do so about 500 times slower than it should, that being once every 5 seconds.
(5 seconds on, 5 seconds off)
I have reflashed the bootloader (more than once), but that made no difference.
What I cannot understand is why the blink sketch works perfectly when the chip is in the Arduino Uno, but when located on the breadboard it does not.
Nothing that I have found on the internet suggests that a different fuse configuration is required to build a custom setup.
So, my question...
What the hell is going on here and how do I fix this problem?
I have very limited electronics knowledge, so please respond accordingly.