C51 is odd a skill of machine process designing: Experience of LCD1602 process designing is shared

  • Time:
  • Click:104
  • source:BERO CNC Machining
This I share the process designing experience of my LCD1602: Explain first, the chip drive that saying LCD1602 wants below me is HD44780, if your LCD1602 drive chip is not HD44780, so the content below is inapplicable. My whole to LCD1602 says understanding breaths out my whole to LCD1602 here, LCD1602 is a LCD video that can show two character, every group can keep 40 character, but before every have only all right 16 character can show, 24 every character at the back of travel cannot show instantly, say to understand not easily only, sketch map sees below: Additionally LCD1602 can show character only, number and a few simple symbols, cannot show a Chinese character, be sure to keep in mind. LCD1602 cites a base: Say to cite a base again next, learn a chip every time or module, what should understand first most is to cite a base: Just learn now as a result of us how process designing, so the join of circuit I was not told, what concern with process designing say to cite a base below: 1. RS cites a base: Data / command chooses end (H / L) should give when you when LCD sends a statement, bring crural low n to this; When you want as alternant as LCD data, bring crural tall n to this. 2. R / W cites a base: Read / to write a choice to carry (H / L) when should keeping data to LCD when you, bring crural low n to this; When you should read the data in LCD, bring crural tall n to this. 3. E cites a base: Make can carry (the person that here patronizes love to get into a dead end: Why does E cry " make can " ah? Additional " make can " what meaning, how had never I heard of? ) answer 1: E makes crural English full name: Enable cites a base, en is a prefix in English, interpret is " make. . . " , after that the Able of the face is interpret is " can " , close to cry so " make can " cite a base. Answer 2: Make can what meaning, here does not say professional term is breathed out, you are understandable can be being carried to make is a switch, citing a base when this is tall / this parts of an apparatus when low n can be used, becoming it to be this parts of an apparatus when contrary n is trashy, no matter how you do it also do not work. It is low n parts of an apparatus after all of course effective, is parts of an apparatus of tall still n effective? This data manual that is about to see specific parts of an apparatus or some brings a foot to go up to also be met direct line out comes, for instance E is tall n effective, e (-- ) it is low n effective. 4. D0 ~ D7 cites a base: This good with respect to it doesn't matter those who say, transmit data namely or jussive cites a base. 5. Other power source cite a base, back photoelectricity source of what did not say, had said very much to be clear about inside form, and we are mere now it is study process designing, circuit join is not told. Bring a foot to say, so below we can say the process designing share of LCD1602: I think to need to remember to LCD1602 with respect to two parts, sequential and instruction (not be must remember completely, after learning, oneself keep library of a function, when development uses after, call directly went) say sequential and initialization process first: LCD1602 reads sequential: I did not write the source that reads function, after all this is not used almost. In using a figure, can see: RS brings a foot to be read according to yours what take and decide, read access to occupy tall n, read taking an order is low n; RW cites crural nature is tall n, want to read because of us; Next again in the future is E cites a base, we are being read take command or data when, must want to make first can this parts of an apparatus, so E brings a foot to want buy to be tall n; Final D0 reads taken data namely to D7, we look for a variable array to save rise to go. Although read sequential to be told, but in be being developed actually, we need to undertake reading operating scarcely, the someone when I think this can say: Not be to should be read take busy sign, is that about to undertake reading was operatinged? It is really in that way, but the speed of LCD1602 is accept second level, and 51 sheet piece machine be millisecond level, do not need basically to read so take busy sign, wanted small delay time to go only. If pursue: LCD1602 writes sequential: I wrote this function, code is below: [note] inside function I used two kinds of means, and 4 are mixed and 8 it is the most important to say below the mouth write operation sequential, can see from inside the graph: RS brings a foot to be read according to yours what take and decide, read access to occupy tall n, read taking an order is low n; RW cites crural nature is low n, because this we want,be written; Next again in the future is E cites a base, we are being read take command or data when, must want to make first can this parts of an apparatus, so E brings a foot to want buy to be tall n; The data that final D0 keeps namely to D7 perhaps commanded. This I also kept LCD1602 process, code is below: The initialization of LCD1602, namely the initialization process of HD44780 chip, the version of this initialization process is too much, most initialization process can succeed initialization, but be to writing an article here, cannot explain a farfetched initialization process naturally, so I checked the manual of English original data of HD44780 chip, the graph goes up below: If everybody thinks understood word from on downward one pace ground looks, understand next why initialization should resemble above wrote in that way. [note] the version of a lot of initialization can succeed initialization, I say that is the normallest merely just, individual be fond of, it is OK to want only initialization success is OK. Keep the head file of good LCD1602 finally, next the function library of LCD1602 has been done, of course we were not written read function, oneself added these words that you think to write to go. Had this function library, when using LCD1602 later, call directly went, much more convenient. CNC Milling CNC Machining