configured for beyondtek displays

Dependents:   datalogger_ft810

Fork of FT800_3 by The Best

Revision:
7:a69ac4d39afd
Parent:
6:16e22c789f7d
Child:
8:4601ccd8a927
--- a/FT_Gpu_Hal.cpp	Tue Feb 10 23:32:22 2015 +0000
+++ b/FT_Gpu_Hal.cpp	Wed Feb 24 14:04:34 2016 +0000
@@ -9,6 +9,7 @@
 #include "FT_Platform.h"
 #include "mbed.h"
 #include "FT_LCD_Type.h"
+Serial pc(USBTX, USBRX);
 
 FT800::FT800(PinName mosi,
 			PinName miso,
@@ -23,7 +24,7 @@
 	 _f800_isr(InterruptIn(intr))
 	 {
 	 	 _spi.format(8,0);                  // 8 bit spi mode 0
-    	 _spi.frequency(2000000);          // start with 10 Mhz SPI clock
+    	 _spi.frequency(1000000);          // start with 10 Mhz SPI clock
     	 _ss = 1;                           // cs high
     	 _pd = 1;                           // PD high
 		 Bootup();
@@ -43,31 +44,31 @@
 	/* Do a power cycle for safer side */
 	Powercycle( FT_TRUE);
 
-	/* Access address 0 to wake up the FT800 */
-	HostCommand( FT_GPU_ACTIVE_M);
-	Sleep(20);
-
 	/* Set the clk to external clock */
 	HostCommand( FT_GPU_EXTERNAL_OSC);
 	Sleep(10);
-
+	
+	/* Access address 0 to wake up the FT800 */
+	HostCommand( FT_GPU_ACTIVE_M);
+	Sleep(500);
 
 	/* Switch PLL output to 48MHz */
-	HostCommand( FT_GPU_PLL_48M);
+//	HostCommand( FT_GPU_PLL_48M);
 	Sleep(10);
 
 	/* Do a core reset for safer side */
 	HostCommand( FT_GPU_CORE_RESET);
-
+	Sleep(500);
 	//Read Register ID to check if FT800 is ready.
 	chipid = Rd8(  REG_ID);
+//	chipid = Rd8(0x0C0000);
+    pc.printf("ID%08X\n", chipid);
 	while(chipid != 0x7C)
-		chipid = Rd8(  REG_ID);
 
 
 	// Speed up
-	_spi.frequency(20000000);           // 20 Mhz SPI clock
-
+//	_spi.frequency(20000000);           // 20 Mhz SPI clock DC
+	_spi.frequency(12000000);           // 20 Mhz SPI clock
 	/* Configuration of LCD display */
     DispHCycle = my_DispHCycle;
     Wr16(  REG_HCYCLE, DispHCycle);