I've been cracking my head for hours, and I couldn't come up with a solution.
PIC I am using is PIC16F877A
Alright, I'm supposed to receive a value from the ADC and convert it to its appropriate value and output it to an LCD.
Attached is the code I did... but the problem is the values that come out are garbage and after that, I am getting "Hardware Stack Overflow". I tested it using PIC Simulator IDE.
Could someone help me debug the code?
Based on the Source Code, this is how I output the value:
And then the code goes back to the beginning to check for the ADC value again, and outputs a newer value when changed.
I know the code is long, but I sincerely hope you guys can help me out.
PIC I am using is PIC16F877A
Alright, I'm supposed to receive a value from the ADC and convert it to its appropriate value and output it to an LCD.
Attached is the code I did... but the problem is the values that come out are garbage and after that, I am getting "Hardware Stack Overflow". I tested it using PIC Simulator IDE.
Could someone help me debug the code?
Based on the Source Code, this is how I output the value:
- Add whatever value in the memory labelled First with b'00110000' in order to get the appropriate value.
- After that, I send out a '.', a dot signifying the next two values being decimal places.
- Then, I add whatever value in the memory labelled Second with b'00110000' in order to get the appropriate value.
- After that, I add whatever value in the memory labelled Third with b'00110000' in order to get the appropriate value.
And then the code goes back to the beginning to check for the ADC value again, and outputs a newer value when changed.
I know the code is long, but I sincerely hope you guys can help me out.
Attachments
Last edited: