PDA

View Full Version : Pic16f877a



JARI NETWORKS
- 10th December 2006, 17:09
Who can tell me how the A/D converter works

Iám a starter so plaese keep it simple

mister_e
- 10th December 2006, 17:23
do a search for ADCIN to start.

skimask
- 10th December 2006, 21:07
Who can tell me how the A/D converter works

Iám a starter so plaese keep it simple



There's a new website that just might be able to help you out.
It's address is:
www.google.com

JARI NETWORKS
- 10th December 2006, 21:29
There's a new website that just might be able to help you out.
It's address is:
www.google.com


WOW, Have you find that by your own

JARI NETWORKS
- 10th December 2006, 21:45
I like all this HELPFULL answers for BEGINNERS

Thank you very much

Darrel Taylor
- 10th December 2006, 22:22
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>

JARI NETWORKS
- 16th December 2006, 08:07
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

mat janssen
- 16th December 2006, 08:51
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.



@ 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

skimask
- 16th December 2006, 19:30
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



How about page 43 of the PBP manual?
Duh....