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.

Pixel mapping with LCD 8x2 and MSP430

I know the LCD has  LCD_cmd for command and LCD_dat for Data. and my LCD are connected to P7 and P8 of MSP430.

I was told that when I want to draw a special character on the LCD like a "Smiley icon" I have its pattern which is sent by LCD_dat and the address of CG Ram which is sent by LCD_cmd.

But the problem is when I choose the addresses other than the below... it shows nothing! Meaning that I cannot take control of each pixel but the whole cell!!!

LCD_cmd(80)  to LCD_cmd(87)  ==> first line

LCD_cmd(C0)  to LCD_cmd(C7)  ==> first line

So, how can I take control of each pixel? I have 5x8 pixels in one cell ...and totall of 40* 16 = 640 pixel!!!

  • Yes, you have a total of 40*16 = 640 pixels. But you do not have direct control of all these pixels. Each character, i.e., what you called "cell", can only have one of 200 bit patterns or "font".

    192 of these patterns are predefined by the CGROM, they include 96 English alphabets/punctuation characters and 96 Japanese/international characters.

    The other 8 patterns are defined by the contends of the CGRAM. You need to write to the CGRAM to define them.

    Which pattern is actually shown in each of the 2*8 characters depends on the contents of the DDRAM correspond to that position. If the DDRAM content is between 0x20 and 0x7F, one of the English alphabets/punctuation character is shown at that position. If between 0xA0 and 0xFF, one of the Japanese/international characters. And if between 0x00 and 0x07, one of the CGRAM characters you defined is shown.

  • Yes, that is right but what about special pattern such as "Bell" or a "Smiley" icon? As you said I need to map them and send them to the data port of LCD.


    I got confused about the following

           LCD_cmd(0X40);       // Set DD Ram (Where to write)

       
    LCD_dat(0x0E);

       
    LCD_dat(0x1B);
      

    LCD_dat(0x11);
       
    LCD_dat(0x11);
      

    LCD_dat(0x11);
       
    LCD_dat(0x1F);

     

    I got this from the following website.

    http://www.8051projects.net/lcd-interfacing/lcd-custom-character.php

  • If you do want to show a special pattern, you may use a graphic LCD module. Please take a look at the web site, http://www.crystalfontz.com/products/graphic_lcd_tft_oled_displays.html

  • Thanks but not this much advanced. I got it to work but still struggling with showing more than a couple of special character on the display.

    p.s. I use a very simple and not advance LCD display. :)

**Attention** This is a public forum