Two general questions - Arduino device/library compatibility - IO PIN Callouts?

Hello
My first question is about Arduino device/library compatibility.

I think its pretty well acknowledged - that one of the things that makes Arduino so popular - is the libraries.
One does not have to build from scratch - a way to control an OLED or 7-Segment display because Libraries have already been developed. And these libraries do the heavy lifting.

I suspect however - that when the developer is considering creating a new library - they first must consider which Arduino devices will be their primary targets for that library.

I suspect the UNO (with its Atmeg328P) is probably at the top of the list. And all other Atmeg328P derivatives - such as the NANO, may be incorporated into that libraries' development. This means the developer will want to maximize a libraries' compatibility with the currently most popular devices.

So then we start to see other devices - such as the Seeeduino, the Trinket, the Beetle, the Pico, and some ATTINY.
These devices are perhaps classified as "Adruino Compatible" because they are not necessarily 100% compatible with any given library.

So my first question is:
How does the Arduino advocate who is interested in dabbling with the less popular devices - ascertain the degree to which a device is library compatible?

My second question is about IO PIN call-outs on devices.
On some devices - there are PIN call-outs for I2C usage= for example.
But it seems to me that there is nothing about the internal hardware that makes those PINS IC2 specific. I suspect the reason certain IO PINS are called out for certain functions such as I2C - is because the developer of a very popular library simply chose those two PINS. To what degree is that true?

"Adruino Compatible"

Generally means - compatable with the IDE, either directly or with a board plugin.

How does the Arduino advocate who is interested in dabbling with the less popular devices - ascertain the degree to which a device is library compatible?

Look at the source - if it uses chip registers, check the chip datasheet for the device you have.

On some devices - there are PIN call-outs for I2C usage= for example.
But it seems to me that there is nothing about the internal hardware that makes those PINS IC2 specific. I suspect the reason certain IO PINS are called out for certain functions such as I2C - is because the developer of a very popular library simply chose those two PINS. To what degree is that true?

Generally - there are specific pins set in hardware to ne that type of interface. There are boards/chips where you CAN set different pins for specific uses.

But it seems to me that there is nothing about the internal hardware that makes those PINS IC2 specific.

Not correct. On many processors, the hardware gives you no choice about such pins. Always check the processor data sheet.

jremington:
Not correct. On many processors, the hardware gives you no choice about such pins. Always check the processor data sheet.

Thank you!

quote:
Look at the source - if it uses chip registers, check the chip datasheet for the device you have.

Thanks!
When you say "source" are you referring to the library .h file?
And in such case - look in that file to see if there are call-outs to registers that are specific to the MCU?

A library can be implemented for multiple controllers, with automatic selection and/or user settable options. E.g. the IRremote library has its default timer/counter number for each controller, in case of a Mega the user can select one of three timers. The library includes code for all supported controllers and timers so that changing the controller during evolution of a project does not require any changes to the user code.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.