CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB firmware update support on PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
vinniewryan



Joined: 29 Jul 2009
Posts: 154
Location: at work

View user's profile Send private message MSN Messenger

USB firmware update support on PIC
PostPosted: Mon Jan 20, 2014 11:39 am     Reply with quote

Hello,

I'm trying to get some input from the community, as there are a few ways to go about this. I'm building a PCB which will use a PIC micro. I haven't yet chosen which PIC, but it will likely be a PIC18F or PIC32. This circuit needs to support USB re-programming of the PIC. Basically, once I send the prototype to the client, they will need to be able to plug it in to the USB port, then load an updated firmware file (which I'll email to them), and burn it to the PIC.

Option A, is to build an ICSP with a second PIC, dedicated to USB and reprogramming the main PIC. This option seems to be a little complicated for what I need, but I've seen many people in the DIY industry do it.

Option B, is to use an EEPROM with USB connectivity, then set up the PIC for code shadowing off the ROM. This seems to be the 'manufactured' choice in many products.

Option C (theoretical), would be to use the USB peripheral built into a PIC32 to re-program itself, with no external circuitry, but I don't know that this is even possible yet. Every device I've seen requires the typical "Drive MCLR, use DAT, CLK pins for programming".

Thank you for suggestions. I've never been confronted with this requirement in a circuit, and have always been comfortable using the CCS ICSP, which pertains to option A.
_________________
Vinnie Ryan
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Jan 20, 2014 12:47 pm     Reply with quote

Any chip that can write it's own flash memory, can use a USB bootloader and reprogram the rest of the chip with this.
Downside is that it is fairly bulky.
Microchip do such a bootloader, and a PC program to talk to this. There is the code to allow this to be used with CCS, in the code library.
With the compiler, there is ex_usb_bootloader.c, which does a similar bootloader.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9241
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 20, 2014 1:20 pm     Reply with quote

maybe another option,others will know for sure, is to use a USB<>TTL module on the PICs UART port.
my thinking is that the USB code is inside a $2 module making the bootloader look as a 'serial port' instead of a complicated USB device? You need the USB connector anyway..so cost is really minimal, especially for something that works 'out of the box'.

just an idea....

jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Tue Jan 21, 2014 2:22 am     Reply with quote

Agreed.
The other way is to include the USB to serial on the board. The classic module for this, is the Polulu. The big advantage is that the bootloader shrinks from perhaps 1/10th the ROM, to only a few hundred bytes. It depends massively on the numbers involved, and how much of the chip's ROM space you can afford to loose....
vinniewryan



Joined: 29 Jul 2009
Posts: 154
Location: at work

View user's profile Send private message MSN Messenger

PostPosted: Wed Jan 22, 2014 10:05 am     Reply with quote

I'm thinking for the sake of less components on-board, the extra ROM use won't be a huge concern. I will look into the USB bootloader, thank you all for the suggestions, this has been very helpful.
_________________
Vinnie Ryan
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group