-
-
Notifications
You must be signed in to change notification settings - Fork 730
Adds additional analog inputs: A6-A11 #267
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
Conversation
A6 ~ D0 A7 ~ D1 A8 ~ D3 A9 ~ D4 A10 ~ D8 A11~ D9
A6 ~ D0 A7 ~ D1 A8 ~ D3 A9 ~ D4 A10 ~ D8 A11 ~ D9
Of those pins only PA06 and PA07 are referenced to analog ground and intended to be used as analog inputs. |
changed pin definition for new A6-A11
better analogInputToDigitalPin(p) conditions
@mitchellpontague why only PA06 and PA07? Source of this statement? |
From the datasheet on page 27 lists which pins are intended to be analog. Page 33 shows the voltage sources for each pin. However the only difference between the analog and io voltages is extra filtering. |
|
@Adminius important patch, I hope this gets merged soon. Regards Helmut The lines would be (at end, relaces 43, 44, 45 are new): |
i would say extra patch. |
I will do an extra patch, thank you for your advise. I still need to figure out who to check if a debugger is connect before using the pins. On STM there is a Debugger Interface active check available via (CoreDebug->DHCSR & 1) On the SAMD/D21 I need need to figure out where the find the DHCSR address. |
#define PIN_A8 (46ul) | ||
#define PIN_A9 (47ul) | ||
#define PIN_A10 (48ul) | ||
#define PIN_A11 (49ul) | ||
#define PIN_DAC0 (14ul) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These additional new analog pins will break the logic in: https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/wiring_analog.c#L132-L134
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic is for using analogRead function with 0-5 instead of A0-A5...
so that means:
if (pin < A0) {
pin += A0;
}else if(pin > 5 && pin <= 11){
pin += 38;
}
@sandeepmistry is it ok for you?
update to last core version
this PR is outdated. new: #374 |
Adafruit Feather M4 CAN: Add support for board
A6 ~ D0
A7 ~ D1
A8 ~ D3
A9 ~ D4
A10 ~ D8
A11 ~ D9