Let's Make Robots!

Usb to serial converter for pic programming

Hi.I have a pic programmer (pic 16f877a) with rs232 adaptor.I program the pic with the serial port of my pc

and i want to make it usb  but still programming it with serial way with low voltage programming (no bootloader)

so i will connect the usb port to my pc and the output rs232 with the rs232 of my pic programmer.

I think i need a usb to serial converter chip like FT232xx and a hex schmitt trigger inverter to be able to send hex

files to pic.

I have found some schematics but most of them are not for programming and i am a little confused.

If you have a schematic for this converter please post it.Thanks

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

my first programmer was a "jdm" type programmer that works perfectly with a real serial port. when I bought a new laptop (offcourse without a serial port) I bought an usb to serial cable.. however this was not working at all. so I just want to warn you that not every programmer wil work with such an cable.

now I have an "galvawisp" that does have a pic in its own circuit to work, so an smarter kind of programmer. I'm using it together with the same usb to serial cable today and that just works great for me.

Apologies.  I thought you were looking for a way to get your chips programmed.  If you are more interested in the building of your own, let's see what we can find.  I went to sparkfun.com and searched in the Breakouts section.  There are several USB to Serial breakdout boards.  Now, I know you want to build your own, and this is why I went to Sparkfun.  They are very into OpenHardware, so they usually have schematics, datasheets, drivers, examples, etc.  This is no exception.  I grabbed a link for one that has a schematic: https://www.sparkfun.com/products/198

Is this more of what you are looking for?

Yes thank you, its close to what i am looking for. I don't know yet which is for programming but

i will search.With a quick look, most of them are the half circuit (usb to serial,not to send hex file)

but maybe there is a schematic and perhaps i will ask.

Thanks for the reply man.

I was re-reading your initial question.  I wonder if I understand what you are looking for?  This is what I understand: 

You want to build a circuit to program Pic microcontrollers.  This programmer will have a USB plug to connect to a PC.  It will have an output plug that will program the Pics with Low Voltage Programming ( as opposed to the normal ICSP style ).  The PC programming software is set up to send the Hex file via PS232.  You will adjust the PC to send the RS232 signal from the programming software over USB to the programmer.  The programmer will have an onboard USB to serial converter like an FTDI.  The converted RS2332 signal will be passed to an onboard microcontroller.  This onboard controller will read in the Hex file.  It will then send the LVP control signals to the chip that you wish to program.  Is this correct?

If so, I couldn't find a schematic that specifically covered LVP ( low voltage programming ).  I belive you could use the converter schematic I pointed to for part of your design.  You would wire the serial output from this to the microcontroller on your programmer. It will be up to you to generate the LVP programming commands on this controller.  Microchip has Application Notes on how to do this.  I've heard that LVP is pretty finicky and not too reliable, so I've always stuck with regular ICSP.  

You can look around on sparkfun.com for more ideas.  They have a pretty good forum as well.  You might also try joing the piclist (http://piclist.org).  There are many knowledgable engineers on that list.  Good Luck!

 

Tom

I have builded a programmer already and its working fine.The pic 16f877a which i program works with serial port.

I made a mistake recently with a switch on my circuit and i connected it the wrong way and i burned the rs232 port of my pc!

I am lucky that the programmer still works(at other pc's).

So now i want to make it usb to connect it to a usb port but still it will be founded as serial com1 device.

No new programmer but like that

pc usb port-->usb jack --> FT or some usb serial converter--->Hex schmitt trigger inverter-->rs232 jack-->rs232 of my circuit  This in bold i want.

now it's pc rs232 port---> rs232 of my circuit programmer

 

I found this until now ,i am afraid its for parallel FIFO but maybe it works.See this schematic to understand

http://picpgm.picprojects.net/hardware/picpgm_usb_v1.0.png

 

 

I understand now.  Thanks.  If you combine the converter I posted earlier with this circuit ( page has schematic download ) https://www.sparkfun.com/products/133 .   I think that should do it.  The circuit uses simple transistors in place of a Max232.  It includes the signal inversion you are looking for.  The circuit is very simple.  I used to use an even simpler version when breadboarding, but I can't find the link to the circuit.  The one from sparkfun is more robust anyway.

Update:  I found a schematic similar to the one I used to use on the breadboard: http://www.kmitl.ac.th/~kswichit%20/ap275/ap275.htm

Look at version 2 for two communication with inversion.

What do you think?

The converter you posted earlier is correct  but for what i want its not combined with the second i think.

One thing i was confused last days and one teacher explained to me,is that max232 is only for 

serial communication and NOT programming.So you can't send a hex file to program the pic.This i believed but it's not.For programming the pic you don't use max232.

In conclusion i need the usb to serial converter like the one you posted with cp2102 combined with a 74ls14n for example.Outputs of cp2102 connected to a hex inverter (74ls14n).

Thanks for all the help,i will try the schematic i posted (FT245BL and 74ls14) or another one the next days and i will post the result if it's working.

Okay.  If you have it worked out, that's great.  I'd love to hear what you come up with.  I'm a bit confused why the inverter I posted won't work. The converter lets you send RS232 signal over USB.  The shifter board I posted takes the RS232 serial signal and inverts it ( the same, I think as the 74LS14 ) to TTL.  If the output from the shifter goes directly to the RX and TX of your programmer's microcontroller, it can read them perfectly with the built in AUSART peripheral.  You can use the 74LS if you like; I thought the transistor solution might be faster, cheaper, and smaller footprint.  

Good Luck!  And let me know how it comes out!

Tom

Well thank you for your answers but i am looking for a schematic to build it my own

not a cable or a new programmer. These cables(most of them) don't have a hex trigger to programm a pic

and they are for serial communication only, i  think.

Also i want the output of this to be rs232 so i will connect it to my programmer,not TTL output or something else.

Hey Giorgos,

   I used a PicStart+ for quite a while when I started with Pics.  When I moved to laptops, I suddenly lost my serial port.  I bought something like this ( https://www.sparkfun.com/products/11304 ) from Sparkfun.  It worked really well.  I eventually bought Pics that it couldn't program with the PicStart+ under Linux ( with picp ), so I bought a PicKit II from Mouser for about USD $30.00.  It is USB and connects to the ICSP pins of the Pics ( MCLR, Vcc, Gnd, PGD, and PGC ).  It works flawlessly on all my Pics.  I haven't upgraded to the PicKit III yet because I'm not sure if it will work under Linux.  It might with MPLabX, but I haven't checked.  I see that Mouser now sells it for USD $34.99 here: http://www.mouser.com/ProductDetail/Microchip-Technology/PG164120/?qs=sGAEpiMZZMtdAabcSkQOl4ERF8GmpIKm

   With the USB to serial converter, I had to do some work to get it to work under Linux.  I needed to add a rule in /etc/udev/rules.d.  It wasn't too hard once I knew what to do.  I'm not sure what it takes under Windows or Mac.  Sparkfun includes a datasheet and driver downloads, though.  Let me know if you have any questions.

Tom