Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't think it's a defect, most likely I misunderstand how this peripheral is supposed to work...
I have attiny212 running at 3.5V Vdd / 4Mhz with core 2.5.6. I have a voltage divider (0.36) on pin PA7 that gives me 1.26V (0.36*3.5).
I set up the comparator like in the example:
checkSwitch() just sets a flag and stops the comparator:
In the main loop I just wait for the flag to come up true and turn on a LED if it does. Now I'd expect that dacref of around 128 (1/2 of comparator reference 2v5) would be the value where comparator output changes between high and low. But that's not even close! Dacref needs to be around 213.
Similarly, if I just pull the pin to the ground, the dacref value needs to be around 86 for the analog comparator to trigger.
Beta Was this translation helpful? Give feedback.
All reactions