No exact or substring matches. trying for part
PICList
Thread
'[PICLIST] Whats wrong with this?'
2001\02\04@003824
by
Peter May
|
I have got out a 16F877 and started playing with it's analog inputs whilst I
am waiting on an answer to an external ADC like a 548 etc. I have been
looking around for code to study on reading an input as an analog. I came up
with this.
DEFINE ADC_BITS 10 'Its a 10 bit pic
DEFINE ADC_SAMPLEUS 50 'Sample time
TRISA = 255 'Sets all port a to input
A0 VAR WORD
High PORTB.7
Pause 500
ADCON1 = 2
Loop:
ADCIN 0,A0
SerOut PORTB.6,4,["start",#A0,"stop"]
Toggle PORTB.7
Pause 50
GoTo loop
I have an output of a 535 hooked up to A0. My question? Is there anything
wrong with the above method? Will it be accurate? I have seen another method
using binary to set up conditions etc like clock rate etc etc . Why should I
do it different etc.
All comments welcome.
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuT
mitvma.mit.edu with SET PICList DIGEST in the body
More... (looser matching)
- Last day of these posts
- In 2001
, 2002 only
- Today
- New search...