![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
ljbeng
Joined: 10 Feb 2004 Posts: 205
|
Could an 18F boot load a 16F |
Posted: Fri Aug 31, 2007 7:59 am |
|
|
I have an 18F2685 with lots of rom. I have a daughter board that is optional that will have a 16f628. The two will talk by serial port.
Would it be possible to have the hex file for the 16f628 saved as data in the flash of the 18F, then if the firmware of the 16F needs to be updated, the 18F could just run a bootload program and send the new hex file to the 16F.
I want the 16F to be surface mount for size reasons. I want to have to only send the 18F chip for updates but still be able to update the 16F program..... |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Aug 31, 2007 9:00 am |
|
|
Bytes is bytes. The 16F shouldn't care where they come from. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 31, 2007 11:08 am |
|
|
Quote: |
Would it be possible to have the hex file for the 16f628 saved as data in
the flash of the 18F, then if the firmware of the 16F needs to be updated,
the 18F could just run a bootload program and send the new hex file to
the 16F.
I want to have to only send the 18F chip for updates but still be able to
update the 16F program.....
|
You're describing a programmer, not a bootloader. A bootloader is a
program that exists inside the target PIC. Typically, when the target PIC
has just started running after a reset, it will check for a signal to execute
its bootloader code. If it doesn't receive the signal, then it executes
its normal program. The signal could be a logic level on an input pin,
or it could be a specific byte that is received on a serial port, or some
other communication module. When the target PIC executes its
bootloader code, it expects to receive packets of bytes from the host
device, and then it self-programs the bytes into its flash memory.
The 16F628 doesn't have the ability to write to its own flash memory.
It can't do self-programming, so you can't do a bootloader with it.
Only some PICs have this ability. If they can do it, it's listed in the
data sheet in a section usually called "Writing to Flash Program Memory".
You could use your 18F PIC as a programmer. It would act the same
as the CCS ICD-U40, or the Microchip ICD2, or any programmer
that can do in-circuit programming. To do this, you need to study
the Programming Specification for the 16F628 and write code for you
18F to duplicate this. Also, you probably want to use Low Voltage
Programming mode for the 16F628. Otherwise, your programmer
board would need to supply the Vpp voltage, which the data sheet says
is Vdd + 3.5v (minimum). To use Low Voltage programming mode,
you must set the LVP fuse in the 16F628 and you should put a pull-down
resistor on the PGM pin (47K would work) so that the PIC doesn't
accidentally enter programming mode. Also, you can't use that pin for
anything else when the PIC is in LVP mode. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|