-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparator library cannot invert without outputting to a pin. #115
Comments
Whaaat? So this means that if you use the output of the comparator internally, and don't enable the output, the comparator can't invert its own "internal output"? Is this documented somewhere (errata) or did you find it by coincidence? |
No no, the hardware supports it, but your library doesn't - the invert bit is controlled by the output field, and there's no option for invert without enabling output....
|
Ah, I see! I'll come up with a solution for this. Another thing I just realized was lacking was a way to read the state of the comparator without reading the physical output pin or triggering off an interrupt. Comparator.read(); // Read output of comparator, internally How about re-doing the output_t enum to something like this? enum output_t : uint8_t {
disable = 0x00,
disable_invert = 0x80,
enable = 0x40,
enable_invert = 0xC0,
invert = 0xC0,
}; BTW It would be nice to have a Zoom meeting with you soon! Perhaps to figure out if there are other libraries that need to be ported or created, further cooperation between cores, hardware/UPDI programmers, etc. Let me know if you have time sometime! |
Oh yeah, we should do that soon, I think that's a good idea. I'm still operating on pandemic schedule, so can make almost any time as long as I don't need to leave the house. And my sleep schedule.... basically isn't a schedule. Oh - definitely check on the boards you m,aintain comparator for whether you even need to set the pin output.. On Dx and tiny, you do not! |
I'm usually available in the evenings. I know this might be a little too short of a notice, but how about today/tonight, 10pm my time, 4pm your time? |
Yeah, that works for me., I would like to catch you up on some of what I'd been working on (and be called out if what I'm doing is foolish :-P ) |
Excellent, mail me a Zoom link, and I'll see you in ~2.5 hours! I'll write down a few things we'll have to discuss |
While porting the comparator library I realized that the invert bit in the mux register is controlled by the output setting! This means that the library cannot be used to produce and event with inverted output unless the output pin is also used. Is there a reason for this seemingly arbitrary limitation? I would think that the invert bit should be controlled by it's own boolean property - and that any inverting specified by the output setting would be implemented separately from inverting the event (by setting INVEN on the corresponding PINnCTRL register (which IMO would be excessive for this library)
The text was updated successfully, but these errors were encountered: