Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - problem while using analog input on arduino with version C5.4.0.4

(you are viewing a thread; or go back to list of threads)

problem while using analog input on arduino with version C5.4.0.4 (by Moez )
Hi all
I have a problem when I use the analog input of the arduino nano card. the result of the conversion is a fixed value whatever the voltage applied to the input (the version used is c5.4.0.4). using the c2.2 version I have no problem. the new version has two parameters for the analog input destination and REFS. what should we put in REFS (the default value is 0)?
Thu Jun 11 2020, 00:55:27
(no subject) (by kamuro)
por favor publique si circuito para ayudarlo
Thu Jun 18 2020, 12:24:43
problem while using analog input on arduino with version C5.4.0.4 (by DanielH)
@Moez

From ATmega 328P datasheet:

Voltage Reference Selections for ADC ADMUX register (0x7C) REFS1 REFS0 (2 bits)

0 0 - AREF, Internal VREF turned off: LDmicro REFS = 0
0 1 - AVCC with external capacitor at AREF pinf: LDmicro REFS = 1
1 0 - RESERVED: LDmicro REFS = 2
1 1 - Internal 1.1V Voltage Reference with external capacitor at AREF pin: LDmicro REFS = 3

If you are using AVCC (5V on Arduino Mega 328P) as reference, you must set REFS = 1.
REFS = 1 is equivalent to analogReference(DEFAULT) on Arduino IDE.

Use a LC network powering AVCC circuit: 10mH inductor (choke) between VCC and AVCC, and a 100 nF capacitor between AVCC and ground, to better cancel noise.

If you are using AREF and an external voltage (0 to 5V) as reference, you must set REFS = 0.
REFS = 0 is equivalent to analogReference(EXTERNAL) on Arduino IDE.

Keep analog signal paths as short as possible. Make sure analog tracks run over the ground plane, and keep them well away from high-speed switching digital tracks.

Best regards,
DanielH
Sun Jul 5 2020, 21:12:49
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):