Micro USB to RS232?

Discussion in 'General Electronics Chat' started by Scalpel78, May 13, 2014.

  1. Scalpel78

    Thread Starter Member

    Aug 11, 2013
    49
    0
    Hi, I'm building a pcb with a microcontroller on it that is programmable via RS232.

    I'm trying to construct a circuit to put on the pcb which will allow me to plug in a standard micro USB cable from the computer to a connector on my pcb, and then be able to program the microcontroller.

    I want to avoid a need for any special USB-to-TTL or USB-to-DB9 cables and external breakout boards, and get it working with a standard micro USB cable.

    Currently my idea is to put on a micro USB connector, and connect that to a FT232RL chip. Then, from that chip I'm thinking of connecting to a logic level inverter, like a SN74LVC2G04DBVRhttp://no.farnell.com/texas-instruments/sn74lvc2g04dbvr/ic-inverter-dual-smd-sot-23-6/dp/1287594. And hopefully that will give me RS232 RX/TX.

    For now this is all just theory, so I'm not convinced this will work. What do you guys think?
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    It is very do-able

    My first question is how do you initially program the bootloader into the PIC so it accepts code thru the RS232?

    My next question is are you aware you can directly program a PIC over the USB without any other circuitry? Be aware you're still left with the first question.
     
  3. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    I think that will work. You're simply replicating the USB-serial converter on your board. Do you really need RS-232? Are you sure you can't just connect the digital outputs directly to your UC?

    If you need RS232, the MAX232 chip form Maxium would be the easiest way to go.
     
  4. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    Are you playing some kinds of trick or magic?
    If you can do that, please let me know, thanks.
    I'm trying to using max232 + PL2303 or just using TP2102 - CP2102EK.
    The below are the infos for CP2102 or CP2104-MINIEK.
     
    Last edited: May 13, 2014
  5. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Hi Scott,

    Are you asking me? Or are you asking the OP? I don't really understand your question.
     
  6. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    Hi Brown, I was asking to the OP, because I didn't use the quote function to you, but if you know the answer, you also can answer more detail about how to using max232 chip to do the usb function through the usb plug, thanks.
     
  7. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    I think the OP said he's using the FT232 chip (from FTDI) then connects to a level converter to convert from CMOS output levels to RS232, which I suggested he use the MAX232 chip for.
     
  8. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    But only use MAX232 can't reach that function.

    I just saw the infos about FT232 chip, it's the same with CP1202, using this kind of chip is more convenience.
     
  9. Scalpel78

    Thread Starter Member

    Aug 11, 2013
    49
    0
    Hi, the microcontroller is a Netduino Mini. The bootloader is already on there, but if I want to update it in the future I believe it is done via the same RS-232 connection. The first thread in this forumpost describes how to update the bootloader and firmware.

    I've got a setup for programming the device which works, but I want to simplify it. I'm using a USB-to-RS232 cable, which is connected to a DB9-breakout board. From that board I'm using jumperwires from RS, TX and GND to my Netduino. That works, but I want to be able to just use a standard micro USB cable instead.

    I've had some discussions elsewhere about using the SN74LVC2G04DBVR vs the SN74LVC2G14DBVR chip for inverting the TTL to RS232. I've been recommended the last one, but not really sure what the difference between the two are.

    I'll order the FT232RL and SN74LVC2G14DBVR chip, design a pcb for it, and give that a go.
     
  10. Scalpel78

    Thread Starter Member

    Aug 11, 2013
    49
    0
    Scott, do you mean that the CP2102 and FT232RL chips work in the same way? Or do you mean that the CP2102 is the only chip I need?
     
  11. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    The below are some infos, you can see and try any one or both of them:

    FT232R - USB to RS232 Converter, you can see the page 27.

    CP2102-9 - USB to RS232 Converter.

    CP2104 - USB to RS232 Converter.

    Here are the users talking about the application experience of CP2102 and FTDI chip.

    What's your uC, 8051,Pic?
     
  12. Scalpel78

    Thread Starter Member

    Aug 11, 2013
    49
    0
    I'm using a Netduino Mini.

    Thanks, page 27 for the FT232R was very interresting. That looks exactly like what I want!

    I found the SP213ECA-L at my dealer, so now it looks like I'll go for a FT232RL+SP213ECA-L combo.
     
    Last edited: May 14, 2014
  13. Scalpel78

    Thread Starter Member

    Aug 11, 2013
    49
    0
    Or what about an FT230XS for the USB-to-UART? It has fewer pins, so perhaps easier to work with?
     
  14. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    Yes, it's smaller, I think it's a simple type for USB-to-UART.

    Here are some Utilities from FDTI.

    Netduino Mini.
     
  15. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Nope, none of those is USB to RS232 converter. Those all are USB to UART converters, and you need a chip like MAX232 to convert the UART to RS232 voltage levels.

    OP really needs to decide whether he really needs the RS232 +/-12V levels, or plain 0-5V (3.3V?) logic levels will do.
     
  16. Scalpel78

    Thread Starter Member

    Aug 11, 2013
    49
    0
    The Netduino Mini has an Atmel at91sam7x512 chip. I think plain 0-5V levels is OK.

    The setup I'm using (and which works) consists of this cable and this breakout board. From the breakoutboard I'm connecting TX/RX/GND directly to the Netduino.
     
  17. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    That's just shows how the chip can do as :
    USB to RS232 Converter, you can see the page 27.
    And the others just follow that.

    In this project is an original design, no need to use other chip, whatever max232 or other TTL or cmos logics, they just connecting directly from Tx/Rx to Rx/Tx.
     
  18. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    While I have never tried it it seems if you dig into the schematics of some of the Sparkfun TTL <=> RS232 converters they do NOT have a power supply boost circuit, implying they use a 5V level for the RS232 side. That's going to hit the very low end of the RS232 spec, so it's "legal."

    So you can probably just use the FTDI chip, the inverters (I'm not sure if you need them but better to have one left in your junkbox then on order), and connect direct to the RS232 inputs of your development board.
     
  19. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    I just checked the FT230XS for the online store in Taiwan, it's not easy to buy it for some piece, but the CP2102 is ok, because I knew someone already bought this chip, maybe I can buy from him.

    Now, I really prefer to use FT230XS, just a few pins, and easy to use, I think I have to through someone to buy.

    I am planning to use 89s52 + CP2102 or FT230XS.
     
  20. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    USB to Serial Breakout Board for Prolific PL2303SA, FTDI FT230X.

    In the beginning that I want is to use PL2303, but someone said that the chip maybe no good for compatible, so I decided to use CP2102 or CP2104, but when you mentioned the FT230X, it seems this one is better, because I want a project no need the RS232, just use USB to PC.
     
Loading...