[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.1504895 [View]
File: 66 KB, 909x467, Screenshot_2018-11-27_05-51-42.png [View same] [iqdb] [saucenao] [google]
1504895

>>1504639
>iiuc, the internal referenced can't be switched onto an input, but it can be switched out to an external pin for decoupling if it is set as the ADC's reference

this is correct; it appears on the AREF pin, which is labeled REF on my nano.

>>1504566
>So i tried it and uploaded a sketch with just analogReference(INTERNAL), but the voltmeter shows 2.5mV so it doesn't seem to be working

per pic-related, using assembly language on a nano (ATmega328P), if I set refs0 and refs1 for AVcc, voltmeter says 4.82 volts (Vcc reads 5.04). if I set them for internal 1.1volts I get 1.17 volts, so it works as it should.

Note that the register that controls this is the ADMUX register which also selects the ADC pin to read, which means that the Arduino code will write to this register when you call analogRead(). It's possible that the Arduino code screws this up, and I don't see any way to use the registers directly unless you go to assembly code.

Note that if you are using an Arduino Mega you use INTERNAL1V1 instead of INTERNAL for analogReference().

Navigation
View posts[+24][+48][+96]