Hi all,
I have written a program for the PIC16f84 in assembly. It basicly increases a number by one everytime an input pin is pull low and display this number.
It also scales this number to increase by 0.2 or 0.5 each count (depending on mode set by user)and displays this also.
Before it displays this, the user is prompted with a title screen and can select the scaling mode, either 0.2 or 0.5.
My problem is that my program halts roughly after the title screen if I add more instructions...it does not seem to matter what they are or where they are, it even happens when using 'NOP'. Without more instuctions my code works perfectly but I need to add more to finish other ideas I had for this program. Depending on how many more instructions I add determines how far the program will run untill it resets in hardware or crashes when simulating on PC.
My list file tells me that I have approx 70% of program memory left...
I am not using interrupts, it is all event driven.
I have made sure I return from all my subroutines and that there is never 8 nested ones. Made sure that I am in the correct bank as best as I could although MPLAB whines about this on 4 lines of my code, I expect this is because I'm addressing a register over 0x7F.
I have been through my code many many times and cannot find the problem.
Has anyone come across this issue before? Any ideas on what could cause this?
I can post my code if anyone is interested and willing to help me.
Thanks
Link to my code because it was too long to add here.
https://www.savefile.com/files/1762174
This code works but if i remove the comments from the instuctions commented-out under the 'MM_SCALE' subroutine (happens if added anywhere) it stops working and I get the problem described above.