Pages: [1]   Go Down
Author Topic: AnalogRead  (Read 254 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ...

Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 301
Posts: 26243
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 05, 2013, 12:06:51 pm by AWOL » Logged

"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.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33989
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Shannon Member
****
Karma: 206
Posts: 12076
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 301
Posts: 26243
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From my recollection, it Is 13 cycles (about 104 us), except for the first, which takes 25 cycles.
Logged

"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.

Pages: [1]   Go Up
Jump to: