PIC16F877 ADC EXAMPLES assembly

Status
Not open for further replies.
STUDY ABOUT THE FOUR REGISTERS RELATED TO ADC;
1> ADCON0
2>ADCON1
3>ADRESH
4>ADRESL


make sure to give the required delay before reading adc(capacitor charge time ) and what you are reading(if it is from battery one read will do the work else you have to read more and take the average of that
 

STUDY ABOUT THE FOUR REGISTERS RELATED TO ADC;
1> ADCON0
2>ADCON1
3>ADRESH
4>ADRESL
This is available in data sheet..



Then using a C compiler 'like HIGH TECH C' try 2 write a program...
I am sure u could do it....


yes thanks.. i've read it in the data sheet and somehow i understand the functions and operations. but im required in my project to use MPLAB-IDE and assembly code programming.
 

Hi,
Using assembly, it's not a problem. If you know assembly, just follow the process of setting ADCON0 and ADCON1 as required meeting suitable timing requirements, and then read from ADRESH and ADRESL. Now the catch is if you can use assembly or not. If you can, then go ahead and start coding, we'll help when you get stuck. If you can't time to grab hold of some tutorials or more preferably a book to understand all the instructions. If you've used assembly somewhere earlier, you might be able to get hold of it directly from the datasheet, otherwise you need some more help.

Hope this helps.
Tahmid.
 
do anyone have a code for soureboost IDE
 

Re: pic adc sample code



sir, i would just like to ask, how can i do it that the output has 2 or 3 decimal places?
 
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…