Detecting a stop condition with USI in an AV

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was reading through old posts about this issue and there didn't seem to be a solution, I think I found one.

I enabled the Pin Change Interrupt for PB5 (the SDA line) and in the service routine I test for the stop bit. I only enable the interrupt when the software is set up to receive data to minimize unnecessary interrupts. Since the test is a simple one it keeps the time spent responding to the interrupt to a minimum (It has to be better than polling).

I've tested it a little and it works so far. I've tested it at 10KBPS, 100KBPS and 400KBPS.