Loading...
Pages: [1]   Go Down
Author Topic: AnalogRead  (Read 99 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
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
Online Online
Brattain Member
*****
Karma: 144
Posts: 19380
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.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 299
Posts: 26031
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
Tesla Member
***
Karma: 76
Posts: 6852
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

Global Moderator
UK
Online Online
Brattain Member
*****
Karma: 144
Posts: 19380
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.

Pages: [1]   Go Up
Print
 
Jump to: