0

I have a program that draws a section of ram to the screen and a program that manipulates the section of ram

Would it be a better idea to either

  1. Draw the screen after the program is done manipulating data then draw the data.
  2. Create an interrupt to draw the data at a regular interval.

I am using a monochrome lcd screen

Nathaniel Smith
  • 106
  • 1
  • 9
  • 3
    This isn't something we can know because it depends on too much on your end. How often does the data change? What interface is used to the display? How often do you need it to update? – Thomas Jager Oct 21 '19 at 17:36
  • 1
    How long does it take for the program to manipulate the data? Does it make sense to have partially manipulated data shown on the LCD? – user3386109 Oct 21 '19 at 17:37
  • the program either manipulates the data or draws it to the screen, i was thinking sometimes it does more and sometimes less so if i based it on the program the frame rate could change, first time doing something like this i dont know how noticeable it would be for you to see partially manipulated data or how noticeable frame rate changes would be if they happened – Nathaniel Smith Oct 21 '19 at 18:24
  • 1
    Most LCDs have a non-trivial refresh time and command setup time requirements. Draw too often and nothing might happen. Draw too often and you might see a garbled mess. You need the LCD datasheet and some experimentation to determine the right time/rate to refresh. – TomServo Oct 21 '19 at 18:40
  • so i should experiment with using the interrupt and refreshing at different rates? – Nathaniel Smith Oct 21 '19 at 20:11
  • Consider double-buffering, or something *like* that, to draw a consistent screen update with rate limiting to some minimum interval since the last redraw. As far as actually calculating pixels from your data structure (into an offscreen area of video RAM), you could be eager or lazy depending on required latency when you *do* need to draw, vs. minimizing power consumption. – Peter Cordes Oct 21 '19 at 21:05
  • Which computer are you programming for? – puppydrum64 Feb 01 '23 at 16:01

0 Answers0