wayfarerbasta 0 Posted February 8, 2015 Share Posted February 8, 2015 Hi community, I have a problem using the LCD_5110 Display library with my CC3200 Launchpad. The Compiler does not throw any error but the main Example sketch is not working. The Display just stay white like dead. I double checked the pin configuration but I con not find the problem. With the example Sketch: https://github.com/sparkfun/GraphicLCD_Nokia_5110/blob/master/Firmware/Nokia_5110_Arduino_Example/Nokia_5110_Arduino_Example.ino everything works fine but with the same pin configuration and wiring the example sketch https://github.com/energia/Energia/blob/master/examples/7.Display/LCD_5110/Examples/LCD_5110_main/LCD_5110_main.ino Is not working at all. I use the following pin configuration: LCD_5110::LCD_5110() { // pins names in MSP430G2553LCD_5110(6, // P2_2 Chip Select3, // P2_4 Serial Clock4, // P2_0 Serial Data5, // P2_3 Data/Command7, // P1_0 Reset2, // P2_1 BacklightPUSH2); // Push Button 2} Does anybody have some advice for me? Quote Link to post Share on other sites
Rei Vilo 695 Posted February 8, 2015 Share Posted February 8, 2015 Hi! Why aren't you using the LCD_5110_SPI library instead? The LCD_5110 library use software-emulated SPI while the LCD_5110_SPI uses hardware SPI. Here are some excerpts from Some Misconceptions about Libraries that apply to the LCD_5110 library. The libraries are plug-and-play as I'm using them in my projects. However, they are designed for a specific configuration. [...] With so many LaunchPads, BoosterPacks and components possible combinations, the one-fits-all approach is just impossible. [...] Even if the library works out of the box, they are provided as examples and require some work from the user. This is the best way for learning. [...] With new hardware and software releases coming out, a library may suffer from obsolescence. It used to work with a prior version but no longer works with the new one. [...] Quote Link to post Share on other sites
wayfarerbasta 0 Posted February 9, 2015 Author Share Posted February 9, 2015 Hi, I even tried to use the LCD_5110_SPI library but I have the same problem. I don't get any functionality at all (same like with LCD_5110). Of course I modified the LCD_5110_SPI_main.ino sketch as follows and I don't get any compile error or warning. /// /// @mainpage Nokia LCD 5110 SPI /// /// @details Library for Nokia 5110 LCD with hardware SPI /// @n /// @n /// @n @a Developed with [embedXcode](http://embedXcode.weebly.com) /// /// @author Rei VILO /// @author embedXcode.weebly.com /// @date Jan 12, 2013 /// @version 105 /// /// @copyright © Rei VILO, 2012 /// @copyright CC = BY NC SA /// /// @see ReadMe.txt for references /// /// /// @file LCD_5110_SPI_main.ino /// @brief Main sketch /// /// @details Example for library for Nokia 5110 LCD with hardware SPI /// @n @a Developed with [embedXcode](http://embedXcode.weebly.com) /// /// @author Rei VILO /// @author embedXcode.weebly.com /// @date Jan 12, 2013 /// @version 105 /// /// @copyright © Rei VILO, 2012 /// @copyright CC = BY NC SA /// /// @see ReadMe.txt for references /// @n /// #include "Energia.h" // Core library for code-sense #if defined(WIRING) // Wiring specific #include "Wiring.h" #elif defined(MAPLE_IDE) // Maple specific #include "WProgram.h" #elif defined(MPIDE) // chipKIT specific #include "WProgram.h" #elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific #include "Energia.h" #elif defined(CORE_TEENSY) // Teensy specific #include "WProgram.h" #elif defined(ARDUINO) && (ARDUINO >= 100) // Arduino 1.0 and 1.5 specific #include "Arduino.h" #elif defined(ARDUINO) && (ARDUINO < 100) // Arduino 23 specific #include "WProgram.h" #else // error #error Platform not defined #endif // Include application, user and local libraries #include "SPI.h" #include "LCD_5110_SPI.h" // Variables /// P._. / PB_4 = SCK (2) = Serial Clock /// P._. / PB_7 = MOSI (2) = Serial Data /*#if defined(__MSP430G2553__) LCD_5110_SPI myScreen; #elif defined(__LM4F120H5QR__) LCD_5110_SPI myScreen(PA_7, // Chip Select PA_2, // Data/Command PB_5, // Reset PA_6, // Backlight PUSH2); // Push Button 2 #endif*/ LCD_5110_SPI myScreen; boolean backlight = false; uint8_t k = 0; // Add setup code void setup() { //#if defined(__MSP430G2553__) Serial.begin(115200); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV16); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE0); /*#elif defined(__LM4F120H5QR__) SPI.Select(2); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV128); // for LM4F120H5QR DIV2 = 4 MHz ! #endif*/ myScreen.begin(); myScreen.setBacklight(backlight); myScreen.text(0, 0, "Hello!"); delay(1000); myScreen.clear(); myScreen.text(0, 5, "Light off"); Serial.println("Setup finshed!"); } // Add loop code void loop() { Serial.println("Loop start"); if (myScreen.getButton()) { backlight = (backlight==0); myScreen.setFont(0); myScreen.text(0, 5, backlight ? "Light on " : "Light off"); myScreen.setBacklight(backlight); } myScreen.setFont(1); myScreen.text(0, 2, " MSP430"); //if (k==0) myScreen.text(0, 2, " MSP430"); //else if (k==8) myScreen.text(0, 2, " LM4F "); myScreen.setFont(0); //for (uint8_t i=0; i<14; i++) myScreen.text(i, 4, (i==k) ? "*" : " "); //k ++; //k %= 14; delay(200); Serial.println("Loop end"); } I added some debug print commands to find out what is wrong. It seems that the sketch will stuck anywhere in the main loop because I only get the debug messages "Setup finished" and "Loop start" but the loop is no loop ("Loop start" is printet only once). The LCD_5110_SPI.cpp is modified according to my wireing: // 2015-02-07 Rei Vilo // Pins numbers instead of pins names LCD_5110_SPI::LCD_5110_SPI() { // pins names in MSP430G2553 LCD_5110_SPI(18, // P2_2 Chip Select 17, // P2_3 Data/Command 19, // P1_0 Reset 2, // P2_1 Backlight PUSH2); // Push Button 2 } The other pins of the display are connect: Display, CLK --> pin 7, SCK Display, DIN --> pin 15, MOSI Display, GND --> pin 22, GROUND Display, VCC --> pin 1, 3,3V I hope somebody can help me. Quote Link to post Share on other sites
serdarq 1 Posted May 24, 2016 Share Posted May 24, 2016 @wayfarerbasta@Rei Vilo hey guys, I have tried the same library but even i comment all the lines Rei said the compiler gives the same error ? and shouldnt i add some codes to introduces my MCU like: #elif defined(__TM4C1294NCPDT__) LCD_5110_SPI myScreen(PQ_1, // Chip Select PQ_2, // Data/Command PK_7, // Reset PK_6, // Backlight USR_SW1); // Push Button 2 Quote Link to post Share on other sites
Rei Vilo 695 Posted June 16, 2016 Share Posted June 16, 2016 As the CC3200 runs faster than the MSP430, lower the speed, e.g. SPI_CLOCK_DIV128. 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.