changeset 64:ff29436c0224

- Make sure the line is high before pulling low for reset. - Use delay properly to get the required delays.
author Daniel O'Connor <darius@dons.net.au>
date Sun, 14 Apr 2013 14:25:51 +0930
parents 7e5916574d5e
children 662e7f01c991
files lcd.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lcd.c	Tue Apr 09 17:09:19 2013 +0930
+++ b/lcd.c	Sun Apr 14 14:25:51 2013 +0930
@@ -131,9 +131,10 @@
     /* Initialise LCD panel */
 
     /* Pull reset pin low */
+    GPIO_SetBits(GPIOE, GPIO_Pin_1);
     delay(10);
     GPIO_ResetBits(GPIOE, GPIO_Pin_1);
-    delay(500);
+    delay(2000);
     GPIO_SetBits(GPIOE, GPIO_Pin_1);
     delay(500);
 
@@ -148,7 +149,7 @@
     lcd_writereg(0x00e7, 0x0012); /* Set internal timing (not documented) */
     lcd_writereg(0x00ef, 0x1231); /* Set internal timing (not documented) */
     lcd_writereg(0x0000, 0x0001); /* Start Oscillation */
-    delay(50);
+    delay(50000);
     lcd_writereg(0x0001, 0x0100); /* set SS (S720 -> S1) */
     lcd_writereg(0x0002, 0x0700); /* set line inversion (B/C + EOR) */
     lcd_writereg(0x0004, 0x0000); /* no resizing */
@@ -165,16 +166,16 @@
     lcd_writereg(0x0011, 0x0007); /* DC1[2:0], DC0[2:0], VC[2:0] */
     lcd_writereg(0x0012, 0x0000); /* VREG1OUT voltage */
     lcd_writereg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
-    delay(200);                 /* Dis-charge capacitor power voltage */
+    delay(200000);  		  /* Dis-charge capacitor power voltage */
     lcd_writereg(0x0010, 0x1690); /* SAP, BT[3:0], AP, DSTB, SLP, STB */
     lcd_writereg(0x0011, 0x0227); /* R11h = 0x0221 at VCI = 3.3V, DC1[2:0], DC0[2:0], VC[2:0] */
-    delay(50);                  /* delay 50ms */
+    delay(50000);                 /* delay 50ms */
     lcd_writereg(0x0012, 0x001c); /* External reference voltage= Vci; */
-    delay(50);                  /* delay 50ms */
+    delay(50000);                 /* delay 50ms */
     lcd_writereg(0x0013, 0x1800); /* R13 = 1200 when R12 = 009D; VDV[4:0] for VCOM amplitude */
     lcd_writereg(0x0029, 0x001c); /* R29 = 000C when R12 = 009D; VCM[5:0] for VCOMH */
     lcd_writereg(0x002b, 0x000d); /* Frame Rate = 91Hz */
-    delay(50);                  /* delay 50ms */
+    delay(50000);                 /* delay 50ms */
 
     /* Set GRAM area */
     lcd_writereg(0x0050, 0x0000); /* Horizontal GRAM Start Address */