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

Programming chained PIC devices via I2C

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



Joined: 23 Apr 2006
Posts: 1

View user's profile Send private message

Programming chained PIC devices via I2C
PostPosted: Sun Apr 23, 2006 5:44 pm     Reply with quote

I would like to program a 16F873 device using the I2C bus of a 18F8720(similar idea as a bootloader). Does anybody know if this is possible?

I am trying to parse the HEX file generated by the compiler for the 16F873 device and then hopefully program the contents using the 18F8720 which is connected to the PC serial port.

My setup is as follows:
PC_COM -> 18F8720 (master) -> I2C -> 16F873 (slave)

Ideally, I would like to store the 16F873 code in the 18F8720 memory and then send a command to the 18F8720 to download the code to the 16F873.

Are there any documents out there that describe parsing HEX files for PIC devices and what is necessary to program the data, configuration, etc of the slave PIC device?

Thanks.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Apr 23, 2006 6:53 pm     Reply with quote

Not only is it similar to, but it is a bootloader you are describing.

Yes it is possible however, in general, you cannot program configuration bits via a bootloader. This is because the bits are programmed once when the bootloader is put onto the PIC by the conventional programmer. There are some PICs which allow a small subset of configuration bits to be set but not cleared via self-programming (bootloaders) but this is not generally useful for typical bootloading applications. If you need to be able to reset the configuration bits then what you really need is a remote programmer that can perform ICSP of a remote PIC. The Microchip Explorer 16 development board is an example of this type of implementation. It conatins two PICs that can run independantly. One of the PICs (a USB PIC) can be loaded with programmer code which will then program the other PIC via ISCP.

As for parsing the hex file - this depends on your bootloader. Some bootloaders do not require any preprocessing of the hex file. They are passed the contents of the hex file (actually an ASCII representation of the binary data with addressing information) line by line and program themselves accordingly. Note these bootloaders must maintain some "state" as data records in the hex file are in the context of the last "type 4" record.

I use a technique similar to what you are describing to program downstream PICs from a Master PIC.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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