Who can tell me how the A/D converter works
Iám a starter so plaese keep it simple
Printable View
Who can tell me how the A/D converter works
Iám a starter so plaese keep it simple
do a search for ADCIN to start.
Quote:
Originally Posted by JARI NETWORKS
There's a new website that just might be able to help you out.
It's address is:
www.google.com
Quote:
Originally Posted by skimask
WOW, Have you find that by your own
I like all this HELPFULL answers for BEGINNERS
Thank you very much
JARI,
Maybe if you were more specific with your question.
Do you just want to read the analog voltage on a pin?
Are you looking for an explanation about how successive approximation works?
Or, are you trying to figure out why the program you've already written doesn't work?
<br>
I want to know how I can read a analog voltage on a pin, and how to put this in
a program so I can set a other pin high or low.
Iám using pbp v2.44
grtz Jan
You can read that in the manual which came to your version of PBP.
Here then a smal example with no comment. Try to find the comment in the manual.
Code:
@ DEVICE PIC16F877A,XT_OSC
@ DEVICE PIC16F877A,BOD_OFF
@ DEVICE PIC16F877A,LVP_OFF
@ DEVICE PIC16F877A,CPD_OFF
@ DEVICE PIC16F877A,PROTECT_OFF
DEFINE ADC_BITS 8
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
DEFINE OSC 4
ADCON1 = %00000010
TRISA = %11111111
TRISB = %00000000
TRISC = %10000001
LEDPIN VAR PORTB.0
VALUE0 VAR BYTE
CLEAR
START: ADCIN 0,VALUE0
IF VALUE0 > 127 THEN
LEDPIN = 1
ELSE
LEDPIN = 0
ENDIF
GOTO START
END
Quote:
Originally Posted by JARI NETWORKS
How about page 43 of the PBP manual?
Duh....