Interfacing FT232 with PIC

Discussion in 'General Electronics Chat' started by DerStrom8, Apr 11, 2015.

  1. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Hi all,

    I haven't done a whole lot with serial communication so this is rather new to me. I designed a PIC prototyping board recently (Actually Rev 3) and am thinking about adding a USB programming interface with a bootloader on the PIC for Rev 4. However, since I"m not familiar with it I find myself in need of a bit of assistance.

    The board is based around a PIC18F1330, which has RX/TX pins. I was thinking I read somewhere that you can use these pins to communicate through the bootloader and program the PIC. My question right now is hardware-based: How to connect the USB to the PIC itself. I expect I need a USB/Serial converter IC such as the FT232 but I'm not sure how to connect it. Connecting the FT232 to the USB connector isn't an issue, it's just connecting it to the PIC. It's not as simple as connecting the RXD/TXD pins, is it? I have seen Atmegas use this setup, but haven't seen it on PICs.

    Thanks,
    Matt
     
  2. hexreader

    Active Member

    Apr 16, 2011
    250
    82
    That is how mikroelektronika do it....

    Download the schematic here: http://www.mikroe.com/downloads/get/1892/ready_for_pic_dip28_sch.pdf

    Note that a completely different PIC is used here. Note the use of jumpers on Tx and Rx lines, which is a VERY good idea.

    You MIGHT want to put a 10k pull-up resistor on PIC Rx pin to prevent garbage data reception when Rx link is open.

    EDIT: or maybe this obsolete board is closer to to the kind of board you want. http://www.mikroe.com/downloads/get/1367/pic_ready2_manual_v100.pdf

    EDIT2: .... and by chance - PICready2 is being sold off cheap here: http://www.mcustore.com/clearance/pic-special-offers-clearance.html
    Don't know what postage to USA costs though...

    EDIT3: Can't find a bootloader for PIC18F1330 when I google - but maybe you know of one?
     
    Last edited: Apr 11, 2015
  3. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,328
    890
    It might be that simple; worst case, you might have to take care of RTS and CTS as well as TXD and RXD.

    FTDI shows the schematic for the FT232R board used in their USB-to-TTL Serial cables, here:

    http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf
     
  4. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,399
    497
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Of course one could always pick a PIC that already has a USB interface on it and leave the translator chip out of the bill of materials.

    Not an item for a one off personal build but something to seriously do for any commercial application.

    Well for the most part yes that is all.

    The details are you need some way to inform the code to read the data and store it as program; oft a button is checked at power on for this function.

    And of course you need the bootloading code, plus the custom link scripts to build the bootloader and application code in separate areas of program memory.
     
  6. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Thanks everyone,

    I am aware of the bootloader and all. I want to use a pic with 2 I/O ports (due to space constraints) and any pics with native USB capabilities have at least 3. That's why I'm thinking of using a translator chip.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
  8. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,399
    497
    From a bit more reading, it seems that Microchip MCP2221 is a usb PIC.
     
  9. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I'm looking for a device with 16 I/O pins (2 8-bit ports) with USB capability. I am not finding such a device with the part selector.
     
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    You need contigious ports rather than pins? Otherwise something like the PIC18F46J50 (28-Pin SPDIP/SOIC/SSOP) would fit your bill.
     
  11. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Sorry to be so difficult. Yes, I would like to have two ports with 8 pins each so that it can fit neatly on a breadboard. I really think a translator chip is the way to go.
     
  12. DerStrom8

    Thread Starter Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Hi guys,

    This is the schematic I have drawn:

    FT232+PIC.png

    Does that look about right? I expect I'll need to do some breadboarding before I can have this PCB manufactured, just to be sure. I'm just hoping for verification from someone who has done this before.

    Thanks all!
    Matt
     
Loading...