Jump to content
RobG

2.4" 320 x 240 Color LCD Booster Pack (with and without touch panel)

Recommended Posts

The new screen will work with ILI9431 library (like my 2.2" LCD BP) and the touch panel works just like in my 2.2" LCD with Touch BP (ILI9225.)

So all that should be required to make it work is just changing LCD CS & RS pin and which driver chip is used.

Share this post


Link to post
Share on other sites

Hi,

 

@@RobG. Thanks for the answer but ... its not a response that helps me much. I have shared the part of the Energia code that I have changed, that part shows a change for the CS pin to 2_5 and the D/C to 1_3. You now mention a change to an RS pin. Which pin do you mean by this ? In your mail where you mentioned the changes there is no mention of an RS pin. Sorry to bother but I would like to get it working also on Energia.

 

cheers

Cor

Share this post


Link to post
Share on other sites

That would mean the changes I made are the changes that should be made ... unfortunately I only get a white screen in Energia. Must be something else that blocks the code from working properly. So no touch yet. And to further complicate ... it seems the LCD is hampering the function of the Anaren Air Boosterpack I am using in conjunction. The Anaren signals incoming data on P2_6 and I had the feeling the LCD isnt using that pin at all. But when I mount the LCD the RF still works but doesnt signal incoming RF packages. Ah ... thats what fiddling with MCUs is all about ;)

 

 

EDIT: just found out things work as planned if I connect the LCD with only 6 lines (+3v3,GND, CS, D/C, MOSI, CLK) ... 

 

Problem Solved ... IRQ was interfering.

Share this post


Link to post
Share on other sites

I dont see the reason for the conflict yet. My IRQ listens for incoming RF packs at 2_6. That pin isnt part of your LCD boosterpack. When I connect the boosterpack with 6 cables the LCD and RF operate as planned. The moment I plug the LCD directly on top of the RF the RF starts to show odd data. My normal packages do not come through anymore. I have been using the same setup with another LCDpack (Itead) without problems. Anybody with a guess where the weak spot probably resides ? 

Share this post


Link to post
Share on other sites

Hello,

 

For those that like to expand (like I do) this LCD boosterpack library with more fonts and flexibility to choose them without too much worry about the size of the font etc. Based on several other sources on the internet I have add to the file fonts.h. 

typedef struct Fontstruct {
  u_char bytesperchar;
  u_char pixelsx;
  u_char pixelsy;
  u_char startchar;
  const u_char *data;

} Fontstruct;

Fontstruct currentFont;  //used to store the current Font

//example font array
const u_char kaiTi[77*50] = //ms Gothic22pt bold
{

// @0 '0' (15 pixels wide)
0xF0, 0x07, //     #######
0xF8, 0x0F, //    #########
0x7C, 0x1F, //   ##### #####
0x3C, 0x3E, //   ####   #####
0x1E, 0x3C, //  ####     ####
0x1E, 0x3C, //  ####     ####
0x1E, 0x78, //  ####      ####
0x0F, 0x78, // ####       ####
0x0F, 0x78, // ####       ####
.....
.....
0xE0, 0x01, //      ####
0xF0, 0x00, //     ####
0x70, 0x00, //     ###
0x78, 0x00, //    ####
0x3C, 0x00, //   ####
0x1C, 0x00, //   ###
0xFE, 0x1F, //  ############
0xFE, 0x1F, //  ############
0x00, 0x00, //
0x00, 0x00, //


};


// a simple function used to fill currentFont with kaiTi settings;
Fontstruct * FS_kaiTi()
{
currentFont.bytesperchar=50;
currentFont.pixelsx=15;
currentFont.pixelsy=25;
curresntFont.startchar=0x30;
currentFont.data=&kaiTi[0];


return &currentFont;
}

And below a simple way to show a character.


void drawLargeChar(u_int x, u_int y, char c) {
FS_kaiTi();//select font


u_char charbyte = 0;
u_char row = 0;
u_char bit = 0x01;
u_int col=0;


u_char oc = c- currentFont.startchar;
setArea(x, y, x + currentFont.pixelsx, y + currentFont.pixelsy);


while (charbyte < currentFont.bytesperchar) // no of bytes for a char
{
while ((row<8)) {
if (currentFont.data[oc*currentFont.bytesperchar+charbyte] & bit) {
//foreground colour
writeData(colorHighByte);
writeData(colorLowByte);
} else {
//background colour
writeData(bgColorHighByte);
writeData(bgColorLowByte);
}
bit <<= 1; // shift the bitmask
row++;
col++;
 }
 row=0; //start with 1st column of character
 bit = 0x01; //bit0 is the initial bit
 charbyte++; // next byte
}
}

cheers

CorB

 

 

 

Share this post


Link to post
Share on other sites

Hi Rob,

 

The SPI of the LCD works as planned at least as long as I have the boosterpack on 6 cables. Ive measured all contactpoints of the boosterpack agains ground and VCC and found no false connections. Ive also checked adjacent pins for possible connections, none too. Maybe the metal frame of the LCD has effect on the receiption of RF data. Although the Anaren Air Boosterpack sticks sideways out of the Launchpad.

 

cheers

Cor

Share this post


Link to post
Share on other sites

I have similar issue with 2.2" BP and my Ethernet BP. Everything works except when MISO is used. Slowing down SPI to 8MHz works for me. When used separately, both BP are OK @ 16MHz.

Share this post


Link to post
Share on other sites

Hi Rob,

 

And the reception did not change for the RF ? Thats where my problems reside. When I simply connect the LCD with cables to the Anaren air (mounted on the launchpad) everything works as planned. If I lock the LCD onto the launchpad I get odd readings. 

 

How did you pull the pins up ? Using the internal resistors ?

 

regards

Cor

Share this post


Link to post
Share on other sites

Interference could be the problem. Didn't experience it with CC's, but I did with GPS module.

Yes, internal resistor. I didn't test the range and I tested single bytes of data. I may do some more tests tonight.

Share this post


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...