hi im trying to create a downloader for my PIC. im using ccs compiler for my codes and im planning to create a downloader to download my hex file directly to the PIC. can somebody with a kind heart tell me or give a link as to how the hex file works? i mean how does it create the hex file? what is the basic operation involved? thanks in advance..
hi... my problem now is that how can i convert the hex file so that i can download it to the pic.. i believe i still have to do some manipulation on the hex file so that the pic can understand it. any ideas? thanks..
let me rephrase my question.. i am using a pic and a ccs compiler. as i understand, you write codes in c using ccs. then when you compile it, you create a hex file and then the hex file should be downloaded to the microcontroller.. my question is, how does other bootloaders do this? how do they transfer the hex file to the pic. what kind of manipulations do they perform on the hex file for it to be understood by the pic? please help..
let me rephrase my question.. i am using a pic and a ccs compiler. as i understand, you write codes in c using ccs. then when you compile it, you create a hex file and then the hex file should be downloaded to the microcontroller.. my question is, how does other bootloaders do this? how do they transfer the hex file to the pic. what kind of manipulations do they perform on the hex file for it to be understood by the pic? please help..
The HEX file is a standard Intel ASCII format, extended for the PIC's specific needs - the format is fairly simple, and is fully explained in the MPASM and MPLAB helpfiles.
Bootloader or programmer software reads the HEX text file, picks out a word(in ASCII, like e.g. 3F85) representing a 14-bit binary value, then send it out bit by bit in serial fashion 0010..... You will need to refer the datasheet to know the order the bits are sent, either MSB or LSB first.
The hardware on the programmer then set the logic level of its pin high/low according to the value of each serial bit it received. This level is read by the PIC and it will write it into its flash memory after it has gathered all 14-bits.
hi im trying to create a downloader for my PIC. im using ccs compiler for my codes and im planning to create a downloader to download my hex file directly to the PIC. can somebody with a kind heart tell me or give a link as to how the hex file works? i mean how does it create the hex file? what is the basic operation involved? thanks in advance..
in the hex file created by the ccs compiler, how do i know where is the MSB or LSB? e.g. this is an excerpt from a hex file created by ccs. 10 00 00 00 00 30 8A 00 9A 28 00 00 23 30 84 00 83 13 00 08 FF. in the data part in bold, how do i know which ones are the LSB and MSB? and also in the microcontroller part, im using 16f877 pic, i tried looking at the datasheet, but it doesnt indicate how it wants to receive the data. MSB or LSB first.. please help.. thanks.
BeeBop said:
It sounds like you want one PIC to download to another, it that correct? If you just want a bootloader, you would use the one that came with CCSC, no?
no. i want to download from my PC to PIC. and i want to create a bootloader thats why im trying to understand the basic principles involved with this..
Your binary data are(in hex): 0x3000, 0x008A, 0x289A, 0x0000, 0x3023,.... with the checksum 0xFF at the end. These are placed into each address location of the PIC flash memory. Notices that because every word is 14-bit wide, the two MSDs would have to be in the range 0x00~0x3F.
To understand how one can handle these data and actually send them into the PIC, you need to get hold of the Microchip programming Spec document 39589b. It is for 16F87XA. I searched but there is no such document for 16F87X. Read it until you understand its content.