Author Topic: Reading display memory  (Read 3396 times)


  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Reading display memory
« on: August 06, 2015, 06:15:25 PM »
I've been using an NHD-2.4-240320SF-CTXI-1 in a product for a few years now. I can write to the display using a 16-bit parallel bus without any problem. The display shows what it should. However, I've never been able to read the memory correctly. This hasn't been critical for us, but I decided to dig into it a bit today.

It appears when I write 16-bits, I read the data back in a 24-bit format. For example, if I write:
0001 fffe
I read back:
0000 08fc fcf4

It looks like RGB 565 packing:
Write (binary):
rrrrrggggggbbbbb rrrrrggggggbbbbb
Read (binary):
rrrrrXXXggggggXX bbbbbXXXrrrrrXXX ggggggXXbbbbbXXX

The X's are typically 0, but not always. Sometimes the highest order X bit in the R and B values is a 1. I'm not sure what the pattern is.

Does anyone have any ideas why I'm getting this asymmetric  read/write behavior?



  • Administrator
  • Hero Member
  • *****
  • Posts: 357
  • Karma: 34
    • View Profile
Re: Reading display memory
« Reply #1 on: August 07, 2015, 11:29:28 AM »
I believe for this display the way the pixel data is stored in the controller's RAM will be 24bpp format, regardless of the format that is chosen for the writes.  Changing the color depth to 16bpp reduces the amount of time it takes to write an image to the display, which is its primary benefit.  However, the data is still arranged in the RAM as 24-bit, so when reading from the RAM this should be taken into consideration.


  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Reading display memory
« Reply #2 on: August 07, 2015, 11:41:09 AM »
Thanks. It's nice to know I'm not crazy.

I've been over the ILI9340 manual from your site a few times, but I can't find anything that would suggest this sort of behavior is possible. Can you point me to some documentation that shows how the 16-bit input data is expanded to 24-bits before being stored in memory? Maybe there is a similar setting that will instruct the controller to squeeze the pixel data back down to 16-bits when read.



Blank Display on NHD‐C0220BiZ‐FS(RGB)‐FBW‐3VM

Started by SteveCBoard Character LCDs

Replies: 3
Views: 9738
Last post May 13, 2014, 12:04:36 AM
by SteveC
Display NHD-4.3-480272EF-ASXN#-T and NHD-4.3-480272EF-ASXN#-T revA

Started by rvalorBoard TFTs

Replies: 0
Views: 0
Last post Today at 06:33:38 AM
by rvalor
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 6
Views: 11721
Last post November 07, 2014, 08:25:20 AM
by Michael_L
NHD‐4.3‐480272EF‐ATXL#‐CTP | FAN5333 | BBB | Nothing on the Display

Started by Alias_AliasBoard TFTs

Replies: 1
Views: 8492
Last post September 25, 2015, 03:09:24 PM
by Paul_B
Arduino LCD library not working with newhaven display NHD‐0420H1Z‐FL‐GWB-3V3

Started by c2hollowBoard Character LCDs

Replies: 9
Views: 18145
Last post July 10, 2014, 08:46:06 AM
by Michael_L