+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 21

Thread: usb transfer to pic

  1. #1
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default usb transfer to pic

    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.


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    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.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #3
    fermat7 Newbie
    Join Date
    Dec 2008
    Location
    High lands
    Posts
    25

    Default

    u can find more details on MICROCHIP web site...

  4. #4
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default

    i bought the usb to serial cable. so now do I need a max232 to convert voltages if Im only using +5v?

  5. #5
    BronzeG3 Newbie
    Join Date
    Jan 2007
    Posts
    22

    Default

    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.

  6. #6
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default

    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


  7. #7
    Angry Badger Newbie
    Join Date
    Jun 2008
    Location
    Flintshire, North Wales
    Posts
    97

    Default

    Quote Originally Posted by BronzeG3 View Post
    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.

  8. #8
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,807

    Default

    Quote Originally Posted by Angry Badger View Post
    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.

  9. #9
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default

    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

  10. #10
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,807

    Default

    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 by Pommie; 17th August 2009 at 10:29 PM.

  11. #11
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default

    yes.

    9600 bps
    8 data bits
    parity none
    stop bits 1
    flow control none

  12. #12
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,807

    Default

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

    Mike.

  13. #13
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default

    Quote Originally Posted by Pommie View Post
    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 by frubo; 17th August 2009 at 11:01 PM.

  14. #14
    frubo Newbie
    Join Date
    Jun 2009
    Posts
    33

    Default

    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.

  15. #15
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,807

    Default

    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.

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. Opamp transfer
    By dark in forum General Electronics Chat
    Replies: 20
    Latest: 17th May 2009, 01:55 AM
  2. Help: transfer from assemble to Hex
    By ahmadleb3 in forum Micro Controllers
    Replies: 15
    Latest: 17th December 2006, 05:50 PM
  3. Transfer Function.
    By lord loh. in forum General Electronics Chat
    Replies: 2
    Latest: 21st July 2006, 01:27 PM
  4. USB data transfer
    By dynomyte in forum Electronic Projects Design/Ideas/Reviews
    Replies: 5
    Latest: 15th April 2006, 01:47 AM
  5. transfer function...
    By elec123 in forum General Electronics Chat
    Replies: 4
    Latest: 3rd January 2006, 08:29 PM

Tags for this Thread