Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analogReference(EXTERNAL) #36

Closed
czghzc opened this issue Apr 5, 2017 · 3 comments
Closed

analogReference(EXTERNAL) #36

czghzc opened this issue Apr 5, 2017 · 3 comments

Comments

@czghzc
Copy link

czghzc commented Apr 5, 2017

analogReference(EXTERNAL);

However, the "EXTERNAL" is not what we understand the external reference voltage, but AVCC.
My circuit uses an external reference voltage, and it is so set, but I found that my reference voltage is wrong, but I can not find my circuit and components have any problems, this problem plagued me a long time, and finally found The result of this setting is to connect the AVCC to the VREF Pin, so there will be such a problem.

image

Also, the reference voltage on the Mega128 DataSheet is set such that the REFS register is set to "11" to be the internal reference, but it is "10" in your file, but it also seems to work properly.

I recommend:
     DEFAULT -> AVCC
     INTERNAL -> Internal 2.56V Voltage Reference
     EXTERNAL -> True external connection for reference voltage
Do you see if this is feasible?

@MCUdude
Copy link
Owner

MCUdude commented Apr 5, 2017

You're absolutely correct, I can see now that I messed up this in one of the recent commits. You can find these defs in the Arduino.h file. BTW, should be fixed now. Please report back if it's still not working properly.

@czghzc
Copy link
Author

czghzc commented Apr 5, 2017

Oh, yes, now it's all right, thank you!

@MCUdude
Copy link
Owner

MCUdude commented Apr 5, 2017

Great, thanks for reporting!

@MCUdude MCUdude closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants