Ocmj8x15b Jinpeng LCD Driver + font Pattern

Source: Internet
Author: User

I recently got the LCD screen of Jinpeng. Now, I don't want to run the LCD screen.ProgramI can't say it. It would be better if I could use 3G modules and WiFi modules.

This LCD screen has nothing special than other LCD screens. Some time ago, I used a LCD screen without a font library, which is a pain, each time a character or Chinese character is displayed, the escape code is also calculated, and its logic is difficult to understand. However, a function is written to write a character after the abscissa and ordinate are determined, the encapsulation of the LCD program should be so simple!

I believe everyone has read the sequence of this LCD screen, and I also have my own program. This time I used the lpc1766 in the lpc1700 series, but according to my own program, I combined the sequence of the PDF, after a long time of comparison, I felt that there was no problem at all. In the end, I wrote a Chinese character. However, I had to ask my mentor for help. The tutor said that many people could not make this LCD screen, it is written in the case of a timing pair instead of an understanding of the time sequence.CodeIt also needs to be matched, otherwise it seems that the time series is not running.

Timing problem, you can see the PDF at a glance, PDF connection is as follows: http://wenku.baidu.com/view/789a261ca300a6c30c229ff7.html

 

The initialization and time series code of lpc1766 is attached below, which is helpful to you:

# Define LCD _req (1 <28) # define LCD _busy (1 <27)

 

 
Void lcdinit (void) {fio1clr | = LCD _req; // set req to low-level mydelay (10); // latency, waiting for signal stability fio1clr |=( 0xff <18 ); // set the output data port to 0}

 
Void sendonebyte (uint8_t dat) {While (fio1pin & LCD _busy); // if you are busy, you need to add a delay fio1set |=( dat <18 ); // In p1.18 ~ Output 1 data on p1.25 mydelay (10); // delay wait data stability fio1set | = LCD _req; // the req is set to high, tell the LCD that data can be retrieved while (fio1pin & LCD _busy) = 0); // wait for the LCD to respond to receive data fio1clr | = LCD _req; // set req to low, withdrawal request signal mydelay (200); fio1clr |=( 0xff <18 );}

 

I use p1.18 ~ P1.26 indicates db0 ~ Db7, p1.27 is busy, set to input, p1.28 is req

 

This font also has certain rules. For example, if the word "points", the program will explain that the two bytes are 183, 214 (one Chinese character is two bytes, and the height is 183, the low byte is 214), and in the location table of the font library, it corresponds to (). You may already see its pattern, yes, it means that after the Chinese characters are interpreted by the program, both the high byte and the low byte minus 160, you can get the Chinese characters you entered. This is very convenient.

Here I really want to give NXP some advice. Do you want to use ioset and ioclr for each pin output? This is inconvenient. It is better to output the high level directly than p1.18 = 1. Although this is the 51 SCM method, it is a desirable method and is worth learning,

And is the output or input code of a pin? It cannot be dual-ended. Can it be output? In communication, this is very important and can greatly reduce the burden. Otherwise, the direction of input and output should be switched back and forth every time. It is really annoying. programming should be convenient for programmers, the product compiled by programmers should be convenient to the public!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.