Difference between revisions of "PIC Programmers, In Circuit Programming and BootLoaders"

From OpenCircuits
Jump to navigation Jump to search
Line 48: Line 48:
 
== Serial Bootloaders ==  
 
== Serial Bootloaders ==  
  
 +
With a Serial Bootloaders there are two software components ( in addition to the hardware serial connection ) the Bootloader utility running on the PC and the PIC bootloader on the PIC.  If you program is going to use a serial interface any way ( even if just for debugging ) this can be a very nice way of programming, you do not have to move one bit of hardware to go from programming to running to programming to .......
  
  [[category:Microcontroller]][[category:PIC]]
+
The PIC bootloader must be configured for the target chip and the configuration of the PIC, generally speaking the user program must share the configuration of the bootloader as the bootloading process does not change the configuration.  Because of this bootloaders are often distributed in source code form ( usually asm ) so that you can tweak the code and assemble it for yourself.  Often there will be several pre-built hex files and one of these may or may not work for you.  Once you have the right bootloader you use a Hardware Programmer to write the bootloader to the PIC for hopefully the first and last time ( a badly behaved program can destroy the bootloader requiring a reload ).
 +
 
 +
In some cases you may buy a chip that already contains the bootloader -- this can save a certain amount of work.
 +
 
 +
 
 +
Tested tool chains for Serial Bootloaders -- if you Chip/Hardware is close this might be a good place to start.
 +
 
 +
{| class="wikitable"
 +
|-valign="top"
 +
|Method
 +
|What
 +
|Details
 +
 
 +
<!-------------------------------->
 +
|-valign="top"
 +
|Chip/Hardware
 +
|Tool Chain
 +
|Comment
 +
<!-------------------------------->
 +
|-valign="top"
 +
|x
 +
|x
 +
|y
 +
<!-------------------------------->
 +
|-valign="top"
 +
|what
 +
|[[]]
 +
|Comment
 +
 
 +
 
 +
<!-----------end of table--------------------->
 +
 
 +
|}
 +
 
 +
 
 +
 
 +
[[category:Microcontroller]][[category:PIC]]

Revision as of 14:38, 14 May 2009

This is an article in the process of creation, will you help finish it?


In the PIC world programming may mean either writing the program by a human being or writing the hex file from the compiled ( assembled ) program into the PIC chip. This page concenrns the former.

Overview

There are several different methods of programming each with its own advantages and disadvantages. Right now I like serial bootloading the best, but it may not be the best for everyone. The following chart summarizes the methods, they are then discussed in more detail later.


Method What Details
Hardware Programmer The PIC is placed in the programmer and the programmer workds with a PC ( typically ) to move the program to the PIC. All chips can be used with Hardware Programmer, but different chips may require different programmers.
In Circuit Programming Not all chips can be used with In Circuit Programming.
Serial Bootloaders In this method a small program ( the Serial Bootloader ) is hidden away in the PIC memory and upon reset the PIC would check its serial connection and if connected to a Bootloader utility on the connection a new program is loaded into the PIC, and then the downloaded program begins. If the Bootloader utility is not connected the current PIC program is run. The serial connection can be of any type, RS232 or USB for example. Requires initial programing with a Hardware Programmer, and the serial connection. The PC runs the Bootloader utility. Not all chips can be used with Serial Bootloaders.

Hardware Programmer

In Circuit Programming

Serial Bootloaders

With a Serial Bootloaders there are two software components ( in addition to the hardware serial connection ) the Bootloader utility running on the PC and the PIC bootloader on the PIC. If you program is going to use a serial interface any way ( even if just for debugging ) this can be a very nice way of programming, you do not have to move one bit of hardware to go from programming to running to programming to .......

The PIC bootloader must be configured for the target chip and the configuration of the PIC, generally speaking the user program must share the configuration of the bootloader as the bootloading process does not change the configuration. Because of this bootloaders are often distributed in source code form ( usually asm ) so that you can tweak the code and assemble it for yourself. Often there will be several pre-built hex files and one of these may or may not work for you. Once you have the right bootloader you use a Hardware Programmer to write the bootloader to the PIC for hopefully the first and last time ( a badly behaved program can destroy the bootloader requiring a reload ).

In some cases you may buy a chip that already contains the bootloader -- this can save a certain amount of work.


Tested tool chains for Serial Bootloaders -- if you Chip/Hardware is close this might be a good place to start.

Method What Details
Chip/Hardware Tool Chain Comment
x x y
what [[]] Comment