Go Down

Topic: AnalogRead (Read 283 times) previous topic - next topic

gargoor

Guys, Anybody can give me a link or details about what does AnalogRead work exactly in low level programming.

what ports, tris , or oscillator . watchdog. such things ...


AWOL

#1
Feb 05, 2013, 06:05 pm Last Edit: Feb 05, 2013, 06:06 pm by AWOL Reason: 1
You have the source.
I'd start there.

It breaks down fairly simply into:
Select input
Start conversion
Wait for code conversion to complete.
Read result.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Grumpy_Mike

Read that in conjunction with the data sheet for the processor and it will answer all your questions.

MarkT

The default Arduino setup  (Uno and Mega) is to set an analog clock of 125kHz, and conversions take about 11 analog clocks,
so just under 100us per conversion.  Interrupts aren't used by analogRead().

All the source code is there for you to look at - open source project :)
[ I won't respond to messages, use the forum please ]

AWOL

From my recollection, it Is 13 cycles (about 104 us), except for the first, which takes 25 cycles.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up