Apaseo 3 Posted November 2, 2012 Share Posted November 2, 2012 After downloading all of the files and putting them in a project,my LCD is not displaying what is shown in the video. I have tried adding delays as mentioned in post #9. All I get is a white screen. I have JD-T1800 v2. Any help is appreciated. Thanks Quote Link to post Share on other sites
RobG 1,892 Posted November 2, 2012 Author Share Posted November 2, 2012 Can you give me more details? Did you get the kit or PCB? Picture of the bottom of the board would help too. Quote Link to post Share on other sites
Apaseo 3 Posted November 2, 2012 Share Posted November 2, 2012 Yes, Its a kit. Attached is a picture of the bottom. Also, I am able to program it with the code provided here: http://forum.43oh.com/topic/1758-color-lcd-booster-pack/page__st__20 --> Post #24. Thank You Quote Link to post Share on other sites
RobG 1,892 Posted November 2, 2012 Author Share Posted November 2, 2012 OK, I think I know the problem, try changing #define LCD_SCE_PIN BIT2 to #define LCD_SCE_PIN BIT0 Here's the reason why (post #63.) I will post the newest library files tonight. Quote Link to post Share on other sites
RobG 1,892 Posted November 4, 2012 Author Share Posted November 4, 2012 NOTE: Those files are not current as of May 5th 2013. See the first post for the latest.PCF8833 (Nokia 6100)SPFD54124B (Nokia 6085 and 6101)ST7735R (JD-T1800, 1.8" LCD)HX8340B (BTL221722, 2.2" without touch)ILI9225B (2.2" with touch)colorLCD.hfont_5x7.hfont_8x12.hmain.cmemory.cmemory.htypedefs.hUpdated 11/12colorLCD.cfont_11x16.h gio877, bluehash, tdyer and 4 others 7 Quote Link to post Share on other sites
bluehash 1,581 Posted November 4, 2012 Share Posted November 4, 2012 Rob, I'm on my phone.. but are the versions stamped on the boards. If not, It would be a good idea. Will help keep track of code and schemas. Quote Link to post Share on other sites
RobG 1,892 Posted November 4, 2012 Author Share Posted November 4, 2012 I was thinking the same, I will add version number from now on. I will also take pictures of all existing boards and mark identifying features. Quote Link to post Share on other sites
Giuss 0 Posted November 6, 2012 Share Posted November 6, 2012 Hi, I've tested your libray with a ST7735 display and works perfectly, good job! I have a question, how can I write a char or string overwriting an old text in the same position? I've seen that it doesn't delete old text, so I have to delete it first, how can I do it? Quote Link to post Share on other sites
RobG 1,892 Posted November 6, 2012 Author Share Posted November 6, 2012 Character function does not write empty pixels. To clear previous char/text, draw a rectangle with background color before writing new char/text. I will look into adding character functions that will write background pixels too. UPDATE: new functions are ready, will do some tests and post the new code later tonight. Quote Link to post Share on other sites
RobG 1,892 Posted November 7, 2012 Author Share Posted November 7, 2012 @Giuss, I have modified 2 functions, drawChar (5x7) and drawChar8_12. Drawing character or string will erase the background with the bgColor. 11x16 requires more changes so I will do it in few days. There are also 2 new functions for setting background color, setBackgroundColor8 and setBackgroundColor16. clearScreen is now setting the background color to white or black, so if you use it before drawing, bgColor will be already set. Let me know if there are any issues. colorLCD.ccolorLCD.h DoanQuocNam 1 Quote Link to post Share on other sites
Giuss 0 Posted November 7, 2012 Share Posted November 7, 2012 Very nice thank you, i'll try it soon. Bye Quote Link to post Share on other sites
Apaseo 3 Posted November 8, 2012 Share Posted November 8, 2012 Hey man, don't know if this is the right place to ask, but are there different libraries to make the LCD work with the stellaris launchpad? Thanks Quote Link to post Share on other sites
RobG 1,892 Posted November 8, 2012 Author Share Posted November 8, 2012 I don't have Stellaris specific library yet, but you can use this library with just few changes. This is a simplest way, no StellarisWare. 1. In colorLCD.c, replace delay function with: void delay(char x10ms) { while (x10ms > 0) { long ulLoop = 0; for (ulLoop = 0; ulLoop < 2000; ulLoop++) { } x10ms--; } } 2. In colorLCD.h, replace pin definitions: // pins #define LCD_SCLK_PIN 0x10 #define LCD_SCLK_PORT GPIO_PORTB_DATA_R #define LCD_SD_PIN 0x80 #define LCD_SD_PORT GPIO_PORTB_DATA_R #define LCD_SD_PORT_IN P4IN #define LCD_SD_DIR GPIO_PORTB_DIR_R #define LCD_SCE_PIN 0x20 // Version 1 of the board uses P1.2 #define LCD_SCE_PORT GPIO_PORTB_DATA_R #define LCD_DC_PIN 0x20 #define LCD_DC_PORT GPIO_PORTE_DATA_R 3. This is how the main will look like: int main(void) { SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOB; SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOE; long ulLoop = SYSCTL_RCGC2_R; GPIO_PORTB_DIR_R |= LCD_SD_PIN + LCD_SCLK_PIN + LCD_SCE_PIN; GPIO_PORTB_DEN_R |= LCD_SD_PIN + LCD_SCLK_PIN + LCD_SCE_PIN; GPIO_PORTB_DATA_R |= LCD_SCE_PIN; GPIO_PORTE_DIR_R = LCD_DC_PIN; GPIO_PORTE_DEN_R = LCD_DC_PIN; initHX8340B(); // or whatever LCD you are using for (ulLoop = 0; ulLoop < 200; ulLoop++) { } clearScreen(1); setColor16(0xFFFF); drawString(1, 1, "Hello world!"); } Quote Link to post Share on other sites
Apaseo 3 Posted November 10, 2012 Share Posted November 10, 2012 A note about the new files posted, I when I first tried them on my LCD ST7735R (JD-T1800) it would not work. So I spent some time debugging and came to the conclusion that the program is detecting my LCD as being the HX8340B. So to make it work, I made the following changes on main.c #ifdef SPFD54124B testSPFD54124B(); // N6101, N6085 #endif #ifdef PCF8833 testPCF8833(); // N6100 #endif #ifdef ST7735R testST7735R(); // JD-T1800 #endif #ifdef HX8340B //testHX8340B(); // /*<-------Notice that this command is commented out*/ testST7735R(); /*I added the command of the ST7735R here so that it would work.*/ #endif #ifdef ILI9225B testILI9225B(); #endif Also, another thing I changed was on colorLCD.h, in the defines of the LCD's #else #ifdef HX8340B //ST7735R /*Changed the commands for LCD original was ST7735R*/ // #define USE16BIT #define LCD_HEIGHT 160 #define LCD_WIDTH 128 #define LCD_OFFSET_HEIGHT 0 #define LCD_OFFSET_WIDTH 0 // #else #ifdef ST7735R //HX8340B /*Changed the commands for LCD, original was HX8340B*/ // #define USE16BIT #define SPI9BIT #define LCD_HEIGHT 176 //horizontal 176, vertical 220 #define LCD_WIDTH 220 // horizontal 220, vertical 176 #define LCD_OFFSET_HEIGHT 0 #define LCD_OFFSET_WIDTH 0 // #else Quote Link to post Share on other sites
RobG 1,892 Posted November 10, 2012 Author Share Posted November 10, 2012 All you need to do is change one line in colorLCD.h This is basically how you switch between one of the five supported displays. // define driver // //#define PCF8833 // use for 6100 //#define SPFD54124B // use for 6085 and 6101 #define ST7735R // use for JD-T1800 (1.8") //#define HX8340B // use for BTL221722 (2.2" without touch) //#define ILI9225B // 2.2" with touch Yet another reason to have wiki Also, few more changes I forgot to mention in post #28. Remove memory.h include, change all msp430g2553.h includes with lm4f120h5qr.h, and change two instances of BIT7 to 0x80 in colorLCD.c, that should do it. I will see if I can refactor my code and make it even more universal (I have 3 versions now, one for G/F series, one for Stellaris, and one for C2K.) Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.