Jump to content
43oh

2.2" Color LCD Booster Pack with Touch


Recommended Posts

  • 2 weeks later...
  • Replies 128
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I am working on a new color LCD booster pack featuring 2.2" display. The board will work with two types of displays, one with touch screen and one without. TSC2046/ADS7846 controller or MCU's analog

Another test, this time some simple on/off buttons. Once I polish this a little, I will add it to GitHub so that users can contribute.  

If you're tight on budget, a cheap solution to using SD cards is soldering a  7 pin male header directly to the pins of a microSD-to-SD adapter. You can insert microSD cards just as you'd do normally.

Posted Images

There's no datasheet for the 2.2" LCD with touch panel, but looking at ILI9225B's specs and comparable 2.2" LCD, I believe the logic current is 3-5mA, back light current is 60-75mA (3 LEDs with no current limiting resistors,) touch panel 3-8mA when active. I will try to confirm those tonight.

Also, you can put the display to sleep and turn the backlight off (will require some tweaks to the board.)

Link to post
Share on other sites
  • 2 weeks later...

Looks like Seeed screwed my boards up and had to remake them. All other boards came in red as ordered, those came green :-(

Well, PENIRQ works, but I cannot get any readings from touch controller. I hope it's a software issue.

If all goes well, those will be available next week.

Link to post
Share on other sites

OK, good news, touch controller is working.

I don't have the fully functional code yet, but I do get some readings from it.

I will have 8 of them available on Monday.

They will come with LCD only, no touch controller, you will have to get and solder one yourself.

The controller part number is TSC2046EIPW.

If you choose not to use the controller (there are pros and cons,) you can cut JP6, short JP5, JP11-14, and use MCU's ADC for touch screen.

 

 

post-73-0-99545700-1353209149_thumb.jpg

Link to post
Share on other sites

OK, here's the deal.

The first batch will be available directly from me and will come without touch controller chip.

The price is $15 + $3 shipping in US

PM me if you want one.

 

For the next batch (which will be available from the 43oh store,) I will consider including the controller chip, but that will bump the price by $1.50-$2

Link to post
Share on other sites

Example TSC2046 code

 

/*
* Created on: Mar 19, 2012
*	  Author: RobG
*
* main.c
*/
#include "msp430g2553.h"
#include "colorLCD.h"
void testILI9225B();
unsigned int readTouchController(char command);
void readTouch(unsigned int * xy);
void binaryToASCII(unsigned int n, char * digits);
unsigned int xy[2] = { 0, };
char xValue[] = "    ";
char yValue[] = "    ";
void main(void) {
WDTCTL = WDTPW + WDTHOLD; // disable WDT
BCSCTL1 = CALBC1_16MHZ; // 16MHz clock
DCOCTL = CALDCO_16MHZ;
P1OUT |= LCD_SCLK_PIN + LCD_SCE_PIN + LCD_SD_PIN + LCD_DC_PIN;
P1DIR |= LCD_SCLK_PIN + LCD_SCE_PIN + LCD_SD_PIN + LCD_DC_PIN;
P2OUT |= BIT2;
P2DIR |= BIT2;
P2OUT |= BIT0;
P2DIR &= ~BIT0;
P2REN |= BIT0;
P2IES |= BIT0; //hi-lo
P2IFG &= ~BIT0;
P2IE |= BIT0;
_delay_cycles(16000); // wait before reading IDs
_bis_SR_register(GIE);
testILI9225B();
}
#pragma vector=PORT2_VECTOR
__interrupt void Port_2(void) {
if (P2IFG & BIT0) {
 //
 // single read
 //
 P2OUT &= ~BIT2;
 xy[0] = readTouchController(0xD0);
 P2OUT |= BIT2;
 P2OUT &= ~BIT2;
 xy[1] = readTouchController(0x90);
 P2OUT |= BIT2;
 //
 // display results
 //
 binaryToASCII(xy[0], xValue);
 binaryToASCII(xy[1], yValue);
 setColor16(0);
 fillRect(10, 10, 150, 18);
 setColor16(0xFFFF);
 drawString(10, 10, "x: ");
 drawString(30, 10, xValue);
 drawString(100, 10, "y: ");
 drawString(120, 10, yValue);
}
P2IFG &= ~BIT0;
}
void testILI9225B() {
_delay_cycles(16000);
initILI9225B();
clearScreen(1);
setColor16(0xFFFF);
while (1) {
}
}
/*
* 0xD0 - read x 12bit, enable PENIRQ
* 0x90 - read y 12bit, enable PENIRQ
* 0xD8 - read x 8bit, enable PENIRQ
* 0x98 - read y 8bit, enable PENIRQ
* 0xD1 - read x 12bit, disable PENIRQ
* 0x91 - read y 12bit, disab;e PENIRQ
* 0xD9 - read x 8bit, disable PENIRQ
* 0x99 - read y 8bit, disable PENIRQ
*
* For multiple readings, enable PENIRQ only on the last read
* 0xD1, 0xD1, 0xD1...0x91, 0x91, 0x90
*
*/
unsigned int readTouchController(char command) {
char c = 21;
if (command & 0x08)
 c = 17; // this makes it work with 8bit and 12bit, you can remove
unsigned int returnValue = 0;
while (c != 0) {
 (command & BIT7) ? (P1OUT |= LCD_SD_PIN) : (P1OUT &= ~LCD_SD_PIN);
 returnValue <<= 1;
 P1OUT |= LCD_SCLK_PIN;
 if (P1IN & BIT6)
  returnValue |= BIT0;
 P1OUT &= ~LCD_SCLK_PIN;
 command <<= 1;
 c--;
}
return returnValue;
}
// this is not needed, it's just used to convert int to string so that we can show the value on LCD
void binaryToASCII(unsigned int n, char * digits) {
__asm(" clr  R14");
__asm(" rla  R12");
__asm(" rla  R12");
__asm(" rla  R12");
__asm(" rla  R12");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" rla  R12");
__asm(" dadd R14, R14");
__asm(" mov.b R14, 3(R13)");
__asm(" swpb R14");
__asm(" mov.b R14, 1(R13)");
__asm(" rra  R14");
__asm(" rra  R14");
__asm(" rra  R14");
__asm(" rra  R14");
__asm(" mov.b R14, 0(R13)");
__asm(" swpb R14");
__asm(" mov.b R14, 2(R13)");
__asm(" and  #0x0F0F, 0(R13)");
__asm(" and  #0x0F0F, 2(R13)");
__asm(" add.b #0x30, 3(R13)");
__asm(" tst.b 0(R13)");
__asm(" jnz l1");
__asm(" mov.b #0x20, 0(R13)");
__asm(" tst.b 1(R13)");
__asm(" jnz l2");
__asm(" mov.b #0x20, 1(R13)");
__asm(" tst.b 2(R13)");
__asm(" jnz l3");
__asm(" mov.b #0x20, 2(R13)");
__asm(" jmp l4");
__asm("l1:");
__asm(" add.b #0x30, 0(R13)");
__asm("l2:");
__asm(" add.b #0x30, 1(R13)");
__asm("l3:");
__asm(" add.b #0x30, 2(R13)");
__asm("l4:");
return;
}

Link to post
Share on other sites

There are 2 ways to make touch panel work:

1. Touch controller chip - solder TSC2046 (IC2)

2. MSP430's ADC - cut JP6, short JP5, JP11-JP14

 

Other options:

 

R2-R4 LCD backlight resistors, shorted by default

 

USCI - short JP1 & JP4, shorted by default

USI - short JP2 & JP3, cut JP1 & JP4 which are shorted by default

 

IC1 - 23Kxxx or 25AAxxx series memory

Memory HOLD - short JP10 (shorted by default) when unused, short JP9 and cut JP10 when used. JP9 connects HOLD to P2.5

 

 

post-73-0-53673800-1353687099_thumb.jpg

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...