nokia7110 LCD display Chinese characters

Publisher:legend8Latest update time:2016-08-21 Source: eefocusKeywords:nokia7110  LCD Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
  nokia7110 LCD display Chinese characters - liuyunqian@yeah - Embedded Learning

 

As for the lines that appear in the lower right corner of the screen, it may be a bug in proteus

 

The procedure is as follows

#include
#include "stdio.h"
#define uchar unsigned char 
#define uint unsigned int

#define CLR_CS PORTD&=~(1<<0)
#define SET_CS PORTD|=(1<<0)

#define CLR_DC PORTD&=~(1<<1) //low for Control data high for Display data
#define SET_DC PORTD|=(1<<1)

#define CLR_RESET PORTD&=~(1<<2)
#define SET_RESET PORTD|=(1<<2)

uchar HZ[][32]={{0xFF,0xBF,0x4D,0x69,0x65,0x6D,0x09,0x65,0x6C,0x6E,0x66,0x68,0x6E,0x6F,0xCF,0xFF,0xBF,0xDF,0x5F,0x6F, 0xB3,0xB8,0xD5,0xD5,0xED,0xE5,0xD9,0xDD,0xBF,0x3F,0xBF,0xFF},/*"爱",0*/

{0xDF,0xDF,0xDD,0xDD,0x01,0xDE,0xDE,0xDF,0xDF,0x00,0xDF,0xDD,0x53,0xDF,0xDF,0xFF,0xFB,0xFB,0xBD,0x7D,0x80,0xFE,0xFE,0xEF,0xEF,0xF7,0xF8,0xE5,0xDE,0xBF,0x0F,0xFF},/*"我",1*/

{0xFF,0xFF,0x03,0xF7,0xF7,0xF7,0xF7,0x00,0xF7,0xF7,0xF7,0xF7,0x03,0xF7,0xFF,0xFF,0xFF,0xFF,0xF8,0xFD,0xFD,0xFD,0xFD,0x00,0xFD ,0xFD,0xFD,0xFD,0xF8,0xFF,0xFF,0xFF},/*"中",2*/

{0xDF,0xEF,0xF7,0x03,0xFC,0xFD,0xEF,0xEF,0x80,0x77,0x77,0x7B,0x79,0x1B,0xFF,0xFF,0xFF,0xFB,0xFB,0xFA,0xFB,0xFB,0xFB,0x00,0xFB ,0xFB,0xFB,0xFB,0xFB,0xFB,0xFB,0xFF},/*"华",3*/

{0xDF,0xDF,0xDD,0xDD,0x01,0xDE,0xDE,0xDF,0xDF,0x00,0xDF,0xDD,0x53,0xDF,0xDF,0xFF,0xFB,0xFB,0xBD,0x7D,0x80,0xFE,0xFE,0xEF,0xEF,0xF7,0xF8,0xE5,0xDE,0xBF,0x0F,0xFF},/*"我",4*/

{0xFF,0x07,0x73,0x74,0x77,0x07,0xBF,0xCF,0x70,0xF7,0xF7,0xF7,0x07,0xFF,0xFF,0xFF,0x80,0xEF,0xEF,0xEF,0xC0,0xFF,0xFF,0xFF,0xFC,0xD9,0xBF,0xDF,0xE0,0xFF,0xFF},/*"的",5*/

{0xFF,0xE7,0xFB,0xEB,0x6B,0x6B,0x2A,0x49,0xEB,0xEB,0x6B,0xFB,0xEB,0xF3,0xFB,0xFF,0xFF,0xD6,0xD6,0xEA,0xEB,0xB5,0x76,0xBB,0xC0 ,0xF9,0xF6,0xF6,0xEF,0xCF,0xEF,0xFF}};


/************************************************ *********
               Global Variable
*************************************** *******************/

uchar page;
uchar x,y;
uchar char_row;
uchar charpos;
uchar chardata;

 


void nokia_write_dorc(uchar bytefornokia);
void nokia_write_command(uchar bytefornokia_command);
void nokia_write_data(uchar bytefornokia_data);
void nokia_gotoxy(uchar xnokia, uchar ynokia);
void lcdpixel(uchar x, uchar y,uchar d);
void lcd_chr(uchar chars el) ;

void delay_ms(uint t)
{
   uint i,j;
    for(i=0;i    for(j=0;j<100;j++);
}

void SPI_init()
{
   DDRB|=(1<<5)|(1<<7);//MOSI SCK OUTPUT
   SPCR=(0<<7)|(1<<6)|(0<<5)| (1<<4)|(0<<3)|(0<<2)|(0<<1)|(1);
}

void SPI_sendB(uchar d)
{
    /* Start data transfer*/
   SPDR = d;
   /* Wait for the transfer to end*/
   while(!(SPSR & (1< }

/************************************************ *******
              Nokia clear LCD function
*************************************** *****************/
void nokia_cls() {
   for (page=0; page<9; page++) // 9 page
      {
         nokia_write_command(0xB0 | page); // page address ie:0xB0,0xB1,...,0xB7
         nokia_write_command(0x11); // most 4 bit column address command 0001 0011
         nokia_write_command(0x02); // least 4 bit column address command 0000 0011
         for (x=96; x> 0; x--) // 96 column
            nokia_write_data(0x00);
      }
}
/******************************** ****************************
               Reset LCD Function
********************* *************************************/
void nokia_reset() 
{
   SET_RESET; //1
   delay_ms(10); 
   CLR_RESET; //0
   delay_ms(10);
   SET_RESET; //1
   delay_ms(100);
}

/************************************************ *********
               Initial LCD Function
*************************************** ********************/
void nokia_init() {
   nokia_reset();
   nokia_write_command(0xA6); // lcd in normal display mode (0xA7 negative mode)
   nokia_write_command(0xA3 ); // lcd bias (1/9 0xA2 - 1/7 0xA3)
   nokia_write_command(0xA1); // (0xA1 reverse lcd - 0xA0 select normal)
   nokia_write_command(0xC0); // common output normal (0xC8 reverse )
   nokia_write_command(0x22); // V5 resistor ratio
   nokia_write_command(0x81); // electronic volume mode
   nokia_write_command(0x2E); // power control set value (contrast level --> 0x00 lightest to 0x3F darkest)
   nokia_write_command(0x2F); // power control set value
   nokia_write_command(0xE3); // nop
   nokia_write_command(0x40); // start line set
   nokia_write_command(0xAF); // lcd on
   nokia_write_command(0xA5); // lcd all points on
   delay_ms(500);
   nokia_write_command(0xAE); // lcd off
   nokia_cls();
   nokia_write_command(0xAF); // lcd on
   nokia_write_command(0xA4); // lcd normal display mode
}

/************************************************ *********
               sent 8 bit data to LCD by series
********************************* *************************/
void nokia_write_dorc(uchar bytefornokia)


SPI_sendB(bytefornokia);

}

/************************************************ *********
              Sent Command to LCD Function
************************************ ************************/
void nokia_write_command(uchar bytefornokia_command) 
{
   CLR_DC; // lcd command mode
   CLR_CS; // chip enabled
   nokia_write_dorc(bytefornokia_command);
   SET_CS; // chip disabled
}

/************************************************ *********
               Sent Data to LCD Function
************************************ ************************/
void nokia_write_data(uchar bytefornokia_data) {
   SET_DC; // display data mode
   CLR_CS; // chip enabled
   nokia_write_dorc(bytefornokia_data);
   SET_CS; // chip disabled
}


/************************************************ *********
goto xy position on LCD Function
*********************************** ***********************/
void nokia_gotoxy(uchar lcd_row, uchar lcd_col) 
{ //lcy_row: 0 - 8 (8th column has only 1 line / D0 , lcd_col: 0 -15

char col_addr;
nokia_write_command(0xB0 + lcd_row); // page address set. pg 8-48 in the datasheet.
col_addr = 0x12+(lcd_col); // each font has five columns + 1 blank column. xaddr: 0 - 95 on noki
                  //a 7110. no offset.
//lcd_1st_col=0x12: the first column of display starts here. Weird! the datasheet didn't mention it.
nokia_write_command(0x10 | (col_addr>>4)); // column address 4 most bit set
nokia_write_command(0x0f & col_addr); // column address 4 least bit set
}
/********************************** ***************************
           Xie one byte at xy position
****************** ******************************************/
void lcdpixel(uchar x, uchar y,uchar d) // lower left corner is (0,0) x 0-75 has a bug
            // y 0-63 
{
nokia_gotoxy(x,y);
nokia_write_data(d);

}


void lcd_HZ(uchar x,uchar y,uchar *s)
{
uchar i;
y=y*16;
for(i=0;i<16;i++)
{
   lcdpixel(x,y+i,s[i]);
}
for(i=16;i<32;i++)
{
   lcdpixel(x+1,y+i-16,s[i]);
}
}

void main()
{
uchar i;
    DDRD=0XFF;
SPI_init();
nokia_init();
    

    //lcdpixel(1,0,0xaa);
for(i=0;i<8;i++)
   lcd_HZ(0,i,HZ [i]);

//nokia_write_command(0xa5); //diaplay all points on

//while(1);
}

The font extraction is still done using PCtoLCD2000

  nokia7110 LCD display Chinese characters - liuyunqian@yeah - Embedded Learning

  nokia7110 LCD display Chinese characters - liuyunqian@yeah - Embedded Learning
 

 

################################################ ####################

The "home" above is not displayed

  nokia7110 LCD display Chinese characters - liuyunqian@yeah - Embedded Learning

void main()
{
uchar i;
    DDRD=0XFF;
SPI_init();
nokia_init();
    

    //lcdpixel(1,0,0xaa);
for(i=0;i<6;i++)
   lcd_HZ(0,i,HZ [i]);

   lcd_HZ(2,0,HZ[6]);

//nokia_write_command(0xa5); //diaplay all points on

//while(1);
}

Keywords:nokia7110  LCD Reference address:nokia7110 LCD display Chinese characters

Previous article:Simple menu system Proteus pg12864 LCD
Next article:ATmega16 nokia7110 LCD screen experiment

Recommended ReadingLatest update time:2024-11-16 16:26

Say goodbye to LCD TVs, will high-end OLED TVs make money?
The OLED TV group, led by LG Electronics, is reportedly increasing its share in the global TV market. Chinese TV manufacturers are focusing on increasing sales through cheap liquid crystal display (LCD) TVs, but the OLED TV group is driving sales in the high-end TV market.     Japan's Sony ranked third in the TV ma
[Embedded]
Say goodbye to LCD TVs, will high-end OLED TVs make money?
Microsemi Launches Combination Timing Controller and LED Backlight Solution for Next-Generation 3D LCD TVs
Microsemi Corporation (Nasdaq: MSCC) announced that it has collaborated with Sony Semiconductor Business Unit ("Sony") to launch the market's first 3D-enabled timing controller and local dimming LED backlight combination solution for cost-effective, high-volume, next-generation LCD TVs. The combination solution include
[Home Electronics]
Microsemi Launches Combination Timing Controller and LED Backlight Solution for Next-Generation 3D LCD TVs
Analyze the design and application of LCD TV backlight, power supply and I/O port circuit protection
Today, display technology is developing towards high definition, low electromagnetic radiation, low power consumption and small size. Although the production technology of CRT (cathode ray tube) displays is becoming more and more mature, and the display quality is getting better and better, its size and radiation prob
[Power Management]
Analyze the design and application of LCD TV backlight, power supply and I/O port circuit protection
PIC microcontroller drives LCD12864 liquid crystal display flashing font program
/****************************************************** ********************* *** Function: 12864LCD display shows flashing fonts, students can modify it by themselves. *** Experimental content: 0x81 0x90 0x88 0x98 are the row start addresses of the four lines of LCD respectively. The characters we operate the LCD re
[Microcontroller]
Single chip LCD1602 liquid crystal display
The display of single-chip microcomputer LCD is much simpler to use than digital tube, and it is more practical, so I think it is also a very important module to learn single-chip microcomputer and learn LCD display well. Below I will use 1062 to display my name and PLAY UP! (Come on!) Hehe. This is a reference to this
[Microcontroller]
Micro2440 LCD bare metal test
I have been working on the LCD of micro2440 in recent days and encountered many problems. I wrote them down today and also gave them as a reference for my colleagues who want to write, so that they can avoid detours. First, let me explain the environment I use: ubuntu12.04, micro2440 (can be used for mini2440). 1.
[Microcontroller]
Micro2440 LCD bare metal test
S3C2440 TFTLCD driver detailed explanation
S3C2440 has its own LCD controller, which mainly has the following interfaces   Just talking about TFT display, the timing of TFT display is as follows   The drive of TFT display is scanned dot by dot in the form of rows and columns. There are three types of drive clocks, one is row clock, one is column clock,
[Microcontroller]
S3C2440 TFTLCD driver detailed explanation
Talk about the LCD backlight driver chip on the mobile phone
LCD is one of the most important parts of mobile phones. The effect of LCD display directly affects the intuitive experience of users. The LCD backlight driver chip is also one of the factors that have an impact. A good LCD backlight driver chip can make the LCD display clear, uniform in brightness, without flicke
[Power Management]
Talk about the LCD backlight driver chip on the mobile phone
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号