Library interdependency

Hi;

Still being somewhat new to the Arduino platform I have a question/suggestion. Many new comers seem to have problems or questions about the ability to utilize multiple library functions. There seems to be conflicts sometimes with some functions requiring resources (timers, etc.) that other functions are also using. Would it be useful or hard to develop a matrix type document showing where possible conflicts would come up with using different library functions in the same sketch? It would probably be too much to define all user contributed libraries but certainly would be nice if it included the built in and 'official' external library functions.

Thanks
Lefty

Good point.
Sounds like a job for someone that recognizes the value of good documentation and new enough to the arduino to have a need to look through the available source code to figure out and document what resources are used.

Lefty, did I see your hand go up to volunteer? :wink:

I would certainly be willing to help, possibly proof reading or verifying things. However I am still learning C at a pretty slow rate and not sure I could lead such an effort. Now any hardware type documentation project would be a different story :wink:

I kind of 'hate' software, it's just a speed bump in my road to completing projects. ;D

Lefty

In a few months time you may find that compared to software, it's the hardware that has the speed bumps. :wink: Its amazing how fast something can be built in software once you get over the initial learning curve.

Have fun!

Has any work been done on documenting the library interdependency?

I was searching for the basic information of hardware resources used by the official ardunio library and stumbled upon this thread. Am I out of luck?

brijesh

Hi brijesh, I think its still waiting for volunteers to gather the information and write it up. Are you up for making a start on this? Perhaps you could suggest a format that you think would be useful and include information in the libraries you are interested in to get things started.

mm..I will need this information as I work on my project. I might as well document it. I will update as soon as I get something going.

As for the format I was thinking of listing all hardware devices in a row. Each library would then mark resources used. An example would be more clear I guess.

Library Timer 1 Timer 2
Delay() Yes No

In the above example Delay() funtion/library uses Timer1 and does not use Timer2.

Above table is just an example, don't know if delay() function uses Timer1 for sure.

I think I will just take the excel file from the Atmel website which they use to list the devices in parametric list.

Any other ideas are always welcome.

That would be great. You also might want to capture I/O pin numbers as a resource used by certain library functions.

Here are the things I think useful –
lists of:

  • pin usage (digital and analog pin numbers including PWM)
  • all timers and interrupts used.
  • any dependencies on other Arduino libraries.
  • any access to low level registers (registers used for direct port i/o or other hardware functions)
  • access to (undocumented) Arduino low level variables (for example timer0_millis )

Not sure if listing calls to standard Arduino functions like delay would be useful. Delay and millis do use timer0, but the timer0 resources are used irrespective of whether calls are made to these functions.

I finally managed to collect and publish some information. It took far more time to just format and publish the information than to collect it from C code.

I am having trouble in formating the information such that it can encompass all the various things. For now I have been able to put default hardware setup and usage by the Arduino language. I will add the standard libraries next.

Any comments, suggestions and corrections are always welcome.

Nice start! :slight_smile: Has potential to be a useful reference. Have you considered maintaining on the playground wiki?

Thanks for your contribution...

--Phil.

Yes I do want to put it up on Playground Wiki. I realized that playground was user generated content after I had finished putting up that page.