Tsev > Xov xwm > Ntsiab lus

LCD Kov Screen Controller

Dec 13, 2017

Lub vijtsam LCD npo xws li cov ntaub ntawv txuas nruab nrab, lub tshuab cim xeeb (FSMC_Ctrl (SDRAM_Ctrl), kua Crystal Display module (TFT_Ctrl) thiab ib txoj hlua tswj tuav (TOUCH_Ctrl), daim duab thaiv kab hauv duab 2.

2.png

LCD touch screen npo ua haujlwm: microprocessor (STM32F407) los ntawm FSMC npav xa cov ntaub ntawv xa mus rau FPGA, FSMC_Ctrl module tau txais cov ntaub ntawv, lub sij hawm tswj module SDRAM_Ctrl sau nco SDRAM, lub caij tswj ntawm TFT_Ctrl module ntawm SDRAM los nyeem cov ntaub ntawv hauv real-time zaub. Lub TOUCH_Ctrl module nti kov tswj nti ADS7843 thiab xa cov haujlwm sib sau ua ke mus rau FSMC_Ctrl module mus tos ARM nyeem nws tsis tu ncua.


1. Cov ntaub ntawv sib cuam tshuam cov ntaub ntawv

Cov ntaub ntawv pauv hloov yog qhov tseem ceeb kom paub txog ob txoj kev sib txuas lus, FSMC tsheb npav xws li CS chip xaiv qhov teeb liab thiab sau lub teeb liab WR, nyeem cov teeb liab khiav hauj lwm RD, qhov chaw tsheb npav AB 25: 0 (multiplexing hom), cov ntaub ntawv npav DB 15: 0 thiab chaw nyob / data multiplexing tswj lub teeb liab NADV (siv qhov chaw nyob multiplexed). Ntawm lawv, tus chip xaiv teeb liab CS, nyeem thiab sau cov haujlwm ntawm WR cov teeb liab RD teeb liab feem ntau pib ntawm qis zog. Thaum sau cov lag luam teeb liab WR rau qis zog, NPAJ xa cov kua siv coj los rau hauv DB, qhov chaw nyob ntawm qhov nce ntawm NADV cov teeb liab, thiab cov ntaub ntawv coj los siv rau ntawm qhov nce ntawm WR cov teeb liab, uas muaj nyob rau ntawm LCD tom qab SDRAM cache. Thaum nyeem cov lag luam kev teeb liab RD tsawg, FPGA xa cov hauj lwm hauv lub npav DB. ARM paub tias qhov kev lag luam kov raws li tus nqi sib txawv ntawm qhov chaw nyob ntawm chaw sau, thiab FSMC tsheb npav ua hauj lwm raws li daim duab qhia nyob hauv daim duab 3.

3.png


2. Cov khoom siv ua kua dej ua kua

Raws li cov qauv tso tawm ntawm cov kua siv lead ua kua, lub teeb liab tswj los ntawm cov qauv no muaj xws li pixel lub teeb liab, kab / teeb meem ntawm daim duab thiab lub teeb liab. Raws li lub sij hawm yuav tsum muaj cov duab LCD, lub sijhawm tswj kev tiv thaiv LCD yog tsim los ntawm FPGA, thiab kev tswj cov teeb liab, teeb liab thiab lub teeb liab thaum pom.

Ntawm lawv, tus ncej scan lub sijhawm sib lawv li raws HSYNC raws li cov lus siv moos, HSYNC yog siv raws li kab teeb liab, thiab VSYNC yog lub teeb liab cov duab sib txuas, thiab qib qis siv tau. Txhua lub voj voos yeej muaj txhij, thaj tsam ntawm lub hauv ntej ntawm VSYNC teeb liab yog daim npav ntawm xub pwg (VBPD + 1), muaj ib daim duab ntawm sab nraud ntawm sab xub pwg (VFPD + 1), VSYNC teeb liab ua ntej nws muaj siab theem (VSPW + 1), hais tias cov duab tho txawv txav ntawm cov teeb meem. Ntawm lawv, VBPD, VFPD, thiab VSPW yog nyob ntawm qhov kev siv moos HSYNC. Ib yam li, txhua kab ntawm kev xa roj teeb, tseem muaj ib lub nra hauv sab nraub qaum (HBPD + 1), sab hauv xub pwg (HFPD + 1), ib qho kev sib tshuam ua ke ntawm qhov teeb meem ntawm lub teeb suab paj nruag (HSPW + 1), thiab pixel clock VCLK ib chav tsev. Rau cov daws teebmeem daws teebmeem LCD, lub sijhawm cov voj voog yog txawv ntawm cov xub pwg hauv xub pwg, lub xub pwg thiab lub teeb liab pauv. Tus neeg tsav tsheb yuav hloov qhov sib txawv ntawm cov ntxaij lim dej nkaus xwb los hloov qhov tsis hloov.

Yuav ua rau tus neeg tsav npo tso saib tsav tsheb rau ntau yam kev sib txawv, hauv FPGA Verilog kho lus xov nrog nrog VCLK, VBPD, VFPD, VSPW, HBPD, HFPD, HSPW tsis txawv hauv npo LCD, siv FSMC npav chaw nyob 2 raws li tus tswj tsis ntawm ib qho screen LCD. Nyob rau hauv daim ntawv thov, peb tsuas xav hloov chaw nyob ntawm cov ntaub ntawv me ntsis rau daim ntawv qhia kom paub qhov teeb tsa ntawm cov tsis, uas yog tsim rau txawv LCD cov ntxaij vab tshaus thiab pab txoj kev txav ntawm cov maub los. Lub sij hawm sib lawv liag ntawm cov kua siv lead ua kua yog tshwm nyob hauv daim duab 4.

4.png

3. Nco cov module

Lub cim xeeb module muaj xws li cov ntaub ntawv qhia ua ntej module, SDRAM maub los thiab cache module, kom ua tiav cov ntaub ntawv tawm tswv yim thiab tso tawm cov ntaub ntawv nyeem. Lub cim xeeb cim qauv qhia hauv daim duab 5.

5.png

4. Cov tswv yim qhia ua ntej

Cov ntaub ntawv qhia ua ntej ntawm tus txheej txheem ua ntej nrog rau kev koom ua ke thiab caching ntawm cov ntaub ntawv. Vim tias cov npav FSMC cov npav yuav qis tshaj qhov ua haujlwm ntawm SDRAM, kom thiaj li daws tau tus nqi nruab nrab ntawm lawv, cov ntaub ntawv muaj cached ua ntej cov ntaub ntawv sau rau SDRAM kom tiv thaiv cov ntaub ntawv tsis tau.

Txhawm rau kom muaj kev sib cev lus ntawm cov ntaub ntawv thiab chaw nyob, tiv thaiv cov duab yuam kev, qhov chaw nyob thiab cov ntaub ntawv qhia tawm los ntawm splicing, splicing tom qab cov ntaub ntawv sau rau ib lub FIFO tsis xav (thawj zaug tawm, FIFO) rau SDRAM.


5. Cache module

Module cache muaj ob zaug siv tib lub cim xeeb (random access memory, RAM), nws lub ntsiab tseem ceeb yog kom ua tiav cov ntaub ntawv tso zis ping-pong cov ntaub ntawv los ntawm ob tug RAM, ping-pong haujlwm raws li muaj nyob hauv daim duab 6.

6.png

Yuav kom paub cov zaub mov ntawm cov ntaub ntawv tso tawm, hauv qhov tob ntawm ob sab hauv SDRAM rov qab FPGA hu rau 2048, dav 16 RAM, los ntawm cov ntaub ntawv cov ntaub ntawv tawm kwj xaiv "thiab" cov ntaub ntawv tawm cov kwj xaiv xaiv "hloov mus tsis tu ncua , tom qab RAM cache cov ntaub ntawv koos tis xa mus rau cov ntaub ntawv ndlwg ua tsev "ua.

Cov ntaub ntawv ntawm txhua cov duab hauv cov txheej txheem tso tawm, thawj zaug rau ob kab teeb meem ua ntej tuaj txog ntawm cov teeb liab synchronous thaum nyeem ntawv ua ntej ntawm cov ntaub ntawv hauv SDRAM, RAM1 thiab RAM2 los sau cov ntaub ntawv ua ntej, kom thawj los ua tau zoo nyeem RAM1 cov lus qhia ua tiav tam sim ntawd ntawm hauv pre SDRAM nyeem cov kab ntawv tom ntej no rau hauv RAM1.

Nyob rau hauv qhov thib ob DE lub teeb liab pab thaj chaw, RAM2 nyeem thiab tso tawm kom pom, thiab txoj kev yog tib yam li RAM1. Nyeg, RAM1 thiab RAM2 nyeem thiab sau ua ke kom tiav cov zis txuas ntxiv ntawm cov ntaub ntawv.


6. sdram maub los

Vim hais tias cov khoom siv LCD yuav tsum tau tso zis tawm thiab tsis cuam tshuam cov ntaub ntawv txhua lub sij hawm, vim li ntawd peb yuav tsum teeb tsa kev lag luam ntawm SDRAM ua qhov tseem ceeb tshaj plaws. Hauv tag nrho SDRAM tswj, peb yuav tsum nyob rau ntawm cov ntaub ntawv nyeem tswj.

SDRAM xws li kev tswj hwm yog tswj cov kev pib, kev txhawb, nyeem thiab sau cov haujlwm ntawm SDRAM, thiab SDRAM nyeem thiab sau ntawv yog qhov tseem ceeb ntawm cov qauv no. Nws yog tus yuam sij rau kev txhim kho cov ntaub ntawv tshiab thiab txo lub nra ntawm ARM cov ntaub ntawv ua.

Yog li no, tus tsim ntawm SDRAM maub los yog mas tsom rau kev txhim kho cov ntaub ntawv hloov tshiab thiab txo ob yam ntawm ARM cov ntaub ntawv tsim kev tsim txom.


Yuav kom txhim kho tus nqi ntawm cov ntaub ntawv muab kho dua, txoj kev ntawm lub sijhawm - sib nyeem ntawv thiab kev sau ntawv yog siv los ua kom siv tag nrho cov sijhawm tsis txaus los ntawm cov ntaub ntawv ntiag tug. Ib lub xov tooj tseem tsim tawm thaum lub sijhawm nyeem ntawv ntawm SDRAM. Qhov siab tshaj tus nqi ntawm lub txee M (M yog kab pixel ntawm cov kua sib txawv ntawm cov kua ua kua), yog li ntawd cov ntaub ntawv zoo tuaj yeem sau ntawv hauv RAM kom nyeem tau yooj yim.

Ntawm qhov one hand, nyeem ntawv tawg ntho nyeem hom yog siv nyob rau hauv tus txheej txheem ntawm kev ua haujlwm hauv SDRAM, txhua tus nyeem 256 cov ntaub ntawv teev tseg dua ib zaug ntxiv rau kev nyeem ntawv tom ntej, txog thaum cov ntaub ntawv siv tau; nyob rau lwm qhov, raws li kev lag luam ping-pong teeb ib qho khoom cais, tus nqi siab tshaj yog Y / 2 (Y rau pixels sib txawv hauv LCD), txhua tus ua tiav 1 ping-pong lag luam ntxiv nrog 1, tias cov ntaub ntawv qhia tiav, SDRAM yuav tsum tos kom txog rau thaum tus ncej tom ntej los tso saib cov ntaub ntawv.

Nyob rau hauv ob lub caij tos kev tiv thaiv kev tswj kom rov qab tau SDRAM cov ntaub ntawv xov tooj, sau cov lag luam ntawm SDRAM, ua kom ntev lub sij hawm ntawm SDRAM sau cov lag luam, sau cov lag luam los ntawm tawg ntwm sau hom, txhua qhov tawg lawm 1 sau 8 cov ntaub ntawv, FSCM siab ceev thiab tsis tuaj yeem input cov ntaub ntawv thaum txuag lub bandwidth ntawm SDRAM, kho cov ntaub ntawv hloov tshiab.

Lub sijhawm ua haujlwm tshiab ua tiav (N yog kho raws li cov kua siv lead ua kua) nyob rau thawj daim ntaw N ntawm txhua cov ntaub ntawv, uas kom txhua lub txhab nyiaj hauv SDRAM tuaj yeem ua kom zoo dua rau hauv 64ms, thiaj li tsis txhob muaj teeb meem ntawm kev ua haujlwm tshiab thiab nyeem thiab sau cov lag luam.


Txhawm rau txhawm rau txhim kho cov kev ntsuas tshiab, txo cov xwm txheej ntawm cov ntaub ntawv siv ua kua NPAB kua dej ua kua, yuav tsum raws li lub sij hawm ntawm cov nyiaj hauv tuam txhab nyiaj tsis txaus siab mus rau 4 txheej, txhua txheej muaj 2MB, SDRAM xws li kev sib tw SDRAM multi buffer mus cuag cov cuab yeej kho vajtse accelerator, nws txoj haujlwm ua haujlwm raws li qhia hauv daim duab 7.

7.png

Tus neeg tsuj tsom xam pom tau los ntawm kev qhia ua ke los ntawm cov lus qhia thiab kev saib xyuas, thiab ua tau ntau yam haujlwm ntawm FPGA ntawm cov ntaub ntawv, xws li ua zauv nyuaj, khiav ntaub ntawv ntawm ib qhov chaw mus rau lwm qhov, thiab ua haujlwm tib lub sijhawm ntau zaus.

Nyob rau hauv cov kua ua kua teeb pom kev, ntawm ib sab, SDRAM yuav muab faib ua 4 theem, Bank1 raws li qhov hauv qab, tig Bank2, Bank3, Bank4, los ntawm cov zov me nyuam ntau, tsis tuaj yeem hloov lub qub lwm qhov ntawm cov zaub, tsis tuaj yeem cheeb tsam los ntawm thawj qhov chaw qhia los mus hloov thaj av uas tsis muaj ntaub ntawv ARM xa cov ntaub ntawv;

Ntawm qhov tod tes, SDRAM muab faib ua 4 buffers. Los ntawm xa cov lus qhia kev cai, peb siv cov lus saib xyuas los ua cov lej ua haujlwm ntawm cov ntaub ntawv thaj tsam tsis sib txawv, thiab paub cov ntawv pom thiab lwm yam haujlwm.

Khaws cov ntaub ntawv ua ntej tso tawm rau hauv Bank1, khaws cov qauv ntaub ntawv tso tawm kom pom hauv Bank2 thiab Bank3, displaying kawg ntawm cov ntaub ntawv kawg ntawm cov ntaub ntawv, tso cov qauv ntaub ntawv tom ntej los ntawm kev qhia, kom ntseeg siab ntawm cov ntaub ntawv cov ntaub ntawv thiab kev txhim kho cov nyhuv pom hauv LCD. Los ntawm multilayer thiab multi lag luam, ib feem ntawm cov ntaub ntawv ua yog faib rau FPGA rau kev ua haujlwm sib luag los txo cov xwm txheej ntawm ARM cov ntaub ntawv ua. Piv nrog cov caj NPAB 's serial zauv, nws tuaj yeem txhim kho cov ntaub ntawv hloov tshiab.