Good evening!
I got to wonder how people do this? the led's have pretty tight timings and interrupts kinda screw it over.
i was thinking something like this:
- PC sends byte (kinda like message that there is data waiting)
- AVR retrieves the byte when it can, ie. after the led driving routine when interrupts get re-enabled.
- AVR sends byte which indicates its ready to receive.
- Now PC sends the information
What i was wondering with this, is that does the UDR register get "flushed" or something when interrupts are re-enabled?
Or does the USART_RX interrupt actually fire after re-enabling interrupts if theres data in UDR?
If someone have other ideas, better or worse i'm happy to hear about these, maybe it will bring completely new ideas to implement this in my head.