SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By gonzodada
#117099
Hi

I've built a homebrew Arduino and all seemed well at first. Blink ran. I can wire it to an LCD and write to it using the SoftwareSerial library. I can plug my homebrew 4 x 4 button pad/RGB LED matrix board into it and it works. I can plug my homebrew MIDI board into it and it can send MIDI messages using the Arduino MIDI library and ... error! It won't receive MIDI in. Or rather after much investigation it won't reliably detect any serial data incoming on the RX pin. It's not my homebrew MIDI board as that works fine plugged into my Duemilanove. It's not the sketch I'm running either, for the same reason. So continuity/short circuit on my homebrew Arduino surely? Well I can't find one. To be sure I built a breadboard Arduino. That has the same problem!

I'm very confused because as far as I can tell on any Arduino schematic (original or clone) the RX pin just goes directly to the relevant leg on the ATMEL368P (PD0/PD1, whichever it is, I'm not near my notes, don't worry I've double checked this!)

What could possibly be causing RX to misbehave on a homebrew Arduino compared to a Duemilanove?

Here is my board layout (ignore the MIDI stuff top right it's isolated from the Arduino bit)

Image

And a link to the schematic

http://web.mac.com/hardcoded/schematic.png
User avatar
By leon_heller
#117101
Your PCB layout is rather poor, and you don't seem to have any decoupling capacitors for the AVR. Always route critical tracks like supplies and grounds, and decoupling capacitors, first, with wide tracks. Each Vdd-Vss pin pair should be decoupled close to the pins.
By gonzodada
#117105
leon_heller wrote:Your PCB layout is rather poor, and you don't seem to have any decoupling capacitors for the AVR. Always route critical tracks like supplies and grounds, and decoupling capacitors, first, with wide tracks. Each Vdd-Vss pin pair should be decoupled close to the pins.
Yes very much a noob when it comes to board layout (draw schematic hit autoroute on Eagle is about as far as I've got!). The power supply has two 10uF electrolytic caps for decoupling. Where should they be for the AVR? The crystal has two 22pF caps but perhaps these aren't for decoupling?

>Each Vdd-Vss pin pair

Could you explain what this is? I've Googled. So Vdd is what I know as Vcc or just +V supply and Vss is -V or GND? Why "pairs" tho? Why isn't there just a single +V and GND in an Arduino circuit? So should I have caps from each +V supply on the AVR to ground? Values?

Lots of questions there! Maybe the most important thing for me to understand at this point is to know that the board layout could effect the performance of RX/TX? Can you confirm this?

I think what I'm going to do is try a more true and tested design such as the single-sided RBBB

http://www.instructables.com/id/Single- ... ino-in-EA/

and see what happens. Thanks for your reply.
User avatar
By leon_heller
#117106
IIRC, the AVR used on the Arduino has several Vdd and Vss pins, as well as AVdd. Each supply pin must be decoupled.

Inadequate decoupling can cause serious problems.

The Eagle autorouter is useless!
User avatar
By liudr
#117546
No, if you read through the arduino forum post, the pin 0 is the arduino pin 0 not ATMega 328 pin 0. As explained on the original post, it's because the sender has open collector so the wire needs to be pulled to 5V.