Micro USB to RS232?

Thread Starter

Scalpel78

Joined Aug 11, 2013
56
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?
 

ErnieM

Joined Apr 24, 2011
8,377
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.
 

Brownout

Joined Jan 10, 2012
2,390
For now this is all just theory, so I'm not convinced this will work. What do you guys think?
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.
 

ScottWang

Joined Aug 23, 2012
7,409
Hi Scott,

Are you asking me? Or are you asking the OP? I don't really understand your question.
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.
 

Brownout

Joined Jan 10, 2012
2,390
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.
 

ScottWang

Joined Aug 23, 2012
7,409
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.
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.
 

Thread Starter

Scalpel78

Joined Aug 11, 2013
56
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.
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.
 

Thread Starter

Scalpel78

Joined Aug 11, 2013
56
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.
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?
 

ScottWang

Joined Aug 23, 2012
7,409
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?
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?
 

Thread Starter

Scalpel78

Joined Aug 11, 2013
56
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:

kubeek

Joined Sep 20, 2005
5,795
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?
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.
 

ScottWang

Joined Aug 23, 2012
7,409
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.
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.
 

ErnieM

Joined Apr 24, 2011
8,377
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.
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.
 

ScottWang

Joined Aug 23, 2012
7,409
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.
 

ScottWang

Joined Aug 23, 2012
7,409
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.
 
Top