0
\$\begingroup\$

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.

enter image description here enter image description here enter image description here

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Is there a capacitor across the power rails right next to the chip? It needs one of perhaps 1 to 10 microfarads. \$\endgroup\$ Commented Sep 8, 2021 at 11:27
  • 1
    \$\begingroup\$ What is a decoupling capacitor and how do I know if I need one? \$\endgroup\$ Commented Sep 8, 2021 at 12:28
  • 1
    \$\begingroup\$ So 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? \$\endgroup\$
    – Justme
    Commented Sep 8, 2021 at 12:43
  • 1
    \$\begingroup\$ Is there a short on the 3rd wire below (last picture) ? \$\endgroup\$
    – Antonio51
    Commented Sep 8, 2021 at 13:02
  • 2
    \$\begingroup\$ Maybe show the schematic you used to build this board based on instead. \$\endgroup\$
    – Lundin
    Commented Sep 8, 2021 at 14:32

1 Answer 1

0
\$\begingroup\$

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.

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

Your Answer

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

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