I'm using ATMEGA328P soldered on a protoboard. ATMEGA328P have some outputs that are connected to a RGB LED. The code take as inputs RGB led state from Raspberry and pass these inputs as outputs on the LED. The code is working fine on Arduino UNO board and the inputs are ok, but I think that there is something wrong with the board because there are flashing color glints and the colors are not stable. I understand is a hard question because there are a lot of factors, but I don't have any idea why this is happening. Maybe crystal and capacitors are wrong soldering? Is the circuit been affected for external noise? I attach some board photos.
Asked
Active
Viewed 86 times
0
-
1Is there a capacitor across the power rails right next to the chip? It needs one of perhaps 1 to 10 microfarads. – Andrew Morton Sep 08 '21 at 11:27
-
No, I'm using a 16 MHZ crystal and 2 18 pF capacitors. A capacitor on power rails can solve the problem? – Juanma Sep 08 '21 at 12:22
-
1[What is a decoupling capacitor and how do I know if I need one?](https://electronics.stackexchange.com/q/2272/36731) – Andrew Morton Sep 08 '21 at 12:28
-
1So the AVR reads GPIO pins from Rpi and outputs same data on another set of GPIO pins? Does the AVR use 5V supply or 3.3V supply? – Justme Sep 08 '21 at 12:43
-
1Is there a short on the 3rd wire below (last picture) ? – Antonio51 Sep 08 '21 at 13:02
-
2Maybe show the schematic you used to build this board based on instead. – Lundin Sep 08 '21 at 14:32
-
Thank you so much for all the comments, the problem came from Raspberry outputs (I don't understand why). I changed the output pins and it works fine. – Juanma Sep 09 '21 at 08:58
1 Answers
0
Thank you so much for all the comments, the problem came from Raspberry outputs (I don't understand why). I changed the output pins and it works fine.

Juanma
- 360
- 1
- 16
-
Its always good to have an oscilloscope on your bench. You can measure all the relevant pins whenever you feel something has gone wrong. – abunickabhi Sep 09 '21 at 09:28
-
1Yes you are right, anyway I was reading the Raspberry outputs on ATMEGA328P and they were different between them. – Juanma Sep 09 '21 at 09:54
-
1Okay got it. Scope is a really handy instrument. Can make us unstuck from various debugging situations quickly. – abunickabhi Sep 09 '21 at 10:34