2

I have a PIC18F1330 which does not have native USB capabilities (see datasheet). I am planning to load it with a bootloader using my PICkit the first time and then programming from a USB port after that. I have a Micro-B USB jack and an FT232 (datasheet) to allow me to program it using the RX/TX pins on the PIC (RA3 and RA2 on the 28-pin QFN). However, I am not very familiar with this method of programming micros so I'm looking for some verification. Here's the schematic I have so far:

PIC and FT232

Is it as simple as connecting pins 24 and 25 on the FT232 to pins 7 and 8 on the PIC? Or must I use some of the other connections as well? I have not found much information for programming PICs through an FT232, mostly AVRs.

You can ignore some of the net labels that don't make much sense, they are used for other parts of my project.

EDIT: This post is asking about the connection between the FT232 and the PIC18F1330. I am NOT asking about the bootloader.

DerStrom8
  • 21,042
  • 8
  • 61
  • 95
  • possible duplicate of [What is a boot loader, and how would I develop one?](http://electronics.stackexchange.com/questions/27486/what-is-a-boot-loader-and-how-would-i-develop-one) – Olin Lathrop Apr 17 '15 at 17:20
  • Sorry Olin, this has absolutely nothing to do with the linked thread. I am asking how to connect the FT232 to the PIC (NOT AVR) in order to program the PIC via USB. I am not asking about the bootloader. – DerStrom8 Apr 17 '15 at 17:37
  • Then I don't understand the question. What you are asking about overall is a bootloader. If you are only asking about how to physically connect the FT232 to the PIC, then connect the RX and TX lines appropriately. What's the problem? That's so obvious that it seemed you were asking about something deeper. – Olin Lathrop Apr 17 '15 at 17:56
  • I am not asking about the bootloader. The bootloader is a program stored in the PICs memory. I am asking about the physical connections, whether or not simply connecting the RX/TX lines is enough, or if I missed something. Simply put, is my schematic correct? – DerStrom8 Apr 17 '15 at 19:04

2 Answers2

1

RX, TX would be enough to send out programming data and get back acknowledgements from the bootloader. Don't forget ground. Also, if you need to use USB only occasionally consider having it extermally (see ft232 basic breakout from Sparkfun,for example).

Edit: you may also want to connect vccio from ft232 to the vcc of the pic to have the same logic levels on both chips.

Oleg Mazurov
  • 3,231
  • 1
  • 14
  • 17
1

You will want to cross-connect the TX lead from the FT32 chip (pin 25) to the RX lead of the PIC (pin 8), and RX lead from the FT32 chip (pin 24) to the TX lead of the PIC (7).

I know you said you are not asking about the bootloader, but I'm going to address that anyway.

I'm a little confused by your question, you seem to know what a bootloader is, but then as Olin says you are asking basic questions about how to wire up the IC's. Are you planning on writing your own bootloader (which is not trivial), or using one that you have found on the net? As you stated in your question, you say you have not found much information re using bootloaders with PICs as they are much more common with AVRs because of the Arduino.

If you are planning on writing your own bootloader, you are going need to write two pieces of firmware -- parsing the contents of the hex file coming from the PC (presumably sent over a virtual COM port using still additional software), and then using the self-programming feature of the PIC (available on some, but certainly not all PICs) to update the portion of the flash not occupied by the bootloader.

Frankly, unless you are completely out of pins on the PIC, I would just include an interface for an ICD or PICkit using the PGEC/PGED pins. Much, much easier.

tcrosley
  • 47,708
  • 5
  • 97
  • 161
  • Thanks @tcrosley. Don't worry, I won't be writing my own bootloader. I have found several (from Microchip, nonetheless) already, one of which I will use. I just wanted to verify that the RX-TX and TX-RX connections between the FT232 and PIC were *all* I needed, and that I didn't miss any other important connections. So, judging by your answer, my schematic is correct? I have found info about bootloaders for the PIC, just not a USB interface using the FT232 – DerStrom8 Apr 17 '15 at 19:07
  • @derstrom8 ok, good, I was basing my comment on your statement "I have not found much information for programming PICs through an FT232", so I wasn't clear whether you had code for a bootloader or not. As far as the schematic goes, it looks okay except you need some circuitry on the MCLR line -- usually just a pullup to Vdd but you should check the datasheet for your PIC and see if Microchip recommends anything more. You have it labeled as "Mode select", I don't know where that came from. – tcrosley Apr 17 '15 at 20:03
  • Yup I'm aware of the MCLR stuff. "Mode select" had to do with the board I'm designing, you use a jumper to select between that pin being MCLR or RA5 (i think that's the digital pin). I have the MCLR circuitry included on the board, and you connect it through that jumper. Thanks for the help! – DerStrom8 Apr 17 '15 at 20:54