We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear friends,
I am trying to use double buffering feature of LCD controller in LPC1788. In order to do that, one must use LNBU interrupt and use it to update the UPBASE register.
quoted from datasheet: "The LCD_UPBASE register is the color LCD upper panel DMA base address register, and is used to program the base address of the frame buffer for the upper panel. LCDUPBase (and LCDLPBase for dual panels) must be initialized before enabling the LCD controller. The base address must be doubleword aligned. Optionally, the value may be changed mid-frame to create double-buffered video displays. These registers are copied to the corresponding current registers at each LCD vertical synchronization. This event causes the LNBU bit and an optional interrupt to be generated. The interrupt can be used to reprogram the base address when generating double-buffered video."
I cannot understand the part that is made bold. If anyone has done double buffering on LPC1788's LCD controller, please share your experiences with me.
Best regards
In short.
When the LCD starts showing a new frame, it reads out the address of the frame. Then it generates an interrupt requesting "please update the register while this frame is being shown". Then your program switches address in the register - you have a full frame time to react to the interrupt and update the register. When the frame ends, the controller once more reads out the address from the register, and issues a new interrupt.
So the value in the register isn't the value that is being used - it's the value that will be used the next time the controller will switch to a new frame.
This is standard behavior for dual-buffer operation - you have a full frame time to prepare image + settings. Then the controller starts working on the data and you get a new frame time to prepare the next frame - if the code is fast enough to build a full frame buffer of data and switch the register during the frame time, then the controller can show animations with no tearing.