Author Topic: Reading display memory  (Read 1865 times)

durian

  • 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?

Thanks,
mike



Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • 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.

durian

  • 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.

mike

 

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

Started by SteveCBoard Character LCDs

Replies: 3
Views: 4563
Last post May 13, 2014, 12:04:36 AM
by SteveC
NHD‐C12864A1Z‐FSW‐FBW‐HTT display clears after draw

Started by EdAverillBoard Graphic LCDs

Replies: 6
Views: 5696
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: 3400
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: 8809
Last post July 10, 2014, 08:46:06 AM
by Michael_L
NHD-0420DZW-AG5 - Display "sometimes" shows only 2 lines

Started by stylonurusBoard OLEDs

Replies: 5
Views: 5571
Last post June 18, 2014, 10:09:49 AM
by Michael_L