

#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming) #pragma config BOREN = OFF // Brown-out Reset Enable bit (BOR disabled) #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled) #pragma config FOSC = HS // Oscillator Selection bits (HS oscillator)
#CHIP ONLINE HEX EDITOR CODE#
The code protection bits are set in the configuration words from statements in the source code files.įor MPLABX the C language syntax for the PIC16F877A is: I guess that it could also be done when doing the Production build in X IDE, right?Ĭannot really see what your points are in all of this. c code, before the first attempt to compile.

I gather that the code protection is normally done when setting the Config Bits while writing the. I was just trying to use the original hex file as an exercise in loading a prebuilt hex file using X IDE (or X IPE). This is what is usually in the HEX file for the PIC16F18877 to set the configuration: :020000040001F9 This is what is usually in the HEX file for the PIC16F877A to set the configuration: :02400E003A3F37 Find these documents if you want to know more about this. Microchip does have some documentation that describes how the Intel HEX file addresses map to the physical address used by the controller. The addresses that appear in the Intel HEX file generated by the Microchip tools ARE NOT THE SAME as those that appear in the data sheets that describe the controllers. :0A000E00EC3FFF3F9F3FFF3FFF3F25 <- configuration words This is what is used in the HEX file for the PIC16F18877: :020000040001F9 <- upper 16-bits of 32-bit address So the ID locations and configuration words start at different area of the flash space (0x8000), this means the Intel HEX file address starts at 0x0001000. The PIC16F18877 has a larger possible code space(0x0000 to 0x7FFF). The Intel HEX file address is 0x4000 for this. The ID and configuration words are located starting at address 0x2000. This is represented in the HEX file as a byte address from 0x0000 to 0x3FFF.

The address range for 14-bit executable instruction words are in the 0x0000 to 0x1FFF range. PIC16F877 addresses never go above 0x4400, so there is never a need to use type 2 records. You also need to check for the type 2 record setting the address to the config locations, otherwise the 2nd last line could be just FLASH, or. Before I look at the machine code for the 16F877A (which I am NOT good at), does anybody have any ideas? Only other chip on the eval board is a SP3232 for the RS-232 port. But the program does not run, nothing happens with the eval board. Using MPLAB X IDE, I did the following to get the original hex file back on to the PIC: Create New Project>Category Embedded>Prebuilt>Set As Main Project>Finish>Make & Program> received Programming/Verify Complete in Output Window. Having been successful with the LED blink, I wanted to re-load (burn) the original hex file, to make the PIC perform like when it arrived.
#CHIP ONLINE HEX EDITOR SERIES#
It flashed a series of 8 LEDs on the board. Before I did that, I read and saved the hex file which came with the eval board, again using MPLAB X IDE. I successfuly wrote, compiled, programmed/verified a simple LED blink program using MPLAB X IDE. After not writing code for many years, I jumped into the world of 8 bit embedded with a PIC 16F877A Chinese eval board, MPLAB X IDE v5.50, XC8 v2.20, and a Pickit 4. PIC16F877A Prebuilt hex file programs "Loads/Verifies" but does not run
