superbrew
Member
Hello again, I have strange problem. My PIC shuts down when I try to run certain sections of my code. Here is the code:
If I run the code without the max reading included the PIC shuts down after a few seconds. I know this because I am using RB3 to switch on the LCD, and it shuts off after a few seconds. The code runs fine without the second reading1 function call. I left it on overnight without any trouble.
Code:
SetChanADC( ADC_CH0 );
ConvertADC(); //ADC conversion
while( BusyADC() );
result = ReadADC();
if(result > max) max = result;
itoa(result,output); //Convert ADC result to string
reading1(output, 5);
//This is the section that causes problems
itoa(max,output); //Converts max to string
reading1(output, 14);
If I run the code without the max reading included the PIC shuts down after a few seconds. I know this because I am using RB3 to switch on the LCD, and it shuts off after a few seconds. The code runs fine without the second reading1 function call. I left it on overnight without any trouble.