Hello, I need to use 8 pins for analog in for the Feather M0, and it says that rx and tx can be used as such, however when I try to use them neither of them gives me that function, do I have to make any configuration in my code to use them as such? Any help is appreciated.
Thanks a lot,
Karla
Do you mean the "Feather M0 Basic"? It looks like it has A0-A5 and A7 pins. None of those are on RX or TX (Pins 0 and 1).
https://learn.adafruit.com/assets/46244
But e.g. this one does
Feather M0 Basic proto
9 analog pins even on that one.
RX is one but TX not!
AIN0 on A0
AIN1 on ARf
AIN2 on A1
AIN3 on A2
AIN4 on A3
AIN5 on A4
AIN10 on A5
AIN19 on RX0
AIN7 on 9
Very logical pin numbering, as we're used to from the Arduino world.
Yes, the chip has nine pins that can be used for analog input, but can all of them be used with analogRead()? The 'variant.h' file for SAMD:arduino_mzero only defines names A0 through A5.
Certainly if you know what you are doing, and know how to directly address the A/D registers, and don't need the Arduino libraries then you can use all nine analog input pins of the processor.
john,
johnwasser:
Yes, the chip has nine pins that can be used for analog input, but can all of them be used with analogRead()? The 'variant.h' file for SAMD:arduino_mzero only defines names A0 through A5.
Certainly if you know what you are doing, and know how to directly address the A/D registers, and don't need the Arduino libraries then you can use all nine analog input pins of the processor.
I read from here : Muxing it up | Using ATSAMD21 SERCOM for more SPI, I2C and Serial ports | Adafruit Learning System
that you can change those pins to use in i2c comunication, can I instead change them to have the analog in funtion? and if so, how can i do taht?
thanks,
karla
KarlaB:
can I instead change them to have the analog in funtion? and if so, how can i do taht?
My guess is that you create your own board 'variant' and edit the corresponding variant.h and variant.cpp files. In variant.cpp it looks like you can put the additional analog pins at the end of the table. They will have high numbers, like 44 and up. Use the existing analog input pins as a template for how you would write the new lines.