Tim Hieu LCD 16x2

download Tim Hieu LCD 16x2

of 13

  • date post

    03-Jun-2018
  • Category

    Documents

  • view

    219
  • download

    0

Embed Size (px)

Transcript of Tim Hieu LCD 16x2

  • 8/12/2019 Tim Hieu LCD 16x2

    1/13

    ChnChn KK M tM t

    Gii thiu cbn v LCD 16x2Gii thiu cbn v LCD 16x23/02/2012 09:09:00 CH3/02/2012 09:09:00 CH Gii thiu cbnGii thiu cbn,, LCD 16x2LCD 16x2,, Linh Kin CBnLinh Kin CBn,, in tcbnin tcbn No commentsNo comments

    * Gii thiu :* Gii thiu :

    Ngy nay, thit bhin thLCD (Liquid Crystal Display) c sdng trong rt nhiu cc ng dng ca VK. Ngy nay, thit bhin thLCD (Liquid Crystal Display) c sdng trong rt nhiu cc ng dng ca VK.

    LCD c rt nhiu u im so vi cc dng hin thkhc: N c khnng hin thk ta dng, trc quan (ch,LCD c rt nhiu u im so vi cc dng hin thkhc: N c khnng hin thk ta dng, trc quan (ch,

    sv k tha), ddng a vo mch ng dng theo nhiu giao thc giao tip khc nhau, tn rt t tisv k tha), ddng a vo mch ng dng theo nhiu giao thc giao tip khc nhau, tn rt t ti

    nguyn hthng v gi thnh rnguyn hthng v gi thnh r

    Tng Qut VLCD HD44780Tng Qut VLCD HD447801> Hnh dng v kch thc:1> Hnh dng v kch thc:

    C rt nhiu loi LCD vi nhiu hnh dng v kch thc khc nhau, trn hnh 1 l loi LCD thngC rt nhiu loi LCD vi nhiu hnh dng v kch thc khc nhau, trn hnh 1 l loi LCD thng

    dng.dng.

    Hnh 1 : Hnh dng ca loi LCD thng dngHnh 1 : Hnh dng ca loi LCD thng dng

    Khi sn xut LCD, nh sn xut tch hp chp iu khin (HD44780) bn trong lp vv cha cc chn giaoKhi sn xut LCD, nh sn xut tch hp chp iu khin (HD44780) bn trong lp vv cha cc chn giao

    tip cn thit. Cc chn ny c nh sthtv t tn nhhnh 2 :tip cn thit. Cc chn ny c nh sthtv t tn nhhnh 2 :

    Hnh 2 : Schn ca LCDHnh 2 : Schn ca LCD

    2> Chc nng cc chn :2> Chc nng cc chn :

    Top10Top10 Danh Mc ChDanh Mc Ch

    Tng HpTng Hp

    LIN HLIN H

    ThGviTKhavEnter

    13

    BNG XP HNG TUNBNG XP HNG TUN

    Download Proteus 7.8 SP2 FULLDownload Proteus 7.8 SP2 FULL

    IC 555 - Nguyn l, Cu toIC 555 - Nguyn l, Cu to

    [Hc Lp trnh 8051] Bi 2:[Hc Lp trnh 8051] Bi 2:Hng Dn SDng Keil C LpHng Dn SDng Keil C LpTrnh 8051Trnh 8051

    [Hng Dn] Ci t - SDng[Hng Dn] Ci t - SDngTrnh Bin Dch Dev-C++Trnh Bin Dch Dev-C++

    [Hc lp trnh 8051] Bi 7: Ngt[Hc lp trnh 8051] Bi 7: Ngttrong 8051trong 8051

    Gii thiu cbn vLCD 16x2Gii thiu cbn vLCD 16x2

    Code mu cho PIC - Kt hp:Code mu cho PIC - Kt hp:ADC o nhit , in p, hin thADC o nhit , in p, hin thLCD v giao tip vi my tnhLCD v giao tip vi my tnh

    TRANG CHTRANG CH BN TINBN TIN IN TCBNIN TCBN LP TRNHLP TRNH VI IU KHINVI IU KHIN CHIP KHTRNHCHIP KHTRNH PHN MMPHN MM GII THUTGII THUT

    MUSICMUSIC

    DIENTUMAYTINH.COMDIENTUMAYTINH.COM

    thiu cbn v LCD 16x2 ~ in TMy Tnh http://www.dientumaytinh.com/2012/03/gioi-thieu-co-ban-ve-lcd-

    3 11/6/2012

  • 8/12/2019 Tim Hieu LCD 16x2

    2/13

    hiuhiu11 VssVss Chn ni t cho LCD, khi thit kmch ta ni chn nyChn ni t cho LCD, khi thit kmch ta ni chn ny

    vi GND ca mch iu khinvi GND ca mch iu khin

    22 VDDVDD Chn cp ngun cho LCD, khi thit kmch ta ni chnChn cp ngun cho LCD, khi thit kmch ta ni chnny vi VCC=5V ca mch iu khinny vi VCC=5V ca mch iu khin

    33 VEEVEE iu chnh tng phn ca LCD.iu chnh tng phn ca LCD.

    44 RSRS Chn chn thanh ghi (Register select). Ni chn RS viChn chn thanh ghi (Register select). Ni chn RS vilogic 0 (GND) hoc logic 1 (VCC) chn thanh ghi.logic 0 (GND) hoc logic 1 (VCC) chn thanh ghi.+ Logic 0: Bus DB0-DB7 sni vi thanh ghi lnh IR+ Logic 0: Bus DB0-DB7 sni vi thanh ghi lnh IR

    ca LCD (chghi - write) hoc ni vi bm aca LCD (chghi - write) hoc ni vi bm achca LCD (chc - read)chca LCD (chc - read)+ Logic 1: Bus DB0-DB7 sni vi thanh ghi dliu+ Logic 1: Bus DB0-DB7 sni vi thanh ghi dliuDR bn trong LCD.DR bn trong LCD.

    55 R/WR/W Chn chn chc/ghi (Read/Write). Ni chn R/WChn chn chc/ghi (Read/Write). Ni chn R/Wvi logic 0 LCD hot ng chghi, hoc nivi logic 0 LCD hot ng chghi, hoc nivi logic 1 LCD chc.vi logic 1 LCD chc.

    66 EE Chn cho php (Enable). Sau khi cc tn hiu c tChn cho php (Enable). Sau khi cc tn hiu c tln bus DB0-DB7, cc lnh chc chp nhn khi c 1ln bus DB0-DB7, cc lnh chc chp nhn khi c 1xung cho php ca chn E.xung cho php ca chn E.+ chghi: Dliu bus sc LCD chuyn+ chghi: Dliu bus sc LCD chuynvo(chp nhn) thanh ghi bn trong n khi pht hin mtvo(chp nhn) thanh ghi bn trong n khi pht hin mt

    xung (high-to-low transition) ca tn hiu chn E.xung (high-to-low transition) ca tn hiu chn E.+ chc: Dliu sc LCD xut ra DB0-DB7+ chc: Dliu sc LCD xut ra DB0-DB7khi pht hin cnh ln (low-to-high transition) chn Ekhi pht hin cnh ln (low-to-high transition) chn Ev c LCD gibus n khi no chn E xung mcv c LCD gibus n khi no chn E xung mcthp.thp.

    7 - 147 - 14 DB0 -DB0 -

    DB7DB7Tm ng ca bus dliu dng trao i thng tinTm ng ca bus dliu dng trao i thng tinvi MPU. C 2 chsdng 8 ng bus ny :vi MPU. C 2 chsdng 8 ng bus ny :+ Ch8 bit : Dliu c truyn trn c8 ng, vi+ Ch8 bit : Dliu c truyn trn c8 ng, vibit MSB l bit DB7.bit MSB l bit DB7.

    + Ch4 bit : Dliu c truyn trn 4 ng t+ Ch4 bit : Dliu c truyn trn 4 ng tDB4 ti DB7, bit MSB l DB7DB4 ti DB7, bit MSB l DB7

    1515 -- Ngun dng cho n nnNgun dng cho n nn

    1616 -- GND cho n nnGND cho n nn

    [Hng Dn] Download - Ci t[Hng Dn] Download - Ci tPhn Mm Altium Designer FULLPhn Mm Altium Designer FULL

    [Hc lp trnh 8051] Bi 6: Truyn[Hc lp trnh 8051] Bi 6: Truynthng ni tip vi 8051thng ni tip vi 8051

    in Tr- Cch c Gi Trinin Tr- Cch c Gi TrinTrTr

    Chng ti ang trn

    NHN LM N IN TTI HNNHN LM N IN TTI HN

    Nhm qun trwebsiteNhm qun trwebsite www.linhkiendientu.co/www.linhkiendientu.co/chng ti quyt nh cung cp ccchng ti quyt nh cung cp cc sn phm insn phm intttheo yu cu, nhn thit ktheo yu cu, nhn thit kmch in tmch in tvvn in tn in t.. Chi tit ti yChi tit ti y:: Nhn lm n,Nhn lm n,

    thit kmch in ttheo yu cu ti H Ni.thit kmch in ttheo yu cu ti H Ni.

    LIN KTLIN KT

    Kim Tin Trn MngKim Tin Trn Mng

    Qung Co LEDQung Co LED

    Truong ChuyenTruong Chuyen

    Pho ThongPho Thong

    NG NHPNG NHP

    vi Kt ni Bn b ca Google

    Thnh vin (35) Thm

    Bn l thnh vin ri? ng nhp

    thiu cbn v LCD 16x2 ~ in TMy Tnh http://www.dientumaytinh.com/2012/03/gioi-thieu-co-ban-ve-lcd-

    3 11/6/2012

  • 8/12/2019 Tim Hieu LCD 16x2

    3/13

    Bng 1 : Chc nng cc chn ca LCDBng 1 : Chc nng cc chn ca LCD

    * Ghi ch : chc, ngha l MPU sc thng tin tLCD thng qua cc chn DBx.* Ghi ch : chc, ngha l MPU sc thng tin tLCD thng qua cc chn DBx.

    Cn khi chghi, ngha l MPU xut thng tin iu khin cho LCD thng qua cc chn DBx.Cn khi chghi, ngha l MPU xut thng tin iu khin cho LCD thng qua cc chn DBx.

    3> Skhi ca HD44780:3> Skhi ca HD44780:

    hiu r hn chc nng cc chn v hot ng ca chng, ta tm hiu squa chp HD44780 thng qua cchiu r hn chc nng cc chn v hot ng ca chng, ta tm hiu squa chp HD44780 thng qua cc

    khi cbn ca n.khi cbn ca n.

    Hnh 3 : Skhi ca HD44780Hnh 3 : Skhi ca HD44780

    TRUY CPTRUY CP

    FOLLOW BY EMAILFOLLOW BY EMAIL

    Email address...

    thiu cbn v LCD 16x2 ~ in TMy Tnh http://www.dientumaytinh.com/2012/03/gioi-thieu-co-ban-ve-lcd-

    3 11/6/2012

  • 8/12/2019 Tim Hieu LCD 16x2

    4/13

    a> Cc thanh ghi :a> Cc thanh ghi :

    Chp HD44780 c 2 thanh ghi 8 bit quan trng : Thanh ghi lnh IR (Instructor Register) v thanh ghi dliu Chp HD44780 c 2 thanh ghi 8 bit quan trng : Thanh ghi lnh IR (Instructor Register) v thanh ghi dliu

    DR (Data Register)DR (Data Register)

    - Thanh ghi IR : iu khin LCD, ngi dng phi ra lnh thng qua tm ng bus DB0-DB7. Mi lnh- Thanh ghi IR : iu khin LCD, ngi dng phi ra lnh thng qua tm ng bus DB0-DB7. Mi lnh

    c nh sn xut LCD nh a chr rng. Ngi dng chvic cung cp a chlnh bng cch np vo thanhc nh sn xut LCD nh a chr rng. Ngi dng chvic cung cp a chlnh bng cch np vo thanh

    ghi IR. Ngha l, khi ta np vo thanh ghi IR mt chui 8 bit, chp HD44780 stra bng m lnh ti a chm IRghi IR. Ngha l, khi ta np vo thanh ghi IR mt chui 8 bit, chp HD44780 stra bng m lnh ti a chm IR

    cung cp v thc hin lnh .cung cp v thc hin lnh .

    VD :VD : Lnh hin thmn hnh c a chlnh l 00001100 (DB7DB0)Lnh hin thmn hnh c a chlnh l 00001100 (DB7DB0)

    Lnh hin thmn hnh v con tr c m lnh l 00001110Lnh hin thmn hnh v con tr c m lnh l 00001110

    - Thanh ghi DR : Thanh ghi DR dng cha dliu 8 bit ghi vo vng RAM DDRAM hoc CGRAM- Thanh ghi DR : Thanh ghi DR dng cha dliu 8 bit ghi vo vng RAM DDRAM hoc CGRAM

    (chghi) hoc dng cha dliu t2 vng RAM ny gi ra cho MPU (chc). Ngha l, khi MPU(chghi) hoc dng cha dliu t2 vng RAM ny gi ra cho MPU (chc). Ngha l, khi MPU

    ghi thng tin vo DR, mch ni bn trong chp stng ghi thng tin ny vo DDRAM hoc CGRAM. Hoc khighi thng tin vo DR, mch ni bn trong chp stng ghi thng tin ny vo DDRAM hoc CGRAM. Hoc khi

    thng tin va chc ghi vo IR, dliu a chny trong vng RAM ni ca HD44780 sc chuyn rathng tin va chc ghi vo IR, dliu a chny trong vng RAM ni ca HD44780 sc chuyn ra

    DR truyn cho MPU.DR truyn cho MPU.

    => Bng cch iu khin chn RS v R/W chng ta c thchuyn qua li gi2 thanh ghi ny khi giao tip vi=> Bng cch iu khin chn RS v R/W chng ta c thchuyn qua li gi2 thanh ghi ny khi giao tip vi

    MPU. Bng sau y tm tt li cc thit lp i vi hai chn RS v R/W theo mc ch giao tip.MPU. Bng sau y tm tt li cc thit lp i vi hai chn RS v R/W theo mc ch giao tip.

    RSRS R/WR/W Chc nngChc nng

    00 00 Ghi vo thanh ghi IR ra lnh cho LCDGhi vo thanh ghi IR ra lnh cho LCD

    00 11 c cbn DB7 v gi trca bm a chDB0-DB6c cbn DB7 v gi trca bm a chDB0-DB6

    11 00 Ghi vo thanh ghi DRGhi vo thanh ghi DR

    11 11 c dliu tDRc dliu tDR

    Bng 2 : Chc nng chn RS v R/W theo mc ch sdngBng 2 : Chc nng chn RS v R/W theo mc ch sdng

    b> Cbo bn BF: (Busy Flag)b> Cbo bn BF: (Busy Flag)

    Khi thc hin cc hot ng bn trong chp, mch ni bn trong cn mt khong thi gian hon tt. KhiKhi thc hin cc hot ng bn trong chp, mch ni bn trong cn mt khong thi gian hon tt. Khi

    ang thc thi cc hot ng bn trong chip nhth, LCD bqua mi giao tip vi bn ngoi v bt cBF (thngang thc thi cc hot