Endian Issue with LCD Frame Buffer in SDRAM

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by twomeyw22 on Thu Apr 17 14:38:39 MST 2014
Hi All,

I'm using an LPC1788 with a TFT LCD and 16 bit SDRAM for the frame buffer, with color data in 5-6-5 format.  Everything is working except my colors are all messed up because of an endian issue.

Green, for example, should be 0x7E0, but to display green I actually need to write 0xE007.

The LCD Control register (CTRL, address   0x2008 8018) has a bit for setting endianness (BEBO) but this has no effect.  The SDRAM has a similar configuration bit this also has no effect.

Does anyone else have any other ideas?

Worst case is I write a script to swap bytes in all my image bitmap arrays but that seems like a hack.  There must be some way to correct this in the microcontroller configuration...