This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C1294XL and LCD how to

Hello,

So first off I am having some problems starting up the Tiva C Connected Launchpad (TM4C1294XL). I have CCS downloaded and DLed the tiva rtos add on as well. Bare with me, im new to this stuff and this is for a school project. 

However I cannot seem to get a program running on the Tiva C. 

I also have the LCD from Kentac Display that is compatible with the Tiva C and I need to connect them properly in order to begin programming the correct UI needed for my project. 

All the help is needed and greatly appreciated. 

Thank you.

  • Hello Daniel,

    You are new and went to TI-RTOS? I would have thought it would be better to start with bare metal examples from TivaWare.

    The next release of TivaWare will have the Kentec LCD Boosterpack driver and code examples. So please wait.

    Regards
    Amit
  • Amit,

    Amit Ashara said:


    You are new and went to TI-RTOS? I would have thought it would be better to start with bare metal examples from TivaWare.

    ha. yes I was following a tutorial online. Im an EE student and I haven't worked with too much with setting up the boards. At the school everything is pretty much setup (we use the MSP430 for a class or two) and any instructions are given to us in a lab manual for a specific assignment when dealing with CCS. 

    However, I did some snooping and found what was necessary to run the demos on the LCD boosterpack.  Now I'm just working on configuring the Tiva Connect Launchpad properly to CCS. Then will be to start dabbling with the touch interface and the widgets. Are you aware of any source code examples (besides the ones loaded with TivaWare) that would help explain how to create/manipulate widgets, colors, text, fonts, etc?

    Thank you for the help it is greatly appreciated.

    /*Dan

  • Hello Dan,

    First of all there is no Editor that would allow to create widgets, colors, text, fonts, etc. Most of them have been built by hand and integrated into applications. There are some professional GUI creators but I don't know if any of them support TM4C yet (and of course the cost of licensing).

    What is important is that you have start simple. Start with creating an application that requires a simple UI on the LCD panel. Example Temp monitoring using the ADC and displaying the data. Then add brightness control so that the touch interface can be integrated to control the PWM for brightness control.

    To understand the grlib better, work with the bare metal examples first.

    Regards
    Amit
  • Amit,

    Thank you. I am reading through the grlib demo code right now. I would like to manipulate it by copying and pasting into a new project main.c. However, I keep coming up with this error that the compiler cannot open the source file for the "#include drivers/kentec320x240...h." I tried to include the directory in the "Include Options" by right clicking on my project in Project Explorer. Before that I tried to create a folder called drivers and then add the kentec.h file to it but the compiler did not do take to that either. Do you know how I can fix this?

    Thank you

    /Dan
  • Hello Dan

    You would need to import the source file for the driver for compilation. Also use Clean project and then Rebuild project. It would be rather simpler importing an existing example and using that as a template for modifications. I do it all the time... Saves me minutes of debug on something absolutely avoidable...

    Regards
    Amit
  • Hey Amit,

    Thank you, that made the job much easier.

    So now I have another question. Is there a pamphlet or some material that can explain the array index for the lcd screen?

    I'm trying to adjust/change/modify the color and structure of some of the widgets that they have made but looking into the exact const for the widget, it is a huge array with varitey of hex values and im not sure what ones are valid and what exactly it is doing. the code is not really commented. 

    For instance, in the grlib demo they have blue push buttons but I want to change them to black or yellow and make it bigger. I also realized that the main canvas paints over almost everything and if I can hide one of the buttons on one of the panels, it will make the UI easy as I can just say "Tap anywhere to begin" etc without having to create a new function.

    Thank you.

    /Dan

  • Hello Dan

    Look at the definition of the RectangularButtonStruct which will tell which parameter corresponds to the color. Also note if the PB_STYLE_IMG is used then there is an associated image from which the button is text, else it is drawn.

    Regards
    Amit
  • Amit,

    RectangularButtonStruct(g_psPanels + 5, g_psPushButtonIndicators, 0,

    &g_sKentec320x240x16_SSD2119, 130, 110, 50, 50,

    (PB_STYLE_IMG | PB_STYLE_TEXT |
    PB_STYLE_AUTO_REPEAT), 0, 0, 0, ClrSilver,
    &g_sFontCm22, "6", g_pui8Blue50x50,
    g_pui8Blue50x50Press, 125, 25, OnButtonPress)

    g_pui8Blue50x50 is a constant which is the function I would like to make larger. I tried to change the 50,0 50,0 to 60,0 60,0 but then there were missing pixels. 

    Im having a hard time finding what IMAGE_FMT.. is too not sure what that means. 

    const uint8_t g_pui8Blue50x50[] =
    {
    IMAGE_FMT_4BPP_COMP,
    50, 0,
    50, 0,

    15,
    0x00, 0x00, 0x00,
    0x23, 0x00, 0x00,
    0x52, 0x00, 0x00,
    0x63, 0x00, 0x00,
    0x6f, 0x00, 0x00,
    0x78, 0x00, 0x00,
    0x7c, 0x00, 0x00,
    0x7d, 0x00, 0x00,
    0x7f, 0x00, 0x00,
    0x81, 0x00, 0x00,
    0x85, 0x00, 0x00,
    0x89, 0x00, 0x00,
    0x8d, 0x00, 0x00,
    0x93, 0x00, 0x00,
    0x9b, 0x00, 0x00,
    0xa9, 0x00, 0x00,

    0x81, 0x03, 0x13, 0x9e, 0xfe, 0xff, 0xff, 0xff, 0xe9, 0x8a, 0xd1, 0xfe,
    0xd7, 0x31, 0x07, 0x2e, 0x51, 0xee, 0x35, 0xee, 0xee, 0xe9, 0xd4, 0xa2,
    0x35, 0x1e, 0x41, 0x41, 0xfe, 0x3f, 0xee, 0xee, 0xdd, 0xcc, 0x91, 0x33,
    0x40, 0x03, 0x41, 0xee, 0xee, 0xed, 0xdd, 0xdd, 0xdd, 0xc1, 0xe9, 0xd1,
    0xdc, 0xcd, 0xcc, 0xaa, 0x20, 0x32, 0x41, 0x3f, 0x41, 0xed, 0xdc, 0xcc,
    0xcc, 0xcc, 0xe9, 0x81, 0xd1, 0xbb, 0xbb, 0xcc, 0xcb, 0xba, 0x52, 0x39,
    0x40, 0x03, 0x42, 0xcc, 0xba, 0xaa, 0x99, 0x99, 0x99, 0xc0, 0xe9, 0xd1,
    0xaa, 0xaa, 0xab, 0xa9, 0x95, 0x20, 0x04, 0x00, 0x00, 0x1f, 0xff, 0xfe,
    0x41, 0x99, 0x98, 0x1c, 0x88, 0x88, 0x88, 0xe9, 0xd1, 0x29, 0x99, 0x98,
    0x00, 0x41, 0x00, 0x00, 0xef, 0xff, 0xee, 0xdc, 0xba, 0x60, 0x99, 0x4f,
    0x01, 0x89, 0x99, 0x99, 0x98, 0x53, 0x01, 0x00, 0x02, 0xff, 0xfe, 0xed,
    0xcb, 0xa9, 0x47, 0x80, 0x35, 0x98, 0x64, 0x10, 0x0d, 0xef, 0xee, 0xdc,
    0x30, 0xba, 0x98, 0x3f, 0x04, 0x99, 0x88, 0x54, 0x30, 0x06, 0x1e, 0xfe,
    0xed, 0xcb, 0xa9, 0x47, 0x06, 0x86, 0x01, 0x55, 0x41, 0x3e, 0xfe, 0xed,
    0xba, 0x98, 0x3f, 0x81, 0x3f, 0x65, 0x41, 0x5e, 0xee, 0xdc, 0xb9, 0x47,
    0x80, 0x07, 0x88, 0x65, 0x42, 0xbd, 0xee, 0xdb, 0xa9, 0xe1, 0x3f, 0x3f,
    0x39, 0xcc, 0xed, 0xcb, 0x98, 0x3f, 0x81, 0x3f, 0x88, 0x65, 0x43, 0xcc,
    0xdd, 0xca, 0x3f, 0xc3, 0x3f, 0x39, 0x42, 0xcb, 0xdc, 0xba, 0x3f, 0x3f,
    0xb0, 0x3c, 0xb9, 0x47, 0x07, 0x88, 0x88, 0x75, 0x32, 0x18, 0xcb, 0xdc,
    0xa9, 0x3f, 0x07, 0x88, 0x88, 0x65, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
    0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
    0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f,
    0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
    0x3f, 0x3f, 0x3f, 0xf8, 0x3f, 0x3f, 0x3f, 0x07, 0x01, 0x64, 0x32, 0xcb,
    0x73, 0xcc, 0x3f, 0x3f, 0x3b, 0x9b, 0xcb, 0x3f, 0x07, 0x00, 0x88, 0x88,
    0x87, 0x54, 0x32, 0x4a, 0xba, 0x99, 0x60, 0x98, 0x37, 0x07, 0x86, 0x54,
    0x32, 0x2a, 0xaa, 0x60, 0xa9, 0x47, 0x07, 0x88, 0x75, 0x43, 0x21, 0x19,
    0x30, 0x8a, 0x99, 0x3f, 0x07, 0x88, 0x65, 0x43, 0x21, 0x0c, 0x04, 0x49,
    0x98, 0x98, 0x37, 0x06, 0x86, 0x54, 0x06, 0x33, 0x20, 0x02, 0x46, 0x68,
    0x47, 0x07, 0x76, 0x01, 0x54, 0x32, 0x10, 0x00, 0x44, 0x66, 0x66, 0x2f,
    0x80, 0x05, 0x87, 0x65, 0x43, 0x32, 0x00, 0x00, 0x13, 0x18, 0x45, 0x55,
    0x66, 0x3f, 0x04, 0x66, 0x54, 0x33, 0x00, 0x21, 0x00, 0x00, 0x01, 0x34,
    0x45, 0x56, 0x66, 0x60, 0x78, 0x2f, 0x01, 0x76, 0x54, 0x43, 0x32, 0x10,
    0x01, 0x00, 0x00, 0x00, 0x12, 0x44, 0x45, 0x55, 0x37, 0x82, 0x01, 0x66,
    0x55, 0x44, 0x33, 0x21, 0x41, 0x00, 0x00, 0x01, 0x23, 0x44, 0x44, 0x55,
    0x56, 0x66, 0x66, 0x60, 0x66, 0xe9, 0xd1, 0x65, 0x54, 0x44, 0x33, 0x22,
    0x40, 0x10, 0x3a, 0x00, 0x12, 0x33, 0x34, 0x44, 0x44, 0x61, 0x44, 0xe9,
    0xd4, 0x43, 0x33, 0x22, 0x21, 0x43, 0x86, 0x31, 0x23, 0x33, 0x33, 0x33,
    0xe9, 0xd4, 0x32, 0x80, 0x47, 0x00, 0x00, 0x01, 0x12, 0x22, 0x22, 0x22,
    0xc8, 0xe9, 0xd3, 0x21, 0x10, 0x43,
    };

    By observation, this array is huge and I dont know what exactly is going on with all these hex values but I do understand that they are addresses to certain pixels but not sure if they are giving off different shades of blue because tthe button color is not entirely consistent.

  • Hello Daniel

    This is the PNM format. You can take an image or create an image in Paint, use online tools to convert it to PNM format. Then use the PNMTOC.exe in TivaWare to get the const uint8_t for the c/h file.

    Do note that the BPP must not exceed 8BPP.

    Regards
    Amit
  • Hey Amit,

    long time, miss me?

    I have a question. I would like to setup a delay so that after 10 seconds the gui panel will switch to another gui panel. Im having trouble finding the util command for this specific delay in the tiva libraries. any clue?

    thank you

    -Dan

  • Hi Dan,

    Are you referring to the void SysCtlDelay(uint32_t ui32Count) API? Note that this will give you a delay of 3 cycles * ui32Count but the accuracy of the delay can be impacted by interrupts (see full description and cautions in the driver lib user guide, spmu298a.

    If you want to use a more accurate timer, you may want to consider use of the RTC.

    Let me know if you have any additional questions.

    Finally, although I have answered your new question here (or at least started the discussion), I would request that next time you open a new post given it is a question that is of a different topic than the original question of the thread. This is so others can search and make use of the answers to help them solve their problems thus making the E2E that much more efficient for everyone. Thanks!
  • Chuck,

    Thank you, that worked. 

    My apologies on the re-use of the thread.

    Regards,

    Dan

  • Daniel,

    No need for apologies. Just more of a tip for future reference and faster/better support!
  • Hi,
    I am using TM4C1294XL for my project.i need an 7inch TFT LCD interface for TM4C1294XL.Would you please suggest me LCD and its respective code that runs on TM4c1294xl.
  • Whats up K!

    Here's a link to the 3.5" LCD resistive touch that I used for my project.

    https://www.newark.com/kentec-electronics/eb-lm4f120-l35/exp-board-lcd-boosterpack-stellaris/dp/48W2063?COM=referral-noscript

    You might be able to find a 7" LCD screen for it.

    TI has an SDK for the Tiva with a graphics library included. I'm not sure if its compatible with a 7" LCD screen you will have to find that out. 

    http://www.ti.com/tool/SW-EK-TM4C1294XL?keyMatch=TM4C1294XL&tisearch=Search-EN-Everything

    I believe TI did make a 7" LCD but I was not able to find one for my project so I went with the 3.5". If you do find one, let me know I'd like to make a nice thermostat for my house.