Hmmm...
The program memory may start at 0005, however your programmer still needs to be able to write to the other memory locations (to setup the interrupt vector etc).
My own programmer starts writing at 0x0000 and then writes the config word above 0x2000(words).
Here's a rough program I used to test it:
Code:
#include
__CONFIG(UNPROTECT & DEBUGDIS & LVPDIS & BORDIS & PWRTDIS & WDTDIS & XT);
void main(void)
{
short i;
TRISC = 0x00;
RC3 = 1;
// nasty, test
while (1)
{
i++;
if (i > 0)
{
RC3 = 1;
}
else
{
RC3 = 0;
}
}
}
Here is the intel hex format file:
(the first line has spaces to delimit length, address, record type, data). Note the address in the second to last line is 400E, this is the config address.
Code:
:10 0000 00 0A128A1103280310831603130030031801
:1000100001308700031403181028122883120313D9
:100020008715132887110130F0070318F10A0030F3
:10003000F1077108803AF20080307202031D222815
:1000400001307002031C25282628302803140318C9
:100050002C282E288312031387152F28871139285F
:1000600003100318362838288312031387153928FC
:0A007000871113280A128A110028D4
:02400E00393F38
:00000001FF
Edited by swanny (Tue Jun 30 2009 11:14 PM)