Hello, this is my first post, I hope this is the appropriate place in the forum to post my questions.
I am working on a cosmic ray detector and need access to the Arduino DUE counters, I also have an UNO that I use in the same project and some Rasperry Pies.
I had some surprises with the IDE working with both boards at the same time, but have now solved the problem by launching two instances of the IDE.
I have found the DueTimer library and it looks like it is not upto the task I have in mind, but it did serve as a useful example in understanding how to use the timers.
While reading the DueTimer C++ code I came across a number of system calls like NVIC_ClearPendingIRQ, pmc_enable_periph_clk and other system calls, its obvious what these calls do, but how did the author know about them ? I have looked around and there seems to be nearly no logic in how the system is layed out ! For example I greped around to discovered the Timer definitions in the directory
“arduino-nightly/hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/DRIVERS/TC”
Why is it in the wifi section and nowhere else ?
Worse still how does the IDE organize the hardware definitions by board type ?
So as a beginner can some one point me to a place where I can access the complete set of Arduino DUE hardware libraries and drivers. With this I can write or extend the DueTimer library to cover my use case and feed it back to the community.
Apologies for asking such a dumb question, but I am sure I am missing something obvious.
You may start from Atmel's ASF:
http://asf.atmel.com/docs/3.5.1/sam.drivers.tc.tc_capture_waveform_example.sam4l_ek/html/tc__capture__waveform__example_8c_source.html
There is no strict logic in calling many internal registers, IMHO, because it's all hardware related, you better "copy-paste" manufacturer's examples, and may be later, do some experiments if you need custom optimization.
Even for same Cortex-3 uCPU , there is always 'd be some variation between Atmel and MicroChip, or NXP
So as a beginner can some one point me to a place where I can access the complete set of Arduino DUE hardware libraries and drivers.
There is no such data base.
To find about the timers then look at the processor's data sheet available from Atmel. It is a bit heavy going but that is the prime source of information.
I have found the DueTimer library and it looks like it is not upto the task I have in mind,
Which is?
Finally I did find just about all I need at ...
http://asf.atmel.com/docs/latest/api.html
Thanks a lot for your help. I would still like to know how the IDE manages to compile for different boards and CPU architectures. It does not look the same way that Linux does it, through a set of cleverly arranged #ifdefs statements. If that were true I should be able to see the tree in the IDE distro, but I dont see it when I grep for ifdef from the top of the distro. So there is still a huge amount of stuff I am not able to find from the sources, and I just dont see yet how the stuff defined in the above link actually gets used at compile time. Help would be much appreciated.