ok sorry for the tripple posts here ... just that the more i write about this the more i remeber from when i had this problem...
hers a qiuck list of what the #build instruction does:
This is a ccs instruction only and not pic in general, but im guesing there is someequivalent in asm or hitech c
************************************
Syntax:
#build(segment = address)
#build(segmentt = address, segment = address)
#build(segment = start:end)
#build(segmentt = start: end, segment = start: end)
Elements:
segment is one of the following memory segments which may be assigned a location: MEMORY, RESET, or INTERRUPT.
address is a ROM location memory address. Start and end are used to specify a range in memory to be used.
Start is the first ROM location and end is the last ROM location to be used.
Purpose:
PIC18XXX devices with external ROM or PIC18XXX devices with no internal ROM can direct the compiler to utilize the ROM.
Examples:
#build(memory=0x20000:0x2FFFF) //Assigns memory space
#build(reset=0x200,interrupt=0x208) //Assigns start location of
//reset and interrupt vectors
#build(reset=0x200:0x207
interrupt=0x208:0x2ff) //Assign limited space for
//reset and interrupt vectors.
*************************************
hope this helps...
Of course, this could be way off
, but its a problem i know is out there, that can generate very weird microcontroller behavior...
Another thing i would check is the decoupling capacitors ... also check your brown out settings, and watch dog settings. all these can reset your controller, and you dont want that i gues