Thanks Bruce, I'm going to create a simple blinky routine and see if the MCU result is stable.
I can easily see that the boot jump is to a nearby line that jumps to a first address that then just jumps to another address that is a part of the standard routine for Float to Integer conversion (I am matching the reset boot jump addresses in the .hex file with the AS< code address in the .lst file), and this shows clearly the second jump address is not to the start of main().
I have used this compiler before with 18F45K22 chips to create a few simple projects without any problem.
My problems began when I tried to code a programmer routine for the 18F452.
If it is true that the output of the compiler .hex code is an optimized version of the ASM, or is otherwise changed by the compiler, and in this case the .lst (ASM) file would not match the .hex file.
But I donno!
I could easily post small snippets of the .hex file and the .lst file to clarify. Would this help?
What I see when I just run this code in main() with the start:
I have an TMR0 ISR that counts IRQ's to increment a var called Sec++; //correctly each second
This bad result was with the original larger source code.
void main()
{ .....
.....
start:
if(Sec & 1)
{LATB7=1; //connects to a LED to a resistor to VSS.
}
else
{ LATB7=0;
}
goto start;
What happens is the the light blinks on for a short period and then stays off. What's worse is that by simply swapping the positions of small adjacent C-code would create different, but chaotic results. I have all IRQ's in check, because I can see the Interrupt routine repeats at the expected 100uSec.
Here's the surprise: Any code in the interrupt server routine runs correctly, code in main() is chaotic.
It looks to me like a continuous stack overflow problem.
I am now going to try to create a very much minimalist version of the same code to see results I get when I pop the programmed DIP chip into a breadboard..