FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Can the LCD1602 show Chinese characters? _LCD1602 shows Chinese characters

     

    "Can LCD 1602 display Chinese characters 1602 liquid crystal is a character type liquid crystal, with a total of 2 lines and 16 characters in each line. The valid displayable font for each character is 5 * 8 dot matrix font. Therefore, it is usually impossible to display Chinese. Graphic dot matrix LCD must be selected for Chinese display. In particular: it refers to simple Chinese characters such as "year, month and day"? Up to 8 cgram characters are supported. You can do it yourself. Call font code 0-7. For example, cgram unit data of "year" are: 0Fh, 09h, 0Fh, 09h, 0Fh, 09h, 13h, 00h. These 8 bytes are written to cgram units 00h-07h. Call character code 0. You can see the Chinese "year". LCD 1602 displays the concept of Chinese characters First of all: we need to clarify a concept. In fact, we use 1602 to display Chinese characters, that is, we use its internal custom byte space. The contents of the first line correspond to the contents of 80h to 8fh in DDRAM, and the contents of the second line correspond to the contents of C0H to CFH in DDRAM By checking the user manual of LCD1602, it is mentioned that when we need to write data to cgram, we need to write the address of cgram first. It can be seen from the manual that the address of cgram is 0x40. Therefore, when we want to write data, we need to write an address command write first_ com(0x040); Then write the data you want to write to write through the write data command_ Date (data you want to write); Storing the code of Chinese characters you want to display in cgram is equivalent to fixing other common characters in LCD. Storing the code of Chinese characters you want to display in cgram is equivalent to fixing other common characters in LCD. It is equivalent to storing the code of Chinese characters you want to display in cgram, which is equivalent to fixing other common characters in LCD, We all know that LCD1602 has a 64 byte custom cgram. Well, we need to use the custom bytes to display Chinese characters. We know that a character takes up 8 bytes, so we can store 8 characters in cgram. In other words, the 64 byte cgram provides us with write data, so how can we write the Chinese characters we want to cgram? DDRAM display RAM directly corresponds to the points on the screen. A point on the screen corresponds to a bit in DDRAM. The DDRAM of character screen is a little different from that of graphics screen. Cgrom stores some standard character font codes, which are solidified in the control chip when the LCD screen leaves the factory. Users can't change the stored contents, but can only read and call, including standard ascii code, Japanese characters and Greek characters. Cgram is a control chip left to the user to store the font code designed by the user. The font code must be read into the corresponding DDRAM first. After transfer, the characters are displayed in the corresponding position of the screen. For the character screen, when you want to display a character, you can complete the display by writing the character index (generally ASCII code) in DDRAM. LCD 1602 program for displaying Chinese characters Font of Chinese characters: Is the displayed man font structure. To define the font, you need to know the CG RAM address of 1602 and the address DD ram of the display character: one two three four five six seven eight nine 10 11 12 13 fourteen 15 16 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F The address of the first character in the first line is (0x80), the address of the following character, and so on The address of the first character in the second line is (0x80 + 0x40). You need to add an offset 0x40 after the base address in the first line, and then add one to the base address in turn. void delay(unsigned int time_ i) { int i; for (; TIm》0; TIm--) { for (i=0; i《10; i++); } } void command_ out (char out_ data) { RW=0; RS=0; EN=1; DB=out_ data; EN=0; delay(10); } void OUTD(char out_ data) { RS=1; RW=0; EN=1; DB= out_ data; EN=0; delay(10); } OutI () is a function to write instructions, and outd () is a function to write data. For example: The first 5 * 7 display data in the upper left corner is: The corresponding bits in the blue area of 0x00, 0x01, 0x81, 0x12, 0x24, 0x41, 0x81, 0x10 are 1 In this way, the display data of all four 5 * 7 dot matrices can be written out and encapsulated in an array, such as an array, hanzi[]={0x00,0x01,0x81,0x12,0x24,0x41,0x81,0x10, …… …… …… } Then use the command: OUTI(0X40); for (i=0; i《64; i++) { OUTD(neu[i]); } Assign the data in this array to 1602 internal cgram. After completion, set the display address of the data on 1602, and set the position according to the structure of Fig. 1, such as the first character, the second character and the second line in the first line Displayed at the first and second characters: Command_ out (0x80+0x00); for (i=0; i《4; i++) { data_ out (i); } Command_ out(0x80+0x40); for (i=4; i《8; i++) { data_ out(i); } command_ Out() is used to set the starting address of the display, data_ The function of out() is to send the hexadecimal data in Hanzi [] array, and each hexadecimal digit corresponds to each line of the 5 * 7 dot matrix. Eight hexadecimal data are required for the first character in line 1, and 816 hexadecimal data is also required at the second character in line 1. There are also two character dot matrices in line 2. In this way, 32 hexadecimal data are required to display a Chinese character. Here is an example (proteus simulation passed) //*************************************************************************************** // Hardware connection: 1602vdd is connected to 5V, VO is grounded, BL1 is connected to 5V, BL2 is grounded, 8 data lines are connected to port P0, and RS RW e is connected to ports p2.0, p2.1 and p.4 respectively //***************************************************************************************// #include 《reg52.h》 #include 《string.h》 #Define busy 0x80 / / used to detect the busy ID in the LCM status word #define LCM_ Data P0 ; sbit LCM_ RS=P2^0; // Register selection sbit LCM_ RW=P2^1; // Read / write control sbit LCM_ E=P2^4; // Read / write enable int i,j; //Custom character list// ===================================================================================== Unsigned character 0 [8] = {0x08, 0x0f, 0x12, 0x0f, 0x0a, 0x1f, 0x02, 0x02}, / / year Character1 [8] = {0x0f, 0x09, 0x0f, 0x09, 0x0f, 0x09, 0x0b, 0X11}, / / month Character2 [8] = {0x0f, 0x09, 0x09, 0x09, 0x0f, 0x09, 0x09, 0x0f}, / / day characterN[8] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; // day //========================================================== //========================================================= //Delay procedure //======================================================= void Delay5Ms(void) { unsigned long int TempCyc = 5552; while(TempCyc--); } void Delay400Ms(void) { unsigned char TempCycA = 5; unsigned int TempCycB; while(TempCycA--) { TempCycB=7269; while(TempCycB--); }; } //=================================================================== //Read write subroutine //================================================================= //Read data unsigned char ReadDataLCM(void) { LCM_ RS = 1; LCM_ RW = 1; LCM_ E = 1; LCM_ E = 0; for(i=0; i《100; i++); LCM_ E = 1; return(LCM_ Data); } //Read state unsigned char ReadStatusLCM(void) { LCM_ Data = 0xFF; LCM_ RS = 0; LCM_ RW = 1; LCM_ E = 1; LCM_ E = 0; for(i=0; i《100; i++); LCM_ E = 1; //while (LCM_ Data & Busy); // Detect busy signal return(LCM_ Data); } //Write data void WriteDataLCM(unsigned char WDLCM) { ReadStatusLCM(); // Detection busy LCM_ Data = WDLCM; LCM_ RS = 1; LCM_ RW = 0; LCM_ E = 1; LCM_ E = 0; // If the crystal oscillator speed is too high, a small delay can be added after this for(i=0; i《100; i++);// delayed LCM_ E = 1; } //Write instruction Void writecommandlcm (unsigned char wclcm, buysc) / / ignore busy detection when buysc is 0 { if (BuysC) ReadStatusLCM(); // Detect busy as needed LCM_ Data = WCLCM; LCM_ RS = 0; LCM_ RW = 0; LCM_ E = 1; LCM_ E = 0;

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us