SparkFun Forums 

Where electronics enthusiasts find answers.

Questions relating to designing PCBs
By steve1515
#146533
Hello everyone.

I'm making my first electronics project that will (hopefully) end up as a PCB. It's a Serial to Ethernet Gateway that uses an Atmega328p (Arduino) and a WizNet WIZ811MJ (W5100) Ethernet board. I was hoping to get some review and critique of my circuit before I go and buy parts.

Here is some info on it...
I expect about 12VDC as input with regulators providing 5V and 3.3V on the board. The Atmega will have a dip switch for config settings and LED's for status. There is also a MAX232 for RS-232 level conversion.

I believe that I have everything wired and selected correctly, but since this is my first try at producing a PCB, I'd like a review.

I'm a little concerned that I might have selected the wrong cap values or types, so please let me know.

Also, for the WIZ811MJ board, there are 3 4.7k resistors pulling up unused inputs. Could I take the three unused inputs, tie them together, and then connect them to a single 10k resistor and then to 3.3V? Would that also work?

Finally, I wasn't sure, but do I need to add some kind of cap from the Atmega chip's reset pin to ground? I believe that this might be unneeded, but I wasn't sure.

Thanks for any help! :D

Current Image Link: http://img443.imageshack.us/img443/1845 ... ateway.png

Old Image Link 1: http://img835.imageshack.us/img835/1845 ... ateway.png

Old Image Link 2: http://img210.imageshack.us/img210/1845 ... ateway.png

Original Image Link: http://img254.imageshack.us/img254/1845 ... ateway.png

Image
Last edited by steve1515 on Sat Jul 14, 2012 10:39 pm, edited 3 times in total.
By rrpilot
#146572
Hopefully someone else is willing to do a thorough review for you but I just noticed one red-flag. The serial interface between U5 and U3 are using different supply voltages, can U5 handle 5V inputs? You may need to do some level shifting there.
By AndyC_772
#146573
<dumb question>

Why do you need +5V? There are plenty of RS232 level shifters that work directly off 3.3V (eg. MAX3232), and the microcontroller will work at 3.3V too. Could you not save yourself a voltage regulator?

</dumb question>
By TCWORLD
#146577
If this is what you are using:
http://www.sparkfun.com/products/9473

Then according to that page it: "Operates 3.3V with 5V I/O signal tolerance", so you wouldn't need to level shift the serial signals.

One thing I would suggest is that instead of tieing the data pins to ground for the ethernet module, tie them to ground through a 10k resistor (or similar size, 1k to 47k would be fine). That way, should the IC end up switching to read mode and make the data pins outputs, it wont short out the drivers if it tries to output a logic 1.

Are you planning on using the Arduino Bootloader? If so, then how will you be programming it (Through the RS232 chip, or JP2)? If you are planning to use JP2, then you will need 1k resistors between the MAX232 R1Out and the Arduino RX pin (with JP2 connecting directly to the Arduino Rx pin), otherwise, the MAX232 will drive the pin high and you wont be able to communicate with JP2.
By lyndon
#146581
Watch the caps on U1. I don't know that regulator, but on a 7805, that's a potential problem, because disconnecting the power supply can cause the regulator to become reverse biased (the cap on the output may hold charge longer than the little one on the input) and blow the chip.
By AndyC_772
#146582
100n on the input and 10u on the output is exactly the manufacturer's application circuit for that device.
By Joeisi
#146589
I know this may not be necessary, but I always like putting a small capacitor on Reset to make sure the device doesn't randomly reset in case of noise.
By steve1515
#146594
Thanks for all the suggestions. I've updated the schematic. Please check it out here: http://img210.imageshack.us/img210/1845 ... ateway.png

@AndyC_772: Good point with the 3.3V. I checked on it and you are right that the Atmega works on 3.3V. But, at 3.3V it only works to 10MHz. I'd like to keep it 16MHz to be arduino compatable.

@TCWORLD: Great catch on the RX & TX resistors (You only mentioned the RX pin, but I assume you meant the TX also). I've made the changes you mentioned as well as connected the active low inputs though a single 10k resistor. One question though... Will I have a similar type problem with the ISP header since it's also used with the WIZ chip? Do I need 1k resistors there so that programming with JP3 works? If I don't need them, why not? What makes this different than the RS-232?

@Joeisi: I looked into the design guide and the chip has a built in low pass filter. It states that the external cap would be extra, so I've left it off. Just for reference though. If I did ad it, would it be something like a 0.1uF ceramic cap?

If you guys think it looks good, I'll order some parts. :)
By rrpilot
#146600
lyndon has a good point about the regulator output backfeeding into the regulator on power-down. A diode connected from output (anode) to input (cathode) also solves the issue. I usually use a schottky for this purpose since it will conduct before any base-emitter junctions, protecting the regulator. This is actually recommended in a lot of linear regulator datasheets.
By TCWORLD
#146609
I wouldn't have though you would need a diode, there are enough components in the circuit which would discharge the capacitors. If you have a look at Figure9 in the datasheet, the top regulator would conduct in reverse when the power was off, so make of that what you will.

As for the SPI, that wont need resistors. The WIZ chip is a slave device, so all of its SPI pins are inputs except the MISO pin, which will be at High Z unless it recieves a command which tells it to output something. If you are worried about that, a weak pullup on the /SCS pin will insure it is at High Z when the arduino is off or being programmed.
By rrpilot
#146614
steve1515 wrote:I didn't put diodes because I didn't see anything about it in the datasheet for the LD1117.
http://www.st.com/internet/com/TECHNICA ... 000544.pdf

What diode should I use? Should I put one on each regulator?
I would and do for every linear regulator I plop down. For 18 cents, its some cheap protection. Try the BAT54, just about every diode manufacturer makes one.
By steve1515
#146617
Since I'll probably get an S2A diode already, could I get 2 more and use those in place of the BAT54's for the regulators? I'm not to familiar on the different types of diodes. (i.e. schottky).
By rrpilot
#146618
steve1515 wrote:Since I'll probably get an S2A diode already, could I get 2 more and use those in place of the BAT54's for the regulators? I'm not to familiar on the different types of diodes. (i.e. schottky).
The S2A is a silicon diode which means it will have a forward voltage similar to the base-emitter junction which may be found in the regulator. Since you're trying to protect that device it would be beneficial to use a diode with a lower forward voltage so that it conducts first. A schottky type diode such as the BAT54 will conduct at a few hundred millivolts (this highly depends on forward current, see the datasheet curves). Its your design so its your choice, I'm just giving you some information.