I apologize in advance if I'm being an idiot, but would someone please put me out of my misery and tell me how to watch a variable while debugging in MPLAB?
All I'm trying to do is watch the value of an integer variable which should be changing as I change the voltage applied to a pin. I've copied part of the code in below incase it's relavent to my question (I want to know the value of "result"):
I am using a PIC18F2550 with a PICKit2, the MPLAB IDE and MPLAB C18 Lite compiler.
All I'm trying to do is watch the value of an integer variable which should be changing as I change the voltage applied to a pin. I've copied part of the code in below incase it's relavent to my question (I want to know the value of "result"):
Code:
while(1)
{
OpenADC(ADC_FOSC_32 &
ADC_RIGHT_JUST &
ADC_12_TAD,
ADC_CH0 &
ADC_INT_OFF &
ADC_REF_VDD_VSS, ADC_1ANA);
ConvertADC(); // Start conversion
while( BusyADC() ); // Wait for completion
result = ReadADC(); // Read result
CloseADC(); // Disable A/D converter
if(result>50)
{
LEDPin = 1;
}
else
{
LEDPin = 0;
}
}
I am using a PIC18F2550 with a PICKit2, the MPLAB IDE and MPLAB C18 Lite compiler.
Last edited: