USB<->UART Interface

Discussion in 'The Projects Forum' started by Rosbife, Jan 18, 2013.

  1. Rosbife

    Thread Starter New Member

    Jan 17, 2013
    Hello everyone, I'm working on a USB<->UART converter based off FTDI's FT230X(S) IC and would like a bit of input. Right now it is almost done (the schematic, that is), and I attached a picture of it.

    I must also say I knew, and still kind of know, next to zero about electronics and electricity in general when I took this project. (sorry for the length in advance, couldn't really keep it both short and complete at the same time)

    I'll be using a micro-USB port, so 5 "input" signals (with a header in parallel, which was asked of me, not entirely sure why). Everything is SMT. Here's what's what:

    -UART "Output" is connected to a second header with data flow, ground and 3v3/5v;
    -I also included output reading of CTS/RTS for hardware handshaking;
    -I include three LEDs, two for data transmission/reception detection (TXLED/RXLED pulse low when data is transmitted/received), and one for power detection;
    -I include a set of pull-ups to set the default logic levels;
    -I include a 0-value resistor to act as a fuse for the USB shielding. This was a hint from a friend of mine who happens to work in this area.

    Now for my doubts. As I said, I'm not very electronics-savvy, so kind of bear with me:

    -First off, does anything jump out as blatantly wrong in the schematic?
    -Second, is the bottom LED well designed? It should shine to indicate the board is connected and powered;
    -Third, how exactly do I go about the fuse resistor in terms of PCB layout? Is it just a regular 0 Ohms resistor? My question is how exactly do I know what to use for this particular matter.This was a hint from a friend of mine who happens to work in this area. How exactly do I go about this in terms of PCB? Is it just a regular 0 Ohms resistor? My question is how exactly do I know what to use for this particular matter.
    -Fourth, is it a good asset to have both 3V3 and 5V on the UART-side header? I did this so that, when connecting to that header, you'd have the chance of working in different voltages. Is it worth it, or should I just leave one of them there? Which, in that case? (I'm guessing it depends on what I'm using the board for)
    -Fifth, the schematic off of which I based mine the most (an official one by FTDI) had a "ferrite bead" between the USB's 5V output and what I label as VCC. Hence the two VCC-Cap-GND structures you see on my schematic (on the FTDI schematic, one was between the USB plug and the bead, and the other one, labelled VCC, after the bead and into the IC). Thing is, as far as I know, these beads don't go into a PCB - they refer to beads in the cables, in this case the USB one. As such, should I erase one of the VCC-Cap-GND structures? If so, which? I'm trying to understand how capacitors smooth the current to the point of figuring this one out by myself, but still no luck.
    -The TXLED/RXLED are configured by default to pulse low when there is data transmission/reception. Just how do those LEDs glow in those circumstances? I know the schematic is right in that aspect since it was the same in the FTDI one.

    Thanks for the help in advance, I'm having a hard time conciliating this project with my exams right now.

    Link to the IC I'm using:
    • Pic1.PNG
      File size:
      117.9 KB
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    -First off, does anything jump out as blatantly wrong in the schematic?
    Nothing, though FTDI suggests 27 ohm resistors in the +D and -D lines.

    Also, RS232 does not run at 5V and needs some sort of converter to get to the proper levels. Talking short distances (foot or so max) to another logic chip doesn't require a converter. Talking to a PC does.

    -Second, is the bottom LED well designed?

    -Third, how exactly do I go about the fuse resistor in terms of PCB layout?
    Get your "friend" in a headlock or full nelson, exert pressure, and do not relent until his "hint" becomes a full expplanation! Or, you can get SMD fuses the size of resistors. Also, there exist nice "poly fuses" that act like zero ohm resistors until overload, then they open... cool down, then close again. Nice!

    That said, any fault in the shield is also on ground. I don't share friends with you and have never seen a fuse in this area.

    -Fourth, is it a good asset to have both 3V3 and 5V on the UART-side header?
    Yep, it depends. But you can make 3.3 out of 5 with a simple regulator anywhere, and I would prefer to make it local to where I use it.

    -Fifth, the "ferrite bead"
    Beads are means to slip around loose wires to make a small inductor. You can buy SMD inductors that go right on the board. It's good practice, not essential to have one. If you leave it out do keep the caps.

    Note: if you want to have it both ways on a PCB you can leave out parts but make the connection with zero ohm resistors.

    -SIXTH, how do those LEDs glow in those circumstances?
    Programatically. You tell the FTDI chip to bring CBUS0 low and that provides a path for D2 to turn on. Same for CBUS1 and D1.

    Good luck with your project and welcome to the forums!
    Rosbife likes this.
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    I see something that may be a problem. The 3v3out pin is not made to drive more than 50mA current. And with 3 20mA diodes on. You will have 60 mA. only for the LEDs. Consider using 2mA or 10mA LEDs. If the extra cost do not matter. Or put the ON LED on the USB 5 volt rail. If you need a TTL to RS232 level converter. That should also be powered from the USB 5 volt rail
    The bead you mentioned is there to prevent input noise. Hence it need to be on the board. It is not critical. Make room for it on the PCB. But use a jumper if it is not needed.
    Before you make the board. Be sure you are 100% sure about which package the different components uses. That can save you for a lot of trouble later. Also post your board here for comments before it is produced.
    Rosbife likes this.
  4. John P

    AAC Fanatic!

    Oct 14, 2008
    If you don't know how to do this with confidence, I think it would be much safer (in terms of time and money expended, plus aggravation) to buy a USB to UART converter--they're easy enough to get. Even if you do know how to do it, having circuit boards made in small quantities isn't very economical. I don't know if you have a Portuguese equivalent, but in English we would say "You're trying to re-invent the wheel."

    Sample item picked at random:
  5. Rosbife

    Thread Starter New Member

    Jan 17, 2013
    First of all, sorry for the mess on the 3rd question :p

    The point of the project, apart from actually contributing to a much larger one with the PCB itself, is to have me learn the ropes of electronics so that I can help develop more complicated stuff :p

    Wow, you're right, thanks a lot. I'll be using lower power LEDs then. However, is it viable to power all of them, instead of only the "ON" one, from the USB bus directly? I won't be needing conversion to RS232 levels.
    I'm not exactly sure what you mean about the bead, but I guess leaving an open in the track for placing the bead and connecting the two ends of the open with a jumper in case I don't use it after all?
    Also, what kind of on-board bead are you talking about? Is it something like this:
    I'll be sure to post here before producing ^^

    Thanks for pointing those 27ohms out.
    "I have never seen a fuse in this area", you mean connecting to a connector shielding? From what I looked up, it seemed common. Confused. I did know about the poly ones, and they sound super interesting. I just don't know about prices xD
    About voltage regulation. Hmm, I see. I'll leave it there and remove it in the end in case they tell me it's not needed. Can't hurt right?
    Regarding beads and "having it both ways". You mean I can simply open a track with a couple pads for, say, a bead, but then if I don't want to include the bead after all, just fill it with a 0ohm resistor right? That sounds quite ideal.
    Lastly, I understand it being programatically (in fact, the buses I used are by default configured as active-low-TXLED/RXLED), I'm just not sure how pulsing a low signal "provides a path for the diode to turn on". Maybe I just don't know enough about diodes yet.


    Thank you guys so much for the help so far ^^!
  6. vortmax


    Oct 10, 2012
    Nothing to add schematic-wise, but USB is tricky to route on the PCB. There are a bunch of design rules you need to follow to maintain proper speed. If you don't plan on going over low speed serial, it is probably not a big deal, but if you are learning board layout, I think it is something worth looking into...even if it is just for the practice of reading data sheets and app notes.

    give this a read:

    The big ones are keeping the traces equal length, parallel and straight with ground plane shielding on the opposite side.
    Rosbife likes this.
  7. Rosbife

    Thread Starter New Member

    Jan 17, 2013
    Vortmax, thanks for the (damn extensive :p) read. I'll try to follow it as much as my exam schedule allows me to. And thanks for the last tip.


    As for the rest, I should begin the PCB layout soon. My last doubts are still concerning shielding and the resistor I currently have in the ground-resistor-shield path. I've attached an updated version of the schematic, where the major changes are the re-inclusion of the ferrite bead (on which I'm sorted), the two 27Ohm resistors in series with D+/-, the changing of the resistance value of the LED series resistors to 1k (hopefully not too dim? Still not positive on which LEDs I should get for this) and re-organization in general.

    Any input is greatly appreciated, as always.