ATtiny1616 -> Comparator Latch Hack

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My LUT's are all used up and I'm trying to get creative with a latch and the event system.

In the diagram below the comparator is one of the three internals, so there are three pins used; vIn, compOut, evntOut.

Maybe it would work if I could invert the comparator signal though the EVSYS...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You should be able to invert EVOUT using the PINxCTRL register for the IO pin.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I forgot to point out, the comparator output is inverted for the PMOS. I believe you're right it can be inverted again via PINCTRL however looking at the spec the chip doesn't feature open drain outputs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

snoopy33 wrote:
the chip doesn't feature open drain outputs.

 

Well, I don't know exactly why or in what conditions you want the comparator to latch, but you can sometimes emulate open drain using a diode (in this case between the AC input and EVOUT).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah I'm now against it, it means a diode and an additional NMOS. I'll live with servicing the interrupt as fast as the CPU can instead.