madias 0 Posted October 24, 2014 Share Posted October 24, 2014 Hello, I've done a TIVA C-123-Launchpad conversation of Henning Karlsen's LCD5510 library (it's much the same as the UTFT library). Everything is working, BUT: I've to eliminate following code (commented out part) in the *.cpp file, and I've to do it manually in "setup" sketch: LCD5110::LCD5110(int SCK, int MOSI, int DC, int RST, int CS) { P_SCK = portOutputRegister(digitalPinToPort(SCK)); B_SCK = digitalPinToBitMask(SCK); P_MOSI = portOutputRegister(digitalPinToPort(MOSI)); B_MOSI = digitalPinToBitMask(MOSI); P_DC = portOutputRegister(digitalPinToPort(DC)); B_DC = digitalPinToBitMask(DC); P_RST = portOutputRegister(digitalPinToPort(RST)); B_RST = digitalPinToBitMask(RST); P_CS = portOutputRegister(digitalPinToPort(CS)); B_CS = digitalPinToBitMask(CS); /* pinMode(_SCK,OUTPUT); pinMode(_MOSI,OUTPUT); pinMode(_DC,OUTPUT); pinMode(_RST,OUTPUT); pinMode(_CS,OUTPUT); */ SCK_Pin=SCK; RST_Pin=RST; } If I leave this in the library, compiling is ok, but the TIVA freezes. I've compared it with the tiva conversation of the UTFT library line for line and I'm at a loss with this stupid easy code I've attached the whole conversation of the basic and graph library. Little example code (working): // LCD5110_Sleep_Mode (C)2014 Henning Karlsen // web: http://www.henningkarlsen.com/electronics // // This program is a demo of sleep mode. // // This program requires a Nokia 5110 LCD module. // // It is assumed that the LCD module is connected to // the following pins using a levelshifter to get the // correct voltage to the module. // SCK - Pin 8 // MOSI - Pin 9 // DC - Pin 10 // RST - Pin 11 // CS - Pin 12 // #include <LCD5110_Basic.h> LCD5110 myGLCD(PA_2,PA_3,PA_4,PB_6,PB_7); extern uint8_t SmallFont[]; extern uint8_t MediumNumbers[]; void setup() { pinMode(PA_2,OUTPUT); pinMode(PA_3,OUTPUT); pinMode(PA_4,OUTPUT); pinMode(PB_6,OUTPUT); pinMode(PB_7,OUTPUT); myGLCD.InitLCD(); } void loop() { myGLCD.setFont(SmallFont); myGLCD.clrScr(); myGLCD.print("Entering", CENTER, 0); myGLCD.print("Sleep Mode", CENTER, 8); myGLCD.print("in", CENTER, 16); myGLCD.print("Seconds", CENTER, 40); myGLCD.setFont(MediumNumbers); for (int s=10; s>=0; s--) { myGLCD.printNumI(s, CENTER, 24, 2, '0'); delay(1000); } myGLCD.enableSleep(); delay(5000); myGLCD.disableSleep(); myGLCD.setFont(SmallFont); myGLCD.print("Awake again!", CENTER, 0); myGLCD.print("The screen was", CENTER, 16); myGLCD.print("cleared while", CENTER, 24); myGLCD.print("in Sleep Mode.", CENTER, 32); delay(5000); } Thanks Matthias LCD5110_UTFT.zip Quote Link to post Share on other sites
spirilis 1,265 Posted October 25, 2014 Share Posted October 25, 2014 This is with Energia 13? Quote Link to post Share on other sites
madias 0 Posted October 25, 2014 Author Share Posted October 25, 2014 no, with Energia 12. And the (energia port) UTFT library works out of the box, with nearly the same code, so this drives me crazy, and it is a stupid pinMode and digitalWrite... Quote Link to post Share on other sites
spirilis 1,265 Posted October 25, 2014 Share Posted October 25, 2014 Yes that will happen with Energia 12- it was fixed in Energia 13. If you must keep E12 just copy hardware/lm4f/cores/lm4f/main.cpp and startup_gcc.c from Energia 13 over for the fix. Note this same bug exists on the CC3200 in Energia 13, fix will appear in Energia 14 for that arch. madias 1 Quote Link to post Share on other sites
madias 0 Posted October 26, 2014 Author Share Posted October 26, 2014 Dear spirilis! Thank you for that! I thought I would go crazy, cause of that silly lines.... Everything is working yet. A need a little time for code cleanup and then I'll post the whole conversation in the "libraries" for energia! Regards Matthias 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.