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.

MSP430fg4618 experimenters board LCD Programming

Other Parts Discussed in Thread: MSP430FG4618

Can anybody please tell me how to program the LCD given in the given msp430fg4618 board ,?? I am stuck at it ..

Please provide me a C- Code for displaying character and strings on LCD ..

Thanks in advance 

  • Vasuki soni said:
    msp430fg4618 board

    You mean this:

     

    Vasuki soni said:
    I am stuck at it ..

    What, exactly, have you tried?

    Where, exactly, are you stuck?

    Have you studied all the documentation provided: http://www.ti.com/tool/msp-exp430fg4618

  • Yes this board only sir .

    Actually i have tried to study a lot about LCD programming in this board  , i m a beginner to this board . So i m not getting how does the LCD work in this board ,

    thus i just wanted a code like for printing a string . or a character so that i can get a start over its programming .I have tried lots of code available over internet

    U can help me by giving me a code .

    I m currently working on Code composer studio software 

    Thank u sir  :)

  • Vasuki soni said:
    i m a beginner to this board

    Do you really mean that you're a beginner to programming?

    Here are some links for getting started with programming: http://bit.ly/X5Atml

  • No sir , i m good at embedded programming , but i am not getting any clue how to interface LCD in this board , because no any details of the connections of LCD are given in the data sheets . 

  • mordhwaj patel said:
    i m good at embedded programming

    But what happened to Vasuki soni - to whom that question was directed ?

  • mordhwaj patel said:
    i m good at embedded programming , but i am not getting any clue how to interface LCD in this board

    Really?!

    I've just downloaded the User Guide and the board software zip file from http://www.ti.com/tool/msp-exp430fg4618

    In the User Guide, it tells you, on page 4:

    6.1.1 4-Mux LCD Display

    The integrated SoftBaugh SBLCDA4 LCD display supports 4-MUX operation and interfaces to the LCD driver peripheral of the MSP430FG4618.

    More information on the LCD can be obtained from the manufacturer’s datasheet

    The zip file has a folder called "LCD"

    That folder contains a file called LCD.c which contains functions with names like "dispChar" - with a clear comment saying, "Display character on LCD"

    Therre is also a document called "Instructions.pdf"

    What more do you want?!

     

  • #include <msp430fg4618.h>

    typedef unsigned char UInt8;

    // LCD Constants
    #define LCD_MEM_OFFSET 2 // Offset from LCDMEM[0]
    #define LCD_MEM_LOC 11 // Num of LCDMEM[] locations used

    // LCD Segments
    #define LCD_A 0x01
    #define LCD_B 0x02
    #define LCD_C 0x04
    #define LCD_D 0x08
    #define LCD_E 0x40
    #define LCD_F 0x10
    #define LCD_G 0x20

    #define COLON3 0x80

    UInt8 liveTime; //Keep track of processing time.

    // LCD Segment Mapping
    const UInt8 LCD_Char_Map[] =
    {
    LCD_A+LCD_B+LCD_C+LCD_D+LCD_E+LCD_F, // '0'
    LCD_B+LCD_C, // '1'
    LCD_A+LCD_B+LCD_D+LCD_E+LCD_G, // '2'
    LCD_A+LCD_B+LCD_C+LCD_D+LCD_G, // '3'
    LCD_B+LCD_C+LCD_F+LCD_G, // '4'
    LCD_A+LCD_C+LCD_D+LCD_F+LCD_G, // '5'
    LCD_A+LCD_C+LCD_D+LCD_E+LCD_F+LCD_G, // '6'
    LCD_A+LCD_B+LCD_C, // '7'
    LCD_A+LCD_B+LCD_C+LCD_D+LCD_E+LCD_F+LCD_G, // '8'
    LCD_A+LCD_B+LCD_C+LCD_F+LCD_G, // '9'
    };

    void dispChar(UInt8 pos, UInt8 index) { // Display character on LCD
    LCDMEM[pos + LCD_MEM_OFFSET] = LCD_Char_Map[index]; // Set segments (but not DP)
    }

    void initLCD_A(void) // Initialize LCD_A
    {
    int i;

    // Clear LCD memory
    for(i = LCD_MEM_OFFSET; i < (LCD_MEM_OFFSET+LCD_MEM_LOC); i++) {
    LCDMEM[i] = 0;
    }

    // Configure COM0-COM3 and R03-R33 pins
    P5SEL |= (BIT4 | BIT3 | BIT2);
    P5DIR |= (BIT4 | BIT3 | BIT2);

    // Configure LCD_A
    LCDACTL = LCDFREQ_128 | LCDMX1 | LCDMX0 | LCDSON | LCDON;
    LCDAPCTL0 = LCDS4 | LCDS8 | LCDS12 | LCDS16 | LCDS20 | LCDS24;
    LCDAPCTL1 = 0;
    LCDAVCTL0 = LCDCPEN;
    LCDAVCTL1 = VLCD_2_60;
    }


    main () {
    UInt8 sec1=0, sec10=0, min=0; // Seconds, Tens of Seconds, and minutes

    WDTCTL = WDTPW + WDTHOLD; // Stop WDT
    FLL_CTL0 |= XCAP18PF; // Set load cap for 32k xtal

    BTCTL = BT_fCLK2_DIV128 | BT_fCLK2_ACLK_DIV256; // Set to 32768/(256*128) = 1 Hz
    IE2 |= BTIE; // Enable BT interrupt

    P2DIR |= BIT2; // Bit for LED

    initLCD_A(); // Initialize LCD

    while (1) {
    liveTime = BTCNT2; // Value of BTCNT2 measures time since interrupt.

    _BIS_SR(LPM3_bits + GIE); // LPM3, enable interrupts
    P2OUT = BIT2; // Turn on P2.2 (LED)

    if (++sec1>9) { // Increment seconds and check for rollover
    sec1=0; // into 10's of seconds. If so, set sec1=0 and...
    if (++sec10>5) { // Increment seconds and check for rollover
    sec10=0; // into minutes. If so, set sec10=0 and...
    if (++min>9) min=0; // Increment minutes and check for rollover.
    }
    }
    dispChar (1,sec1); // Display seconds
    dispChar (2,sec10); // Display 10's of seconds
    dispChar (3,min); // Display minutes

    LCDMEM[2 + LCD_MEM_OFFSET] ^= COLON3; // Toggle colon.

    P2OUT &= ~BIT2; // Turn off P2.2 (LED)
    }
    }

    // Basic Timer Interrupt Service Routine
    #pragma vector=BASICTIMER_VECTOR
    __interrupt void basic_timer_ISR(void) {
    _bic_SR_register_on_exit(LPM3_bits);
    }

**Attention** This is a public forum