Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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.

CCS/MSP432P401R: How can I interface MSP432 with 2x16 LCD

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello fellows,

I made a code to interact the MSP430, with the LCD, but now I would like to have it interact with the MSP432.

And I'm having some problems because I want to use specific pins, can anyone help me change the code?

My difficulty is: the MSP430 I use PORT P1 and P2, the problem is in the MSP432 I need PORT P2, P5 and P6

This is my connections LCD->MSP432:

 EN -> (P2 + BIT3)
 RS -> (P6 + BIT7)

 D4  -> (P2 + BIT6)
 D5  -> (P2 + BIT4)
 D6  -> (P5 + BIT6)

 D7  ->(P6 + BIT6)

lcd.c
 
/*****************************************************************/
/********* INCLUDE                                       *********/
/*****************************************************************/
#include "lcd.h"


/*****************************************************************/
/********* DEFINES                                       *********/
/*****************************************************************/

#define P1orP2lcd       0x0200

 #define EN              (PP2 + BIT5)
 #define RS              (PP1 + BIT3)
 #define D0              (PP2 + BIT1)
 #define D1              (PP2 + BIT2)
 #define D2              (PP2 + BIT3)
 #define D3              (PP2 + BIT4)



//#define BACKLIGHT       (PP1 + BIT0)

// Commands
#define CLEAR           0x01




/*****************************************************************/
/********* LOCAL FUNCTIONS                               *********/
/*****************************************************************/

void lcdDirPinout(unsigned int pin)
{
    if(pin < P1orP2lcd){
        P1DIR |= (pin & 0x00FF);
    }else{
        P2DIR |= (pin & 0x00FF);
    }
}


/*
 *
 */
void lcdSetPinout(unsigned int pin)
{
    if(pin < P1orP2lcd){
        P1OUT |= (pin & 0x00FF);
    }else{
        P2OUT |= (pin & 0x00FF);
    }
}

void lcdClrPinout(unsigned int pin)
{
    if(pin < P1orP2lcd){
        P1OUT &= ~(pin & 0x00FF);
    }else{
        P2OUT &= ~(pin & 0x00FF);
    }
}

void lcdSetValue(unsigned char value)
{
    if(value & 0x08){
        lcdSetPinout(D3);
    }else{
        lcdClrPinout(D3);
    }

    if(value & 0x04){
        lcdSetPinout(D2);
    }else{
        lcdClrPinout(D2);
    }

    if(value & 0x02){
        lcdSetPinout(D1);
    }else{
        lcdClrPinout(D1);
    }

    if(value & 0x01){
        lcdSetPinout(D0);
    }else{
        lcdClrPinout(D0);
    }

    delay_us(5);
}


void lcdTriggerEN() 
{
    lcdSetPinout(EN);
    delay_us(5);
    lcdClrPinout(EN);
  // delay_us(5);
}

void lcdWriteData(unsigned char data)
{
    lcdSetPinout(RS);           // Set RS to Data
    lcdSetValue(data >> 4);     // Upper nibble
    lcdTriggerEN();
    lcdSetValue(data);          // Lower nibble
    lcdTriggerEN();
    delay_us(30);               // Delay > 50 us
}

void lcdWriteCmd(unsigned char cmd)
{
    lcdClrPinout(RS);           // Set RS to Cmd
    lcdSetValue(cmd >> 4);      // Upper nibble
    lcdTriggerEN();
    lcdSetValue(cmd);           // Lower nibble
    lcdTriggerEN();
    delay_ms(2);                // Delay > 5ms
}




/*****************************************************************/
/********* GLOBAL FUNCTIONS                              *********/
/*****************************************************************/

/*
 *
 */
void LCD_PortConfig(void)
{
    // Direction
    lcdDirPinout(D0);
    lcdDirPinout(D1);
    lcdDirPinout(D2);
    lcdDirPinout(D3);
    lcdDirPinout(EN);
    lcdDirPinout(RS);
}


/*
 *
 */
void LCD_Initialize(void)
{
    delay_us(80);
    P2OUT = 0x03;      // Start LCD (send 0x03)
    lcdTriggerEN();    // Send 0x03 3 times at 5ms then 100 us
    delay_ms(2);
    lcdTriggerEN();
    delay_ms(2);
    lcdTriggerEN();
    delay_ms(2);

    P2OUT = 0x02;      // Switch to 4-bit mode
    lcdTriggerEN();
    delay_ms(2);

    lcdWriteCmd(0x28); // 4-bit, 2 line, 5x8
    lcdWriteCmd(0x08); // Instruction Flow
    lcdWriteCmd(0x01); // Clear LCD
    lcdWriteCmd(0x06); // Auto-Increment
    lcdWriteCmd(0x0C); // Display On, No blink
}


void LCD_SetText(char* text, int x, int y){
    unsigned int i;

    if (x < 16) {
        x |= 0x80;      // Set LCD for first line write
        switch (y){
        case 1:
            x |= 0x40;  // Set LCD for second line write
            break;
        case 2:
            x |= 0x60;  // Set LCD for first line write reverse
            break;
        case 3:
            x |= 0x20;  // Set LCD for second line write reverse
            break;
        }
        lcdWriteCmd(x);
    }

    i = 0;
    while (text[i] != '\0') {
        lcdWriteData(text[i]);
        i++;
    }
}

void LCD_SetInt(int val, int x, int y)
{
    char number_string[16];

    sprintf(number_string, "%d", val); // Convert the integer to character string
    LCD_SetText(number_string, x, y);
}

void LCD_Clear() 
{
    lcdWriteCmd(CLEAR);
}

void LCD_LoadSymbols(void)
{
	int j;
	static char empty[]   = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
	static char heart[]   = {0x00, 0x0A, 0x1F, 0x1F, 0x1F, 0x0E, 0x04, 0x00};
	static char bat_100[] = {0x0E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
	static char bat_75[]  = {0x0E, 0x1F, 0x11, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
	static char bat_50[]  = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x1F, 0x1F, 0x1F};
	static char bat_25[]  = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x1F, 0x1F};
	static char bat_0[]   = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F};

	lcdWriteCmd(0x40);


    for(j=0;j!=8;j++){
    	lcdWriteData(empty[j]);
    }

    for(j=0;j!=8;j++){
		lcdWriteData(heart[j]);
	}

    for(j=0;j!=8;j++){
		lcdWriteData(bat_100[j]);
	}

    for(j=0;j!=8;j++){
		lcdWriteData(bat_75[j]);
	}
    for(j=0;j!=8;j++){
		lcdWriteData(bat_50[j]);
	}
    for(j=0;j!=8;j++){
		lcdWriteData(bat_25[j]);
	}
    for(j=0;j!=8;j++){
		lcdWriteData(bat_0[j]);
	}

	lcdWriteCmd(CMD_END);
}

void LCD_SetSymbol(unsigned char symbol, unsigned char offset, unsigned char line)
{
	lcdWriteCmd(line+offset);
	lcdWriteData(symbol);
}







/*****************************************************************/
/********* END                                           *********/
/*****************************************************************/

2335.lcd.h
2630.main.c
/*****************************************************************/

/*****************************************************************/
/********* INCLUDE                                       *********/
/*****************************************************************/
#include <msp430.h>
#include "main.h"           
#include "lcd.h"                


/*****************************************************************/
/********* MAIN                                          *********/
/*****************************************************************/

    /* START MESSAGE ON LCD */
    void APP_Initialize(void){

    int i = 0;

    LCD_SetText("ECG HOLTER",3 ,0);
    LCD_SetText("START",4 ,1);
    LCD_SetSymbol(SYMB_HEART,0,ROW_ONE);



    for(i=9; i>=0; i--){
	    LCD_SetInt(i,11,1);
		delay_ms(1000);
	}
    LCD_Clear();

    LCD_SetText("PRESS SETUP",3,0);
    LCD_SetSymbol(SYMB_BAT100,0,ROW_ONE);
    }

/*
 * MAIN
 */
    int main(void){

    	WatchDogHold();
        LCD_PortConfig();
        LCD_Initialize();
        APP_Initialize();

        while(1){


        }

    }


/*****************************************************************/
/********* GLOBAL FUNCTIONS                              *********/
/*****************************************************************/

void WatchDogHold(void){
	WDTCTL = WDTPW | WDTHOLD;		// Stop watchdog timer

}


main.h

  • I read over your code and I have a few suggestions.

    1.  Change the header files msp430.h to msp432.h

    2.  Define PP5 and PP6 as you do for PP1 and PP2.

    3.  Re-define in lcd.c EN, RS, DO-D3 for the pinout you desire.

    4. Change the lcd.c functions to include logic for checking for P5/P6 just like they check for P1/P2 now.

    If you make all of these changes and still don't see the results you want or just want to learn more about it, please don't hesitate to come back and ask some more questions.

  • John P. Morrison, thank you for your attention

    I follow your proposal  and I've already made changes in all files, and I can not get the lcd to work.

    I Attached the new codes, thank you if you can help me.

    2742.lcd.c
    /*****************************************************************/
    /*********                                               *********/
    /********* AUTOR:    ANTONIO ARMANDO BIZA FERREIRA       *********/
    /********* PROJECTO: ECG                                 *********/
    /********* DATA:     01-02-2017                          *********/
    /********* IDE:      CODE COMPOSER STUDIO V5             *********/
    /********* MCU:      MSP432                                 *********/
    /*********                                               *********/
    /********* FILE:     LCD.H                               *********/
    /*********                                               *********/
    /*****************************************************************/
    
    
    /*****************************************************************/
    /********* INCLUDE                                       *********/
    /*****************************************************************/
    #include "lcd.h"
    
    /*****************************************************************/
    /********* DEFINES                                       *********/
    /*****************************************************************/
    
    #define P2orP5orP6lcd           0x0400
    
    #define EN                      (PORT2 + BIT3)
    #define RS                      (PORT6 + BIT7)
    #define D0                      (PORT2 + BIT6)
    #define D1                      (PORT2 + BIT4)
    #define D2                      (PORT5 + BIT6)
    #define D3                      (PORT6 + BIT6)
    
    /*COMMAND*/
    #define CLEAR                   0x01
    
    /*****************************************************************/
    /********* LOCAL FUNCTIONS                               *********/
    /*****************************************************************/
    
    /*LCD PIN OUT DIRECTION*/
    void lcdDirPinOut(unsigned int pin){
    
        if(pin < P2orP5orP6lcd){
    
            P2DIR |= (pin & 0x00FF);
    
        }else if(pin > P2orP5orP6lcd && pin < 0x0600){
    
            P5DIR |= (pin & 0x00FF);
    
        }else{
    
            P6DIR |= (pin & 0x00FF);
    
        }
    
    }
    
    /*LCD PIN OUT SET*/
    void lcdSetPinOut(unsigned int pin){
    
        if(pin < P2orP5orP6lcd){
    
            P2OUT |= (pin & 0x00FF);
    
        }else if(pin > P2orP5orP6lcd && pin < 0x0600){
    
            P5OUT |= (pin & 0x00FF);
    
        }else{
    
            P6OUT |= (pin & 0x00FF);
    
        }
    
    }
    
    
    /*LCD PIN OUT CLR*/
    void lcdClrPinOut(unsigned int pin){
    
        if(pin < P2orP5orP6lcd){
    
            P2OUT &= ~(pin & 0x00FF);
    
        }else if(pin > P2orP5orP6lcd && pin < 0x0600){
    
            P5OUT &= ~(pin & 0x00FF);
    
        }else{
    
            P6OUT &= ~(pin & 0x00FF);
    
        }
    
    }
    
    void lcdSetValue(unsigned char value){
         if(value & 0x08){
                lcdSetPinOut(D3);
            }else{
                    lcdClrPinOut(D3);
            }
    
            if(value & 0x04){
                lcdSetPinOut(D2);
            }else{
                lcdClrPinOut(D2);
            }
    
            if(value & 0x02){
                lcdSetPinOut(D1);
            }else{
                lcdClrPinOut(D1);
            }
    
            if(value & 0x01){
                lcdSetPinOut(D0);
            }else{
                lcdClrPinOut(D0);
            }
            delay_us(5);
    }
    
    void lcdTriggerEN(){
    
        lcdSetPinOut(EN);
        delay_us(5);
        lcdClrPinOut(EN);
      // delay_us(5);
    }
    
    void lcdWriteData(unsigned char data){
        lcdSetPinOut(RS);           // Set RS to Data
        lcdSetValue(data >> 4);     // Upper nibble
        lcdTriggerEN();
        lcdSetValue(data);          // Lower nibble
        lcdTriggerEN();
        delay_us(30);               // Delay > 50 us
    }
    
    void lcdWriteCmd(unsigned char cmd){
        lcdClrPinOut(RS);           // Set RS to Cmd
        lcdSetValue(cmd >> 4);      // Upper nibble
        lcdTriggerEN();
        lcdSetValue(cmd);           // Lower nibble
        lcdTriggerEN();
        delay_ms(2);                // Delay > 5ms
    }
    
    
    
    
    /*****************************************************************/
    /********* GLOBAL FUNCTIONS                              *********/
    /*****************************************************************/
    
    /*
     *
     */
    void LCD_PortConfig(void)
    {
        // Direction
        lcdDirPinOut(D0);
        lcdDirPinOut(D1);
        lcdDirPinOut(D2);
        lcdDirPinOut(D3);
        lcdDirPinOut(EN);
        lcdDirPinOut(RS);
    }
    
    
    /*
     *
     */
    void LCD_Initialize(void)
    {
        delay_us(80);
        P2OUT = 0x03;      // Start LCD (send 0x03)
        lcdTriggerEN();    // Send 0x03 3 times at 5ms then 100 us
        delay_ms(2);
        lcdTriggerEN();
        delay_ms(2);
        lcdTriggerEN();
        delay_ms(2);
    
        P2OUT = 0x02;      // Switch to 4-bit mode
        lcdTriggerEN();
        delay_ms(2);
    
        lcdWriteCmd(0x28); // 4-bit, 2 line, 5x8
        lcdWriteCmd(0x08); // Instruction Flow
        lcdWriteCmd(0x01); // Clear LCD
        lcdWriteCmd(0x06); // Auto-Increment
        lcdWriteCmd(0x0C); // Display On, No blink
    }
    
    
    void LCD_SetText(char* text, int x, int y){
        unsigned int i;
    
        if (x < 16) {
            x |= 0x80;      // Set LCD for first line write
            switch (y){
            case 1:
                x |= 0x40;  // Set LCD for second line write
                break;
            case 2:
                x |= 0x60;  // Set LCD for first line write reverse
                break;
            case 3:
                x |= 0x20;  // Set LCD for second line write reverse
                break;
            }
            lcdWriteCmd(x);
        }
    
        i = 0;
        while (text[i] != '\0') {
            lcdWriteData(text[i]);
            i++;
        }
    }
    
    void LCD_SetInt(int val, int x, int y)
    {
        char number_string[16];
    
        sprintf(number_string, "%d", val); // Convert the integer to character string
        LCD_SetText(number_string, x, y);
    }
    
    void LCD_Clear()
    {
        lcdWriteCmd(CLEAR);
    }
    
    void LCD_LoadSymbols(void)
    {
        int j;
        static char empty[]   = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
        static char heart[]   = {0x00, 0x0A, 0x1F, 0x1F, 0x1F, 0x0E, 0x04, 0x00};
        static char bat_100[] = {0x0E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
        static char bat_75[]  = {0x0E, 0x1F, 0x11, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
        static char bat_50[]  = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x1F, 0x1F, 0x1F};
        static char bat_25[]  = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x1F, 0x1F};
        static char bat_0[]   = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F};
    
        lcdWriteCmd(0x40);
    
    
        for(j=0;j!=8;j++){
            lcdWriteData(empty[j]);
        }
    
        for(j=0;j!=8;j++){
            lcdWriteData(heart[j]);
        }
    
        for(j=0;j!=8;j++){
            lcdWriteData(bat_100[j]);
        }
    
        for(j=0;j!=8;j++){
            lcdWriteData(bat_75[j]);
        }
        for(j=0;j!=8;j++){
            lcdWriteData(bat_50[j]);
        }
        for(j=0;j!=8;j++){
            lcdWriteData(bat_25[j]);
        }
        for(j=0;j!=8;j++){
            lcdWriteData(bat_0[j]);
        }
    
        lcdWriteCmd(CMD_END);
    }
    
    void LCD_SetSymbol(unsigned char symbol, unsigned char offset, unsigned char line)
    {
        lcdWriteCmd(line+offset);
        lcdWriteData(symbol);
    }
    
    2046.lcd.h
    5751.main.c
    /*****************************************************************/
    /*********                                               *********/
    /********* AUTOR:    ANTONIO ARMANDO BIZA FERREIRA       *********/
    /********* PROJECTO: ECG                                 *********/
    /********* DATA:     01-02-2017                          *********/
    /********* IDE:      CODE COMPOSER STUDIO V6.2           *********/
    /********* MCU:      MSP432                             *********/
    /*********                                               *********/
    /********* FILE:     MAIN.C                              *********/
    /*********                                               *********/
    /*****************************************************************/
    
    #include <msp432.h>
    #include "main.h"
    #include "lcd.h"
    
    void main(void)
    {
        volatile uint32_t i;
    
        WatchDogHold();
        LCD_PortConfig();
        LCD_Initialize();
        APP_Initialize();
        while(1){
    
        }
    
    
    }
    
    void APP_Initialize(void){
         LCD_SetText("TESTING",3 ,0);
    }
    
    void WatchDogHold(void){
         WDTCTL = WDTPW | WDTHOLD; /*STOP WATCHDOG TIMMER*/
    }
    
    3113.main.h

  • Hello,

    Two quick things.

    1.  How do you set 4-bit mode.  What is the purpose of P2OUT = 0x02 in LCD_Initialize()?  I ask because P2.2 is being written to but I didn't see any place in code where it is initialized with direction/etc.  If it is required for telling the device to use 4-bit mode, perhaps this would be the issue.

    2.  (This is just personal preference and sorry if it is being picky.)
    I'm not a fan of this: if(pin < P2orP5orP6lcd)
    It makes enough sense to understand, but I think a bitmask like below makes more intuitive sense.
    if( (pin & 0xFF00) == PORT2)
    Again, there is no difference really functionally, but it seems to me something like this is a little more straightforward to read.

    Do you have a reference document/website you use for this specific LCD for commands and how it works?

  • John,
    This code worked in my previous project, with MSP430, now I try to adapt to MSP432, with those specific pins. The second point you suggest I will adopt and will made those alterations.
  • 1856.lcd.c
    /*****************************************************************/
    /*********                                               *********/
    /********* AUTOR:    ANTONIO ARMANDO BIZA FERREIRA       *********/
    /********* PROJECTO: ECG                                 *********/
    /********* DATA:     01-02-2017                          *********/
    /********* IDE:      CODE COMPOSER STUDIO V5             *********/
    /********* MCU:      MSP432                              *********/
    /*********                                               *********/
    /********* FILE:     LCD.H                               *********/
    /*********                                               *********/
    /*****************************************************************/
    
    
    /*****************************************************************/
    /********* INCLUDE                                       *********/
    /*****************************************************************/
    #include "lcd.h"
    
    /*****************************************************************/
    /********* DEFINES                                       *********/
    /*****************************************************************/
    
    #define EN                      (PORT2 + BIT3)
    #define RS                      (PORT6 + BIT7)
    
    #define D4                      (PORT2 + BIT6)
    #define D5                      (PORT2 + BIT4)
    #define D6                      (PORT5 + BIT6)
    #define D7                      (PORT6 + BIT6)
    
    /*COMMAND*/
    #define CLEAR                   0x01
    
    /*****************************************************************/
    /********* LOCAL FUNCTIONS                               *********/
    /*****************************************************************/
    
    /*LCD PIN OUT DIRECTION*/
    void lcdDirPinOut(unsigned int pin){
    
        if((pin & 0xFF00) == PORT2){
    
            P2DIR |= (pin & 0x00FF);
    
        }else if((pin & 0xFF00) == PORT5){
    
            P5DIR |= (pin & 0x00FF);
    
        }else{
    
            P6DIR |= (pin & 0x00FF);
    
        }
    
    }
    
    /*LCD PIN OUT SET*/
    void lcdSetPinOut(unsigned int pin){
    
        if((pin & 0xFF00) == PORT2){
    
            P2OUT |= (pin & 0x00FF);
    
        }else if((pin & 0xFF00) == PORT5){
    
            P5OUT |= (pin & 0x00FF);
    
        }else{
    
            P6OUT |= (pin & 0x00FF);
    
        }
    
    }
    
    
    /*LCD PIN OUT CLR*/
    void lcdClrPinOut(unsigned int pin){
    
        if((pin & 0xFF00) == PORT2){
    
            P2OUT &= ~(pin & 0x00FF);
    
        }else if((pin & 0xFF00) == PORT5){
    
            P5OUT &= ~(pin & 0x00FF);
    
        }else{
    
            P6OUT &= ~(pin & 0x00FF);
    
        }
    
    }
    
    void lcdSetValue(unsigned char value){
    
         if(value & 0x08){
                lcdSetPinOut(D7);
            }else{
                lcdClrPinOut(D7);
            }
    
            if(value & 0x04){
                lcdSetPinOut(D6);
            }else{
                lcdClrPinOut(D6);
            }
    
            if(value & 0x02){
                lcdSetPinOut(D5);
            }else{
                lcdClrPinOut(D5);
            }
    
            if(value & 0x01){
                lcdSetPinOut(D4);
            }else{
                lcdClrPinOut(D4);
            }
            delay_us(5);
    }
    
    void lcdTriggerEN(){
    
        lcdSetPinOut(EN);
        delay_us(5);
        lcdClrPinOut(EN);
      // delay_us(5);
    }
    
    void lcdWriteData(unsigned char data){
        lcdSetPinOut(RS);           // Set RS to Data
        lcdSetValue(data >> 4);     // Upper nibble
        lcdTriggerEN();
        lcdSetValue(data);          // Lower nibble
        lcdTriggerEN();
        delay_us(30);               // Delay > 50 us
    }
    
    void lcdWriteCmd(unsigned char cmd){
        lcdClrPinOut(RS);           // Set RS to Cmd
        lcdSetValue(cmd >> 4);      // Upper nibble
        lcdTriggerEN();
        lcdSetValue(cmd);           // Lower nibble
        lcdTriggerEN();
        delay_ms(2);                // Delay > 5ms
    }
    
    
    
    
    /*****************************************************************/
    /********* GLOBAL FUNCTIONS                              *********/
    /*****************************************************************/
    
    /*
     *
     */
    void LCD_PortConfig(void)
    {
        // Direction
        lcdDirPinOut(D4);
        lcdDirPinOut(D5);
        lcdDirPinOut(D6);
        lcdDirPinOut(D7);
        lcdDirPinOut(EN);
        lcdDirPinOut(RS);
    }
    
    
    /*
     *
     */
    void LCD_Initialize(void)
    {
    
       /* delay_us(80);
        lcdWriteCmd(0x28); // 4-bit, 2 line, 5x8
        P2OUT = 0x03;      // Start LCD (send 0x03)
        lcdTriggerEN();    // Send 0x03 3 times at 5ms then 100 us
        delay_ms(2);
        lcdTriggerEN();
        delay_ms(2);
        lcdTriggerEN();
        delay_ms(2);
    
        lcdWriteCmd(0x28); // 4-bit, 2 line, 5x8
        P2OUT = 0x02;      // Switch to 4-bit mode
        lcdTriggerEN();
        delay_ms(2);*/
    
    
        lcdWriteCmd(0x28); // 4-bit, 2 line, 5x8
        lcdWriteCmd(0x08); // Instruction Flow
        lcdWriteCmd(0x01); // Clear LCD
        lcdWriteCmd(0x06); // Auto-Increment
        lcdWriteCmd(0x0C); // Display On, No blink
    }
    
    
    void LCD_SetText(char* text, int x, int y){
        unsigned int i;
    
        if (x < 16) {
            x |= 0x80;      // Set LCD for first line write
            switch (y){
            case 1:
                x |= 0x40;  // Set LCD for second line write
                break;
            case 2:
                x |= 0x60;  // Set LCD for first line write reverse
                break;
            case 3:
                x |= 0x20;  // Set LCD for second line write reverse
                break;
            }
            lcdWriteCmd(x);
        }
    
        i = 0;
        while (text[i] != '\0') {
            lcdWriteData(text[i]);
            i++;
        }
    }
    
    void LCD_SetInt(int val, int x, int y)
    {
        char number_string[16];
    
        sprintf(number_string, "%d", val); // Convert the integer to character string
        LCD_SetText(number_string, x, y);
    }
    
    void LCD_Clear()
    {
        lcdWriteCmd(CLEAR);
    }
    
    void LCD_LoadSymbols(void)
    {
        int j;
        static char empty[]   = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
        static char heart[]   = {0x00, 0x0A, 0x1F, 0x1F, 0x1F, 0x0E, 0x04, 0x00};
        static char bat_100[] = {0x0E, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
        static char bat_75[]  = {0x0E, 0x1F, 0x11, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
        static char bat_50[]  = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x1F, 0x1F, 0x1F};
        static char bat_25[]  = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x1F, 0x1F};
        static char bat_0[]   = {0x0E, 0x1F, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1F};
    
        lcdWriteCmd(0x40);
    
    
        for(j=0;j!=8;j++){
            lcdWriteData(empty[j]);
        }
    
        for(j=0;j!=8;j++){
            lcdWriteData(heart[j]);
        }
    
        for(j=0;j!=8;j++){
            lcdWriteData(bat_100[j]);
        }
    
        for(j=0;j!=8;j++){
            lcdWriteData(bat_75[j]);
        }
        for(j=0;j!=8;j++){
            lcdWriteData(bat_50[j]);
        }
        for(j=0;j!=8;j++){
            lcdWriteData(bat_25[j]);
        }
        for(j=0;j!=8;j++){
            lcdWriteData(bat_0[j]);
        }
    
        lcdWriteCmd(CMD_END);
    }
    
    void LCD_SetSymbol(unsigned char symbol, unsigned char offset, unsigned char line)
    {
        lcdWriteCmd(line+offset);
        lcdWriteData(symbol);
    }
    

    1832.lcd.h

    8360.main.c
    /*****************************************************************/
    /*********                                               *********/
    /********* AUTOR:    ANTONIO ARMANDO BIZA FERREIRA       *********/
    /********* PROJECTO: ECG                                 *********/
    /********* DATA:     01-02-2017                          *********/
    /********* IDE:      CODE COMPOSER STUDIO V6.2           *********/
    /********* MCU:      MSP432                             *********/
    /*********                                               *********/
    /********* FILE:     MAIN.C                              *********/
    /*********                                               *********/
    /*****************************************************************/
    
    #include <msp432.h>
    #include "main.h"
    #include "lcd.h"
    
    void main(void)
    {
        volatile uint32_t i;
    
        WatchDogHold();
        LCD_PortConfig();
        LCD_Initialize();
        APP_Initialize();
        while(1){
    
        }
    
    
    }
    
    void APP_Initialize(void){
         LCD_SetText("TESTING",3 ,0);
    }
    
    void WatchDogHold(void){
         WDTCTL = WDTPW | WDTHOLD; /*STOP WATCHDOG TIMMER*/
    }
    

    8360.main.h

    Friends,

    I have solved my problem and the LCD is now working, I now leave the code in order to help another MSP432 developer. I also leave a special thanks to John for all his contribution. Their tips were a huge help

**Attention** This is a public forum