plik


ÿþObsBuga wy[wietlacza LCD z ukBadem sterowania HD44780U flapo213 - elektroda (michwolo@op.pl) 1. Opis sygnaBów sterujcych Øð  E  Enable przy przej[ciu z 1 na 0 umo|liwia przepisanie za- warto[ci z wej[ danych do rejestrów. Øð  RS  przeBczanie rejestrów pomidzy rejestrem danych a re- jestrem instrukcji 0  rejestr instrukcji, 1  rejestr danych. Øð  R/W  umo|liwia zapianie danych do wy[wietlacza bdz sprawdzenia flag, 0  zapis do wy[wietlacza, 1  odczyt flag z wy[wietlacza. Øð DB7...DB0  wej[cia danych / flagi. W trybie 8 bitowym wyko- rzystwane s wej[cia od DB7 do DB0, natomiast w trybie 4 bito- wym wykorzystywana jest wyBcznie starsza poBówka od DB7 do DB4. Øð Vsc  wej[cie napicia kontrastu (napicie zele|ne od napicia zasilania wy[wietlacza). Øð Vcc  napicie zasilania zale|nie od modelu 3,3V lub 5V. Øð Gnd  masa napicia zasilania. 2. Symbole u|ywane przy konfiguracji procesora HD44780U Øð  DL  szeroko[ magistrali danych, gdy DL = 0 szeroko[ 4 bitowa, DL = 1 szeroko[ 8 bitowa. Øð  N  liczba wierszy, gdy N = 0  jeden wiersz, 1  dwa wier- sze. Øð  F  wybór wielko[ci fonta, gdy F = 0  5x8, F = 1  5x10. Øð  D  zaBczenie / wyBczenie wy[wietlacza, gdy D = 0 wy- [wietlacz wygaszony, D = 1 aktywny. Øð  C  kursor widoczny / niewidoczny, gdy C = 0 niewidoczny, C = 1 widoczny. Øð  B  miganie kursora aktywne / nieaktywne, gdy B = 0  brak migania, B = 1  miganie wBczone. Øð  I/D  inkrementacja / dekrementacja, gdy I/D = 1 inkremen- tacja, I/D = 0 dekrementacja. Øð  S  przesunicie, S = 1 przesunicie aktywne, S = 0 brak przesunicia. 3. Algorytm konfiguracji Start - Initialization Start-up power supply, add delay 5V option 15ms, 3,3V option 40ms Wait to power supply reach 4,5V or 2,7V Set on pins RS = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = 1, DB4 = 1 Insert delay 4,1 ms Boot-up procedure of Set on pins RS = HD44780 processor 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = 1, DB4 = 1 Switching to 4 bit Insert delay 100us data length interface Set on pins RS = 0, R/W=0, DB7 = Wait until flage BF will be 1 0, DB6 = 0, DB5 = indicate ready to get new 1, DB4 = 1 command Set on pins RS = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = 1, DB4 = 0 T his two block after if condition set up R/W = 1 4 bit interface length and If DL = 0 set 4 bit interface length , DL = 1 set 8 bit if N = 0 (1 row) or N = 1 (2 row), F = 0 (5x8) or F = 1 (5x10) If(DB7 == 1) No Yes Set on pins RS = Set on pins RS = 0, R/W=0, DB7 = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = N, DB6 = F, DB5 = Wait until flage BF will be 1 1, DB4 = DL 1, DB4 = 0 indicate ready to get new command R/W = 1 This two block after if condition set up some display information If D = 0 display info is turn off , D = 1 display is an active If(DB7 == 1) if C = 0 cursor is turn off or C = 1 cursor is an active, No B = 0 static cursor or B = 1 blinking cursor Yes Set on pins RS = Set on pins RS = 0, R/W=0, DB7 = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = 1, DB6 = D , DB5 0, DB4 = 0 = C, DB4 = B R/W = 1 If(DB7 == 1) No Yes Set on pins RS = Set on pins RS = Rest of initialization is in 0, R/W=0, DB7 = 0, R/W=0, DB7 = on hd44780u_alg02 0, DB6 = 0, DB5 = 1, DB6 = D , DB5 document 0, DB4 = 0 = C, DB4 = B Pierwsza cz[ algorytmu hdd44780u_alg01 Continous from Wait to last internal operation is finished document hd44780u_alg01 Set options move cursor or shift display R/W = 1 S/C = 0 cursor move, S/C = 1 display shift and R/L = 0 shift to left, R/L = 1 shift to right, x - less worth state If(DB7 == 1) No Yes Set on pins RS = Set on pins RS = 0, R/W=0, DB7 = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = S/C, DB6 = R/L , 0, DB4 = 1 DB5 = x, DB4 = x R/W = 1 Wait to last internal operation is finished Set options cursor move direction and specifies display shift I/D = 0 decrement, S/C = 1 increment If(DB7 == 1) and S = 1 add display shift No Yes Set on pins RS = Set on pins RS = 0, R/W=0, DB7 = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = 0, DB6 = 1 , DB5 = 0, DB4 = 0 I/D, DB4 = S R/W = 1 Wait to last internal operation is finished Clear all entire display and sets DDRAM address to 0 in address counter If(DB7 == 1) No Yes Set on pins RS = Set on pins RS = 0, R/W=0, DB7 = 0, R/W=0, DB7 = 0, DB6 = 0, DB5 = 0, DB6 = 0 , DB5 = 0, DB4 = 0 0, DB4 = 1 3 not described options please refer to HD44780u manual End of initialization procedure of HD44780u Druga cz[ algorytmu hdd44780u_alg01 4. Algorytm zmiany pozycji na wy[wietlaczu. Start Row Change Instruction to save 0x80 1 indicates operation change DDRAM actual Set on pins RS = position, y - position if 0 row 1 position 1 0, R/W=0, DB7 = choose row 1 and if 1 choose row 2, x - is 1, DB6 = y, DB5 = position on one row x, DB4 = x Set on pins RS = 0, R/W=0, DB7 = x, DB6 = x , DB5 = x, DB4 = x Wait for internal operation finish R/W = 1 Instruction to save 0xC0 row 2 position 1 If(DB7 == 1) No Yes Exit Row Change 5. Algorytm zapisu znaku na wy[wietlaczu. Start Character Save If You want to save a character to display You should Save Character for change RS to 1 and R/W to 0 and x is all position in instance  A is in ASCII Set on pins RS = ASCII code table for instance character  A 0x65 0x65 1, R/W=0, DB7 = x, DB6 = x, DB5 = x, DB4 = x A Set on pins RS = 0, R/W=0, DB7 = x, DB6 = x , DB5 = x, DB4 = x R/W = 1 If(DB7 == 1) No Yes End of Save Character 6. Algorytm zapisu znaku specjalnego do pamici znakowej CGRAM Save New Character in CGRAM Set on pins RS = 0, R/W=0, DB7 = 1 indicate that choose save instruction write to 0, DB6 = 1, DB5 = CGRAM, all x is address to specyfic line, if you want x, DB4 = x save 8 point hight character You should in x place insert I variable (increment) Set on pins RS = 0, R/W=0, DB7 = x, DB6 = x , DB5 = x, DB4 = x R/W = 1 Wait to the the last internal operation is finish Character 5x8 pixels If(DB7 == 1) Character polish  A No Yes 0x08 0 0 0 0 1 0 0 0 0x0A 0 0 0 0 1 0 1 0 Set on pins RS = 1, R/W=0, DB7 = 0xC0 0 0 0 0 1 1 0 0 x, DB6 = x, DB5 = Save pattern of new one line character in x, DB4 = x CGRAM 0x80 0 0 0 0 1 0 0 0 Set on pins RS = 0x18 0 0 0 1 1 0 0 0 0, R/W=0, DB7 = x, DB6 = x , DB5 = x, DB4 = x 0x08 0 0 0 0 1 0 0 0 0x0F R/W = 1 0 0 0 0 1 1 1 1 Wait to the the last internal operation is finish 0x00 0 0 0 0 0 0 0 0 If(DB7 == 1) No Yes Yes Save the 5x8 character save in CGRAM If(i == 8) No i++ End of Save New Character in CGRAM 7. Algorytm inicjalizacji wy[wietlacza napisany w jzyku ANSI C 8. Algorytm inicjalizacji wy[wietlacza napisany w jzyku VHDL

Wyszukiwarka

Podobne podstrony:
programowanie sterowników wyświetlaczy LCD 2
Wyświetlacz LCD
Instrukcja obsługi wyświetlacza alfanumerycznego RS232
Kurs AVR GCC Wyświetlacz LCD od Nokii310
Termometr cyfrowy z wyświetlaczem LCD
Laboratorium 3 wyświetlacz LCD
Alfanumeryczne wyświetlacze LCD, cz 1
Alfanumeryczne wyświetlacze LCD Cześć 2
Nowe wyswietlacze LCD
Alfanumeryczne wyświetlacze LCD, cz4

więcej podobnych podstron