I'm having a strange issue....
- I'm running a DUE & IDE 1.52
- 7" 32 pin TFT touch screen display
- CTE shield
- Standard UTFT library (latest version)
What happens?
The main issues is that the entire display is horizontally reversed. (OR I have the screen upside down and it is vertically reversed)
(the 2nd issue is that all the demos in the demo loop from start through to the sin wave fail display strange blocks of colour but this is a lesser issue by far.)
It appears to be something to do with the initialisation of the display and this was confirmed by UTFT's writer who I emailed.
I've downloaded the datasheet for the SSD1963 http://www.techtoys.com.hk/Components/SSD1963QL9/SSD1963_1.1.pdf
I'm not yet sure what it is but I'm thinking that it might have something to do with the frame buffer settings re "set_address_mode command 0x36"
This is the relevant section:
In the library this is the relevant section of code:
The standard setting is 0x03 or 0x22 ??
Now looking at the data sheet I should be setting (as far as I can see)
bit 5=0 (horizontal)
bit 6=0
bit 7=1
This is based on being the horizontal opposite of 0x03 BUT it doesn't work and remains the same. I was convinced that making the changes wasn't working and it was reading from somewhere else but I "//"d the 'screen on' command and the screen stayed off so it is the right file and SHOULD be working.....
I've tried commenting the two lines out completely but it isn't doing anything whatsoever!!!
case SSD1963_800_3:
LCD_Write_COM(0xE2); //PLL multiplier, set PLL clock to 120M
LCD_Write_DATA(0x23); //N=0x36 for 6.5M, 0x23 for 10M crystal
LCD_Write_DATA(0x02);
LCD_Write_DATA(0x04);
LCD_Write_COM(0xE0); // PLL enable
LCD_Write_DATA(0x01);
delay(10);
LCD_Write_COM(0xE0);
LCD_Write_DATA(0x03);
delay(10);
LCD_Write_COM(0x01); // software reset
delay(100);
LCD_Write_COM(0xE6); //PLL setting for PCLK, depends on resolution
LCD_Write_DATA(0x04);
LCD_Write_DATA(0x93);
LCD_Write_DATA(0xE0);
LCD_Write_COM(0xB0); //LCD SPECIFICATION
LCD_Write_DATA(0x0000);
LCD_Write_DATA(0x0000);
LCD_Write_DATA((799>>8)&0X00FF); //Set HDP
LCD_Write_DATA(799&0X00FF);
LCD_Write_DATA((479>>8)&0X00FF); //Set VDP
LCD_Write_DATA(479&0X00FF);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0xB4); //HSYNC
LCD_Write_DATA((1000>>8)&0X00FF); //Set HT
LCD_Write_DATA(1000&0X00FF);
LCD_Write_DATA((51>>8)&0X00FF); //Set HPS
LCD_Write_DATA(51&0X00FF);
LCD_Write_DATA(8); //Set HPW
LCD_Write_DATA((3>>8)&0X00FF); //Set HPS
LCD_Write_DATA(3&0X00FF);
LCD_Write_DATA(0x0000);
LCD_Write_COM(0xB6); //VSYNC
LCD_Write_DATA((530>>8)&0X00FF); //Set VT
LCD_Write_DATA(530&0X00FF);
LCD_Write_DATA((24>>8)&0X00FF); //Set VPS
LCD_Write_DATA(24&0X00FF);
LCD_Write_DATA(3); //Set VPW
LCD_Write_DATA((23>>8)&0X00FF); //Set FPS
LCD_Write_DATA(23&0X00FF);
LCD_Write_COM(0xBA);
LCD_Write_DATA(0x0F); //GPIO[3:0] out 1
LCD_Write_COM(0xBB);
LCD_Write_DATA(0x07); //GPIO3=input, GPIO[2:0]=output
LCD_Write_DATA(0x01); //GPIO0 normal
LCD_Write_COM(0x36); //rotation ****set_address_mode command****
LCD_Write_DATA(0x03); //tried 0,1,2,3 but none have ANY effect ???
// LCD_Write_COM(0x20); //invert
// LCD_Write_DATA(0xff);
LCD_Write_COM(0x3A); //pixel data interface
LCD_Write_DATA(0x50);
LCD_Write_COM(0xF0); //pixel data interface
LCD_Write_DATA(0x03);
delay(1);
setXY(0, 0, 799, 479);
LCD_Write_COM(0x26); //pixel data interface
LCD_Write_DATA(0x08);
LCD_Write_COM(0x29); //display on
LCD_Write_COM(0xBE); //set PWM for B/L
LCD_Write_DATA(0x06);
LCD_Write_DATA(0x55);
LCD_Write_DATA(0x01);
LCD_Write_DATA(0xf0);
LCD_Write_DATA(0x00);
LCD_Write_DATA(0x00);
LCD_Write_COM(0xd0);
LCD_Write_DATA(0x0d);
LCD_Write_COM(0x2C);
break;
UPDATE:
Found another section:
This would suggest that you can simply change the direction BUT it says GET not SET.....
Tried adding the lines:
LCD_Write_COM(0x0B); //horizontal direction
LCD_Write_DATA(64);
BUT nothing I try changing it to works...... still playing though.