Custom Arduino board - schematic review - Page 1
Forum section: electronics / beginners

author: CodeBreaker
author_rank: Newbie
timestamp: February 13, 2018, 01:11:29 pm
content: I'm working on a custom board what would include the following components.Arduino programmable ATMega328P 32-pin TQFP (using arduino as a ISP)FT232RL for USB to serial for communication as well as programmingMAX485 for RS485 communication using arduino software serialLM2940 Voltage regulator (Constant 6V DC in)I need a second set of eyes to see whether I've made any glaring mistakes. I also have a few questions:Can I power the MFRC552 with the FT232 3v3 output? The specs say that the FT232 can give up tp 50mA and the MFRC552 should use less.Can MFRC522 and ISP header be wired like that? Will the MFRC552 interfere with the burning of the bootloader of the ATMega328?I can leave the USB VCC floating like that?Thank you in advance!

author: cowasaki
author_rank: Frequent Contributor
timestamp: February 13, 2018, 08:34:53 pm
content: There are a few things missing from your schematic if you look at the reference circuit.Attached is my last circuit using a 1284P rather than a 328P but they are basically the same although the 1284P has more IO and memory.Note the 47pF caps on the data lines, the 100nF cap on the reset line from the program port and the decoupling caps generally.You might want to add the transfer IO LEDs too as they can be very useful, on my board the power LEDs and the transfer LEDs are attached to option switches (you could just use links)

author: llkiwi2006
author_rank: Regular Contributor
timestamp: February 13, 2018, 09:21:16 pm
content: Your crystal loading cap values are way too high (100nF!). They are usually in the tens of pF range. Check here for how to calculate a value for your crystal:https://blog.adafruit.com/2012/01/24/choosing-the-right-crystal-and-caps-for-your-design/You also need more decoupling caps, usually a small one (~100nF) for each power pin, and a bulk (~1uF-10uF) cap for each chip. The 3V3OUT on the FT232R also needs to be decoupled. Check the reference design for each chip for the recommended decoupling configuration.The reset pin on the FT232R is internally pulled up. You can either leave it unconnected or use a resistor to pull up to vcc. Shorting it to vcc could interfere with the chip's internal reset generation.The reset pin on the atmega could tolerate up to 13V, do you need D1? You need a series resistor anyway if you want to use D1 for clamping, like this:@cowasaki you don't need the 47pF decoupling caps on the usb data lines

author: cowasaki
author_rank: Frequent Contributor
timestamp: February 13, 2018, 09:34:49 pm
content: Quote from: llkiwi2006 on February 13, 2018, 09:21:16 pmYes I've seen numerous circuits without them but I included them from the reference design then as the circuit worked faultlessly I have kept them in (I've seen discussions where people have had problems on some machines when not having them - I had them from the start so can't really comment). For the price of them though I thought it best to stay with the reference (unless of course they've changed the reference design over the years and they have dropped them)I agree re the crystal and find 22pF works best for them.

author: llkiwi2006
author_rank: Regular Contributor
timestamp: February 13, 2018, 10:04:53 pm
content: Quote from: cowasaki on February 13, 2018, 09:34:49 pmSeems like the capacitors are there for EMI reasons. FromFTDI AN_146:Quote

author: cowasaki
author_rank: Frequent Contributor
timestamp: February 13, 2018, 10:20:33 pm
content: Quote from: llkiwi2006 on February 13, 2018, 10:04:53 pmWhether they are NEEDED or not is clearly debatable but my circuit above is straight from a working design which I am using on all my home made boards and ones we had made for products. A couple of 47pF caps costs about 1p so if they have any advantage at all they might as well be left in. I'm not pretending to be an expert on what they do or why because most of the people on here probably know more than me but I took the reference design and modified it to suit. I would absolutely agree about the crystal caps being too high and I always use 22pF caps with any of the Arduino ICs. There are alternatives to the FT232RL but it is a really good solution. It's worth buying them in 10s from China where I think I paid about £6 inc postage!

author: Monkeh
author_rank: Super Contributor
timestamp: February 14, 2018, 06:18:34 am
content: Quote from: cowasaki on February 13, 2018, 10:20:33 pmWith a very high chance of getting fakes or rejects! Totally worth it.

author: cowasaki
author_rank: Frequent Contributor
timestamp: February 14, 2018, 06:49:18 am
content: Quote from: Monkeh on February 14, 2018, 06:18:34 amWhen you find a good supplier and everything you buy from them arrives on time and works!

author: CodeBreaker
author_rank: Newbie
timestamp: February 14, 2018, 12:46:08 pm
content: Thank you all for the recommendations!@cowasaki I see that you've connected USB 5V to VCC which means that you're powering the board form usb? Since I'm not powering the board from USB I can leave it floating?Furthermore, will it be a problem for the voltage regulator when I'm powering the board trough Arduino as an ISP for burning bootloader?I've updated the schematics and attached it bellow.

author: cowasaki
author_rank: Frequent Contributor
timestamp: February 14, 2018, 01:01:30 pm
content: Quote from: CodeBreaker on February 14, 2018, 12:46:08 pmHow much current does your board use? If it is under USB spec I would just attach usb 5v to vcc anyway. I’ve never had an issue with a voltage veg “seeing the same voltage” from the usb and it give you the option of powering your board via usb anyway. I’m not sure floating is a good idea but at least the ground is tied.

author: CodeBreaker
author_rank: Newbie
timestamp: February 14, 2018, 01:52:18 pm
content: By my calculations it should use around 200 mA when reading and transmitting, so its bellow USB spec. Thanks!

author: tszaboo
author_rank: Super Contributor
timestamp: February 14, 2018, 02:00:51 pm
content: What the hell are you hacking with that 555 timer for the RS485? You have free pins on the microcontroller, just connect D+R to them.

author: phil from seattle
author_rank: Super Contributor
timestamp: February 14, 2018, 08:10:00 pm
content: Quote from: Monkeh on February 14, 2018, 06:18:34 amPer several other threads, the SiLabs CP2102N is a good, cost effective solution from a reputable company. I've started using it, seems pretty good. Some might be put off by the QFN package though it does provide a very small footprint USB circuit.

author: anishkgt
author_rank: Frequent Contributor
timestamp: February 23, 2018, 09:34:07 am
content: The CP2102N is a very good cost effective solution for USB-UART interface. Ive just used it in my PCB.

author: paulca
author_rank: Super Contributor
timestamp: February 23, 2018, 09:57:39 am
content: I had issues with Software Serial and the MAX485. I was however using an ESP8266. Just something to keep in mind. The MAX485 is very picky about it's serial.