N3TL0@D3R 0 Posted March 13, 2012 Share Posted March 13, 2012 Great job mate :clap: Quote Link to post Share on other sites
MattTheGeek 99 Posted March 13, 2012 Share Posted March 13, 2012 Rob, I think i have a lower cost, and better screen that could work (And it's OLED!) Quote Link to post Share on other sites
RobG 1,892 Posted March 13, 2012 Author Share Posted March 13, 2012 What is it? There's always room for improvement. Quote Link to post Share on other sites
MattTheGeek 99 Posted March 13, 2012 Share Posted March 13, 2012 http://search.digikey.com/us/en/products/COG-C172MVHC-04/153-1144-ND/2523704 http://search.digikey.com/us/en/products/COG-C144MVGI-08/153-1146-ND/2523706 Quote Link to post Share on other sites
RobG 1,892 Posted March 13, 2012 Author Share Posted March 13, 2012 They look good (though they are not TFT,) we could get few and make a board! Quote Link to post Share on other sites
username 198 Posted March 14, 2012 Share Posted March 14, 2012 Cheap Color LCD Displays are pretty much a dime a dozen and you can find 100s of different phone LCD displays on ebay. What would be most impressive though would be actually getting one of those confounded things to work. =) Most people would be willing to pay a decent amount for a screen that works then for one that doesn't. Quote Link to post Share on other sites
RobG 1,892 Posted March 15, 2012 Author Share Posted March 15, 2012 While working on the software tonight, my display became unresponsive. I thought it got zapped by ESD or something so I ordered a new one. Before chucking it, I figured I will run a soldering iron through the contacts just to make sure. Well, that was it, cold solder! I hate when that happens. In any case, I made some progress. GeekDoc, username and bluehash 3 Quote Link to post Share on other sites
bluehash 1,581 Posted March 15, 2012 Share Posted March 15, 2012 Hawww! good going. You got it. No things should fall into place. Quote Link to post Share on other sites
RobG 1,892 Posted March 15, 2012 Author Share Posted March 15, 2012 Here's some basic JD-T1800 code for testing purposes... ...and a short video main.c #include #include "ST7735.h" #define JDT1800_WIDTH 128 #define JDT1800_HEIGHT 160 #define JDT1800_SCL_PIN BIT5 #define JDT1800_SDA_PIN BIT7 #define JDT1800_CS_PIN BIT2 #define JDT1800_RS_PIN BIT4 #define JDT1800_SELECT P1OUT &= ~JDT1800_CS_PIN #define JDT1800_DESELECT P1OUT |= JDT1800_CS_PIN #define JDT1800_SET_COMMAND P1OUT &= ~JDT1800_RS_PIN #define JDT1800_SET_DATA P1OUT |= JDT1800_RS_PIN #define JDT1800_COMMAND 0 #define JDT1800_DATA 1 void initLCD(); void delay(char x10ms); void write(char data, char registerSelect); void setAddr(char xStart, char yStart, char xEnd, char yEnd); void fillScreen(unsigned int color_16); void writeConfig(char command, char numberOfArgs, const char *args); void writeConfigWithDelay(char command, char x10ms); #define writeData(data) write(data, JDT1800_DATA); #define writeCommand(command) write(command, JDT1800_COMMAND); // convenience color table const int color[] = { ST7735_16_BLACK, ST7735_16_WHITE, ST7735_16_YELLOW, ST7735_16_RED, ST7735_16_MAGENTA, ST7735_16_BLUE, ST7735_16_CYAN, ST7735_16_GREEN }; void main(void) { WDTCTL = WDTPW + WDTHOLD; // disable WDT BCSCTL1 = CALBC1_16MHZ; // 16MHz clock DCOCTL = CALDCO_16MHZ; P1OUT |= JDT1800_CS_PIN + JDT1800_RS_PIN; P1DIR |= JDT1800_CS_PIN + JDT1800_RS_PIN; P1SEL |= JDT1800_SCL_PIN + JDT1800_SDA_PIN; P1SEL2 |= JDT1800_SCL_PIN + JDT1800_SDA_PIN; UCB0CTL0 |= UCCKPH + UCMSB + UCMST + UCSYNC; // 3-pin, 8-bit SPI master UCB0CTL1 |= UCSSEL_2; // SMCLK UCB0BR0 |= 0x01; // 1:1 UCB0BR1 = 0; UCB0CTL1 &= ~UCSWRST; // clear SW initLCD(); // clear screen fillScreen(ST7735_16_BLACK); // cycle through 8 colors char c = 0; while (c < 8) { _delay_cycles(1000000); fillScreen(color[c]); c++; } } void setAddr(char xStart, char yStart, char xEnd, char yEnd) { writeCommand(ST7735_CASET); writeData(0x00); writeData(xStart); writeData(0x00); writeData(xEnd); writeCommand(ST7735_RASET); writeData(0x00); writeData(yStart); writeData(0x00); writeData(yEnd); writeCommand(ST7735_RAMWR); // data to follow } void fillScreen(unsigned int color_16) { char colorHighByte = color_16 >> 8; char colorLowByte = color_16; char x = JDT1800_WIDTH; char y = JDT1800_HEIGHT; setAddr(0, 0, x - 1, y - 1); while (y-- > 0) { while (x-- > 0) { writeData(colorHighByte); writeData(colorLowByte); } } } void write(char data, char registerSelect) { registerSelect ? (JDT1800_SET_DATA) : (JDT1800_SET_COMMAND); JDT1800_SELECT; UCB0TXBUF = data; while (!(IFG2 & UCB0TXIFG)) ; JDT1800_DESELECT; } void writeConfig(char command, char numberOfArgs, const char *args) { writeCommand(command); while (numberOfArgs--) { writeData(*args++); } } void writeConfigWithDelay(char command, char x10ms) { writeCommand(command); delay(x10ms); } void delay(char x10ms) { while (x10ms > 0) { _delay_cycles(160000); x10ms--; } } // ************* // Config section // ************* const char frmctr[] = { 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D }; const char invctr[] = { 0x07 }; const char pwctr1[] = { 0xA2, 0x02, 0x84 }; const char pwctr2[] = { 0xC5 }; const char pwctr3[] = { 0x0A, 0x00 }; const char pwctr4[] = { 0x8A, 0x2A }; const char pwctr5[] = { 0x8A, 0xEE }; const char vmctr1[] = { 0x0E }; const char madctl[] = { 0xC8 }; const char colmod[] = { 0x05 }; // 16-bit color void initLCD() { writeConfigWithDelay(ST7735_SLPOUT, 50); // sleep out writeConfig(ST7735_FRMCTR1, 3, frmctr); // frame rate in normal mode writeConfig(ST7735_FRMCTR2, 3, frmctr); // frame rate in idle mode writeConfig(ST7735_FRMCTR3, 6, frmctr); // frame rate in partial mode writeConfig(ST7735_INVCTR, 1, invctr); // display inversion control writeConfig(ST7735_PWCTR1, 3, pwctr1); // power control settings writeConfig(ST7735_PWCTR2, 1, pwctr2); // power control settings writeConfig(ST7735_PWCTR3, 2, pwctr3); // power control settings writeConfig(ST7735_PWCTR4, 2, pwctr4); // power control settings writeConfig(ST7735_PWCTR5, 2, pwctr5); // power control settings writeConfig(ST7735_VMCTR1, 1, vmctr1); // power control settings writeConfig(ST7735_INVOFF, 0, 0); // display inversion off writeConfig(ST7735_MADCTL, 1, madctl); // memory data access control writeConfig(ST7735_COLMOD, 1, colmod); // color mode writeConfigWithDelay(ST7735_NORON, 1); // normal display on writeConfigWithDelay(ST7735_DISPON, 10); // display on } ST7735.h #ifndef ST7735_H_ #define ST7735_H_ #define ST7735_16_BLACK 0x0000 #define ST7735_16_BLUE 0x001F #define ST7735_16_RED 0xF800 #define ST7735_16_GREEN 0x07E0 #define ST7735_16_CYAN 0x07FF #define ST7735_16_MAGENTA 0xF81F #define ST7735_16_YELLOW 0xFFE0 #define ST7735_16_WHITE 0xFFFF #define ST7735_NOP 0x00 #define ST7735_SWRESET 0x01 #define ST7735_RDDID 0x04 #define ST7735_RDDST 0x09 #define ST7735_SLPIN 0x10 #define ST7735_SLPOUT 0x11 #define ST7735_PTLON 0x12 #define ST7735_NORON 0x13 #define ST7735_INVOFF 0x20 #define ST7735_INVON 0x21 #define ST7735_DISPOFF 0x28 #define ST7735_DISPON 0x29 #define ST7735_CASET 0x2A #define ST7735_RASET 0x2B #define ST7735_RAMWR 0x2C #define ST7735_RAMRD 0x2E #define ST7735_PTLAR 0x30 #define ST7735_COLMOD 0x3A #define ST7735_MADCTL 0x36 #define ST7735_FRMCTR1 0xB1 #define ST7735_FRMCTR2 0xB2 #define ST7735_FRMCTR3 0xB3 #define ST7735_INVCTR 0xB4 #define ST7735_DISSET5 0xB6 #define ST7735_PWCTR1 0xC0 #define ST7735_PWCTR2 0xC1 #define ST7735_PWCTR3 0xC2 #define ST7735_PWCTR4 0xC3 #define ST7735_PWCTR5 0xC4 #define ST7735_VMCTR1 0xC5 #define ST7735_RDID1 0xDA #define ST7735_RDID2 0xDB #define ST7735_RDID3 0xDC #define ST7735_RDID4 0xDD #define ST7735_GMCTRP1 0xE0 #define ST7735_GMCTRN1 0xE1 #define ST7735_PWCTR6 0xFC #endif /*ST7735_H_*/ GeekDoc, elpapais, ROFLhoff and 1 other 4 Quote Link to post Share on other sites
username 198 Posted March 16, 2012 Share Posted March 16, 2012 Wow, incredible work! =) Will you be selling any of these booster packs? There any screens larger than 1.8 that will work with this driver? Quote Link to post Share on other sites
RobG 1,892 Posted March 17, 2012 Author Share Posted March 17, 2012 Boards should be available very soon, ask b#. Not sure about displays larger than 1.8", which one do you have in mind? Darn, my LCD's connector got damaged, so I will not be able to continue for couple of weeks. Quote Link to post Share on other sites
bluehash 1,581 Posted March 17, 2012 Share Posted March 17, 2012 Darn, my LCD's connector got damaged, so I will not be able to continue for couple of weeks. I can buy you some. What's the cost of these things? Also link me to them. Quote Link to post Share on other sites
username 198 Posted March 18, 2012 Share Posted March 18, 2012 =( Sorry to hear about your screen. I'd certainly be interested in a booster pack for this. As for the screen I mentioned, I know its not compatible but i'd be nice to have a color/touch LCD of decent size. Its abit pricey but this is what I had my eyes on. http://www.ebay.com/itm/New-3-2-TFT-LCD ... 27c370a2bd Quote Link to post Share on other sites
RobG 1,892 Posted March 19, 2012 Author Share Posted March 19, 2012 I can buy you some. What's the cost of these things? Also link me to them. Thanks for the offer, but I already have few coming so I am good. This will also give me some time to concentrate on the Nokia part of this booster. Here's my initial Nokia code which allows display/chip identification. The 3 displays I have are (phone - driver): 298303 - N6100 - LDS176(PCF8833 comp)? FE903C - N6101? - SPFD54124B com? 7C8066 - N6085? - SPFD54124B comp? All displays seem to initiate fine, now time to draw something main.c /* * Nokia Color LCD * * Created on: Mar 19, 2012 * Author: RobG * * main.c */ #include "msp430g2553.h" #include "nokiaColor.h" #define NokiaLCD_SCLK_PIN BIT5 #define NokiaLCD_SD_PIN BIT7 #define NokiaLCD_SCE_PIN BIT2 #define NokiaLCD_SELECT P1OUT &= ~NokiaLCD_SCE_PIN #define NokiaLCD_DESELECT P1OUT |= NokiaLCD_SCE_PIN void write(char data, char dataCommand); long readLong(char command); char readChar(char command); void main(void) { WDTCTL = WDTPW + WDTHOLD; // disable WDT BCSCTL1 = CALBC1_16MHZ; // 16MHz clock DCOCTL = CALDCO_16MHZ; P1OUT |= NokiaLCD_SCLK_PIN + NokiaLCD_SCE_PIN + NokiaLCD_SD_PIN; P1DIR |= NokiaLCD_SCLK_PIN + NokiaLCD_SCE_PIN + NokiaLCD_SD_PIN; _delay_cycles(160000); // wait before reading IDs write(SLEEPOUT, COMMAND); _delay_cycles(1000); // read display ID long rddidif = readLong(RDDIDIF); // read display status long status = readLong(RDDST); // this is pretty much same as RDDIDIF, just split into 3 separate reads char rdid1 = readChar(RDID1); char rdid2 = readChar(RDID2); char rdid3 = readChar(RDID3); //initLCD(); //main loop while (1) ; } char readChar(char command) { char a = 0; char c = 0; NokiaLCD_SELECT; P1OUT &= ~NokiaLCD_SD_PIN; P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; while (c < 8) { (command & BIT7) ? (P1OUT |= NokiaLCD_SD_PIN) : (P1OUT &= ~NokiaLCD_SD_PIN); P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; command <<= 1; c++; } P1DIR &= ~NokiaLCD_SD_PIN; while (c < 16) { a <<= 1; P1OUT |= NokiaLCD_SCLK_PIN; if (P1IN & NokiaLCD_SD_PIN) a |= BIT0; P1OUT &= ~NokiaLCD_SCLK_PIN; c++; } NokiaLCD_DESELECT; P1DIR |= NokiaLCD_SD_PIN; return a; } long readLong(char command) { long a = 0; char b = 0; char c = 0; if (command == RDDIDIF) { b = 32; } else if (command == RDDST) { b = 40; } else return 0; NokiaLCD_SELECT; P1OUT &= ~NokiaLCD_SD_PIN; P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; while (c < 8) { (command & BIT7) ? (P1OUT |= NokiaLCD_SD_PIN) : (P1OUT &= ~NokiaLCD_SD_PIN); P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; command <<= 1; c++; } P1DIR &= ~NokiaLCD_SD_PIN; P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; while (c < { a <<= 1; P1OUT |= NokiaLCD_SCLK_PIN; if (P1IN & NokiaLCD_SD_PIN) a |= BIT0; P1OUT &= ~NokiaLCD_SCLK_PIN; c++; } NokiaLCD_DESELECT; P1DIR |= NokiaLCD_SD_PIN; return a; } void write(char data, char dataCommand) { char c = 0; NokiaLCD_SELECT; dataCommand ? (P1OUT |= NokiaLCD_SD_PIN) : (P1OUT &= ~NokiaLCD_SD_PIN); P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; while (c < 8) { (data & BIT7) ? (P1OUT |= NokiaLCD_SD_PIN) : (P1OUT &= ~NokiaLCD_SD_PIN); P1OUT |= NokiaLCD_SCLK_PIN; P1OUT &= ~NokiaLCD_SCLK_PIN; data <<= 1; c++; } NokiaLCD_DESELECT; } nokiaColor.h /* * nokiaColor.h * * Created on: Mar 19, 2012 * Author: RobG */ #ifndef NOKIACOLOR_H_ #define NOKIACOLOR_H_ #define COMMAND 0 #define DATA 1 #define RDDIDIF 0x04 #define RDDST 0x09 #define SLEEPOUT 0x11 #define RDID1 0xDA #define RDID2 0xDB #define RDID3 0xDC #endif /* NOKIACOLOR_H_ */ Quote Link to post Share on other sites
RobG 1,892 Posted March 20, 2012 Author Share Posted March 20, 2012 N6100 works as expected, next! I will wait with all graphics until I get all displays up and running. Also, I have to revisit my JD-T1800 code and optimize it. 8 bit mode test 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.