Deexith Hasan
Advanced Member level 4
![Full Member level 1](/styles/images/ranks/elevel1.gif)
does ADRESH register of ADC in PIC18F4520 MCU has hex value or decimal value?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
//*******************************************************************************
// convert a binary value to it's equivalent ascii hex character
unsigned char BinToAsc(unsigned char BinValue)
{
BinValue &= 0x0F;
if(BinValue > 9) BinValue += 7;
return(BinValue + '0');
}
Value = ADRESH;
Temp = Value / 100;
SendToSerial(Temp + '0'); // send hundreds
Value -= (Temp * 100);
Temp = Value / 10;
SendToSerial(Temp + '0'); // send tens
Value -= (Temp * 10);
SendToSerial(Value + '0');