Pages: [1]   Go Down
Author Topic: Problem moving projects from Arduino Uno to Atmega328p on a breadboard  (Read 321 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have tried to program an Atmega328p on a breadboard using the Arduino IDE and that worked fine.
But I encountered a problem when I tried to replace the Arduino Uno with an Arduino on a breadboard for some finished Arduino Uno projects.
The arduino starts to work for about half a second and then resets. This makes the whole setup flicker because I see the first part of the setup process repeating.
This happened with two entirely different projects so I suspect that I'm generally doing something wrong.

On the breadboard, I have the ATmega328p connected to a 16Mhz crystal, two capacitors, the Vcc/Vref and GND are connected on both sides (to the corresponding one) and RESET is connected to 5V.

Thanks in advance,
Marian
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you put decoupling caps (100 nF) next to the MCU as well as some bigger (10 uF) caps on the power rail? sounds like you might be browning out. Are there any heavy loads being driven from the same rail that's powering your MCU?
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a 10uF capacitor between 5V and GND and two 22pF between GND and the crystal pins.
Where do the decoupling caps go?
And yes, the 5V power rails powers the entire project with 64 LEDs, up to 16 are on at a time.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Similar things happened to me. Turned out it was power issue. If all wires are secured and components placed well on the breadboard, try switching to a more reliable power supply.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Where do the decoupling caps go?
100nF, as close to all power pins as possible.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Jr. Member
**
Karma: 1
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay I added three 100nF capacitors between 5V and GND right next the Atmega and I replaced the 1A wallwart with a 2A wallwart. The circuit now seems to survive slightly longer but resets after about a second.

Do I also have to decouple two 74HC595 bitshifters?
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 207
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, you should have decoupling caps next to every chip. Try measuring the voltage of the wallwart and of the 5 volt rail while the program is running, if either voltage drops a lot when the LEDs turn on then you know you have power problems.
Logged

Pages: [1]   Go Up
Jump to: