Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

usb transfer to pic

Status
Not open for further replies.

frubo

New Member
I want to transfer data from my pc to my PIC16F767. Can someone point me in the right direction? I was hoping to just rip up a usb cable and wire it to my pic but I know I will need some kind of driver for windows. I found usbio but the demo is only usable for 4 hours at a time. I was hoping to find a better free solution if possible.
 
Use a USB/Serial converter, and connect to the PIC as serial. Or, if your PC has a serial port, use that.

If you want native USB on the PIC, move to one of the 18F series that support it.
 
i bought the usb to serial cable. so now do I need a max232 to convert voltages if Im only using +5v?
 
Yep, you need a MAX232 to convert the RS232 levels to the PIC 5V TTL. I actually prefer the DS275 over the MAX232 because you need less capacitors.
 
I got my max232 circuit and I am still assembling it. I was under the impression that I only need to use TX and RX for transfer to my pic so do I need to do anything with C/DS and R/DT pin. I dont know how to set up jumpers on the 3x2 header for that either. here is the schematic

**broken link removed**
 
Yep, you need a MAX232 to convert the RS232 levels to the PIC 5V TTL. I actually prefer the DS275 over the MAX232 because you need less capacitors.

Hi,

If it's just from your pc via the usb to serial converter then you don't require the MAX232 chips. I've just used this method and it's fine without the converters.
 
Hi,

If it's just from your pc via the usb to serial converter then you don't require the MAX232 chips. I've just used this method and it's fine without the converters.

You must have bought a TTL level module. The shop bought converters are inverted and do need the MAX232.

Mike.
 
I just soldered it together and all the connections are made. I tried testing it by putting TX and RX together and sending data using hyperterminal to see if it recieves but it doesnt. I dont know how else to test to see if it works. I hope I didnt ruin the ic when soldering it
 
Have you set hyperterminal to not use handshaking - Flow Control = None.

Edit, that diagram is wrong, the RX and TX connections to the pic are the wrong way round. R1out on MAX232 goes to RX on the pic and T1in to TX.

Mike.
 
Last edited:
If your circuit is working correctly then shorting pins 2&3 on J1 should allow you to see what you type in hyperterminal.

Mike.
 
If your circuit is working correctly then shorting pins 2&3 on J1 should allow you to see what you type in hyperterminal.

Mike.

yes. ive done this just using a simple db9 connector and it worked before.

I just now realized something. the numbers on outside of the female db9 connector are correct but they are backwards on the pcb and dont match. therefore rx and tx arent even going into the right pin. wow i guess thats what I get for trying to buy a cheap kit. nobody buy this kit.... RS232 TTL Convertor Cable Kit MAX3232 AVR,PIC,GPS,XBOX

oh and the diagram isnt correct either? that means they screwed up twice
 
Last edited:
I connected to a different db9 connector and fed the tx and rx wires into my kit as they should be and it worked! I may as well just desolder the serial connector on the kit as it is worthless. As for the schematic being wrong...It didnt effect my hyperterminal test but I will just have to remember that tx and rx output are switched when i connect it to my circuit.

I cant believe how awful the kit turned out to be, doesnt even work when assembled correctly. That's pretty bad considering I am a college student just learning about these things. I was expecting it to be something I did wrong but the problem was in the kit itself.
 
The diagram is only labeled wrong. It is labeled with respect to the PC and so the pin marked RX on J1 has to go to the pics TX pin. Similarly, the pin marked TX has to connect to the RX pin on the pic.

Mike.
 
I connected to a different db9 connector and fed the tx and rx wires into my kit as they should be and it worked! I may as well just desolder the serial connector on the kit as it is worthless. As for the schematic being wrong...It didnt effect my hyperterminal test but I will just have to remember that tx and rx output are switched when i connect it to my circuit.

Are you sure about this,

In this diagram,
**broken link removed**
it is labeled correctly. Bottom left is pin 1.

Mike.
 
You must have bought a TTL level module. The shop bought converters are inverted and do need the MAX232.

Mike.

Hi Mike,

Aren't voltages on a USB port approx 5V so any signals at the RS232 end also at 5V? Do some of the adaptors step-up the voltage to RS232 levels?

AB
 
Hi Mike,

Aren't voltages on a USB port approx 5V so any signals at the RS232 end also at 5V? Do some of the adaptors step-up the voltage to RS232 levels?

AB

OK, looks like they do!

USB to RS232 converters

[.....Some USB to RS232 converters use integrated DC/DC converters to create the appropriate voltage levels for the RS232 signals, but in very cheap implementations, the +5 Volt voltage is directly used to drive the output.]
 
ok maybe i spoke too soon. it does not work. in am very confused by what is happening. When i plug my serial cable into the kit with the new soldered connector it always transmits data back in hyperterminal. even when the max232 is not powered. ive checked pin 2 and 3 numerous times and there is no connection according to my multimeter.
 
Are you sure about this,

In this diagram,
**broken link removed**
it is labeled correctly. Bottom left is pin 1.

Mike.

That picture actually doesnt look anything like what I got. I dont even see the max232 chip or 5 capacitors on there. See I ordered this kit off of ebay because it was real cheap and the website I linked is supposed to be what I recieved.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top