In projects I've done which involve updating a character LCD with a microcontroller, I've usually rewritten the entire display even if only a single character has required updating. That is, on a 16 character LCD, I would update every character in turn (waiting 40us between each character) for a total delay of over 640us. In a sense, I've been treating the LCD as a blocking output device. My software does absolutely nothing for that 640us except wait and update the LCD. This method certainly works, but it's fairly wasteful. I'm at the point now where I want to do "other things" during that 640us period.
I'm sure others have dealt with this exact situation. Here's the solution I've come up with and was wondering if it could be improved upon. If the microcontroller platform is of interest, I've mostly been using the PIC18F series.
My plan is to keep a 16 character buffer, containing the data I wish to display on the LCD, in memory. Additionally, I plan to keep a set of 16 flags -- each flag associated with one character in the buffer. In order to update the LCD I first write my output to the buffer and set the flag associated with each character which has changed and thus needs to be updated on the LCD display.
Concurrently, I'll use one of the timers to schedule interrupts every 40us (or likely much longer). When the interrupt is called, it will check each flag in turn until it finds one which is set (signifying a byte which needs to be updated on the LCD) or it determines that all flags have been cleared (no updates are required). If the interrupt finds a set flag, it will update the corresponding character on the LCD, unset the flag, clean up the interrupt control bit/s, reset the timer, and exit. If all flags are cleared (no updated are necessary) the interrupt handler will simply clean up the interrupt control bit/s, reset the timer and exit. Each interrupt will update, at most, a single character. The interrupt will then exit so the micro is free to do "other things".
Does this seem like a reasonable approach to update the character LCD or is there an alternate method I should consider?