Rei Vilo 695 Posted December 13, 2014 Share Posted December 13, 2014 @@CorB Thank you for reporting the issue. Unfortunately, it is very difficult to add support for a new screen when I don't have one sample at hand, especially for "compatible" screens. CorB 1 Quote Link to post Share on other sites
RobG 1,892 Posted December 13, 2014 Author Share Posted December 13, 2014 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. Quote Link to post Share on other sites
CorB 64 Posted December 16, 2014 Share Posted December 16, 2014 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 Quote Link to post Share on other sites
RobG 1,892 Posted December 16, 2014 Author Share Posted December 16, 2014 Sorry, I meant D/C pin, not RS (it's basically the same thing, data/control or register select.) Quote Link to post Share on other sites
CorB 64 Posted December 16, 2014 Share Posted December 16, 2014 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. Quote Link to post Share on other sites
RobG 1,892 Posted December 16, 2014 Author Share Posted December 16, 2014 Unfortunately, pin conflicts are unavoidable when dealing with stacked BoosterPacks. Quote Link to post Share on other sites
CorB 64 Posted December 17, 2014 Share Posted December 17, 2014 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 ? Quote Link to post Share on other sites
CorB 64 Posted December 17, 2014 Share Posted December 17, 2014 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 ¤tFont; } 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 Quote Link to post Share on other sites
RobG 1,892 Posted December 17, 2014 Author Share Posted December 17, 2014 The new 2.4 BP has pads very close to LCD's frame, check for shorts. Also, since there are many more tracks, it could be reflections. Try with the slower SPI clock. Quote Link to post Share on other sites
CorB 64 Posted December 17, 2014 Share Posted December 17, 2014 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 Quote Link to post Share on other sites
RobG 1,892 Posted December 17, 2014 Author Share Posted December 17, 2014 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. Quote Link to post Share on other sites
RobG 1,892 Posted December 17, 2014 Author Share Posted December 17, 2014 @@CorB, I tested my Air setup with 2.4" BP and it seems to be working fine. The only thing I had to do is make sure touch CS (P2.1) is pulled up. Quote Link to post Share on other sites
CorB 64 Posted December 17, 2014 Share Posted December 17, 2014 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 Quote Link to post Share on other sites
RobG 1,892 Posted December 17, 2014 Author Share Posted December 17, 2014 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. Quote Link to post Share on other sites
CarlW 0 Posted January 12, 2015 Share Posted January 12, 2015 Hi RobG, Do you have a schematic that you can share with me for the LCD (2.4") with touchscreen? Many Thanks. 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.