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.

Interfacing 16x2 Lcd with TM4C123GH6PZ

Other Parts Discussed in Thread: TM4C123GH6PZ

Hi..i'm interfacing 16x2 lcd with TM$C123gh6pz..Is their any driver function in tiva ware series??If not how to access the Gpio pins for selecting the RS,Rw,En,D0-D7(PH0,PH7,PH1,PG0-PG7)??please help me

Thanks n Regards

Raaki ponki 

  • Hello Raski,

    Please check the following thread

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/352472/1237790.aspx#1237790

    Regards

    Amit

  • Thank you..i'm not getting some points.In the  below macro defintion,i'm not getting meaning for these register.In which document it has been defined???

    #define GPIO_PORTG_DATA_BITS_R ((volatile unsigned long *)0x40026000)
    #define GPIO_PORTG_DATA_R (*((volatile unsigned long *)0x400263FC))
    #define GPIO_PORTG_DIR_R (*((volatile unsigned long *)0x40026400))
    #define GPIO_PORTG_IS_R (*((volatile unsigned long *)0x40026404))
    #define GPIO_PORTG_IBE_R (*((volatile unsigned long *)0x40026408))
    #define GPIO_PORTG_IEV_R (*((volatile unsigned long *)0x4002640C))
    #define GPIO_PORTG_IM_R (*((volatile unsigned long *)0x40026410))
    #define GPIO_PORTG_RIS_R (*((volatile unsigned long *)0x40026414))
    #define GPIO_PORTG_MIS_R (*((volatile unsigned long *)0x40026418))
    #define GPIO_PORTG_ICR_R (*((volatile unsigned long *)0x4002641C))
    #define GPIO_PORTG_AFSEL_R (*((volatile unsigned long *)0x40026420))
    #define GPIO_PORTG_DR2R_R (*((volatile unsigned long *)0x40026500))
    #define GPIO_PORTG_DR4R_R (*((volatile unsigned long *)0x40026504))
    #define GPIO_PORTG_DR8R_R (*((volatile unsigned long *)0x40026508))
    #define GPIO_PORTG_ODR_R (*((volatile unsigned long *)0x4002650C))
    #define GPIO_PORTG_PUR_R (*((volatile unsigned long *)0x40026510))
    #define GPIO_PORTG_PDR_R (*((volatile unsigned long *)0x40026514))
    #define GPIO_PORTG_SLR_R (*((volatile unsigned long *)0x40026518))
    #define GPIO_PORTG_DEN_R (*((volatile unsigned long *)0x4002651C))
    #define GPIO_PORTG_LOCK_R (*((volatile unsigned long *)0x40026520))
    #define GPIO_PORTG_CR_R (*((volatile unsigned long *)0x40026524))
    #define GPIO_PORTG_AMSEL_R (*((volatile unsigned long *)0x40026528))
    #define GPIO_PORTG_PCTL_R (*((volatile unsigned long *)0x4002652C))
    #define GPIO_PORTG_ADCCTL_R (*((volatile unsigned long *)0x40026530))
    #define GPIO_PORTG_DMACTL_R (*((volatile unsigned long *)0x40026534))
    #define GPIO_PORTG_SI_R (*((volatile unsigned long *)0x40026538))

    Thanks n Reg

  • Hello Raski,

    These are defined in the header file inc/tm4c123gh6pz.h

    But I would suggest that instead of using direct address method, use the TIVAWare API's. The could would be more readable and manageable.

    Regards

    Amit

  • k..In that link they have used direct register what you sent me previously.

    void lcd_DATA_Write(char data)

    {

    GPIO_PORTB_DATA_R=data;

    GPIO_PORTE_DATA_R|=(1<<5); //RS=1

    GPIO_PORTE_DATA_R&=~((1<<4)|(1<<3)); //R/W=0, E=0

    SysTick_Wait(96); // 6us


    GPIO_PORTE_DATA_R|=(1<<3);//E=1

    SysTick_Wait(96); // 6us

    GPIO_PORTE_DATA_R &=~(1<<3); // E=0 to produce a falling edge

    SysTick_Wait(640); // 40us mandatory delay for the command to execute

    }

    n i didn't find any APIS will support for 16x2 LCd in driver library of tiva ware.

  • Hello Raski,

    The API's to support a 16x2 LCD have to built from the basic API's.

    The link that I had sent used Direct Register method (which is something that creates a lot of issues if you are not well familiar with the device functions).

    Regards

    Amit

  • k...you meant to say ,i suppose to use gpio APIs for configuring the  16x2 LCD???

  • Hello Raaki

    Yes. That is correct. The forum (and me ) can help in moving over the existing code to API's based implementation, if you could make a start with the basic code.

    Regards

    Amit

  • K Thank you..Now i'll try to display some  character on LCD..i'l ask your support if i didn't get the output..

    Best Regards

    Raaki

  • HI..i'm not using any APIi function for LCD..Directly i'm writing to register address ..now i can able to display on LCD.i just defined in macros.

    #define E 1 /*PH0*/
    #define RS 2 /*PH1*/
    #define LCDDATA (*((volatile unsigned long *)0x400043FC)) /*PortA*/
    #define LCDCMD (*((volatile unsigned long *)0x400273FC))/*portH*/

    Regards

    Raaki ponki