AnalogComparator for Arduino Zero

Hello,
As the Arduino zero is ARM, do you know if there is a library available (something like this) to control the internal analog comparator ?

Thank you

Jonathan

Well, ask the question in the Arduino Zero section of the forum.
Any mod willing to move it?
I am not familiar with the SAMD21.

Any mod willing to move it?

Yes.

However, the only way we can know is if someone tells us. It may seem like we are omnipresent but we actually do not have time to inspect every post.

I forgot about the "Report to moderator" button. :-[

That's all right. I forgot to mention... thread moved.

Hi @cochon,

There are no libraries like that for the SAMD21 (as far as I know at least, happy to be contradicted :)).

The AC device on the SAMD21 looks pretty simple to use (it's "just" about 10 pages of datasheet to cover the device functionality) but looks like no one yet tried to write a library for it.

Hi,

Well I don't know I would call it pretty simple because it is not like the ADC and DAC where a lot is set up for you already by the Arduino code. Anyway, I humbly offer the attached sketch to implement two simple analogue comparators.

This code compares the levels on the inputs with the reference values set on the corresponding VDANNA scalers. If the input level rises above the reference level it triggers an interrupt. There is also a readAC function that shows the output of the comparators.

Using this sketch as a basis it should be easy to implement all the possible functions of the flexible comparators.

Harry J. Whitlow

AC.ino (4.84 KB)