Cov txheej txheem:

HD44780 LCD rau I2C Adapter Board rau Bus Pirate: 9 Kauj Ruam
HD44780 LCD rau I2C Adapter Board rau Bus Pirate: 9 Kauj Ruam

Video: HD44780 LCD rau I2C Adapter Board rau Bus Pirate: 9 Kauj Ruam

Video: HD44780 LCD rau I2C Adapter Board rau Bus Pirate: 9 Kauj Ruam
Video: Hiển thị giá trị độ ẩm đất lên LCD- Robot cho mọi người 2024, Kaum ib hlis
Anonim
HD44780 LCD rau I2C Adapter Board rau Bus Pirate
HD44780 LCD rau I2C Adapter Board rau Bus Pirate
HD44780 LCD rau I2C Adapter Board rau Bus Pirate
HD44780 LCD rau I2C Adapter Board rau Bus Pirate

Tus cwj pwm pheej yig LCDs raws li HD44780 chipset tuaj hauv ntau qhov ntau thiab tsawg: 2x16, 4x20, thiab lwm yam. 8 ntsis xav tau tag nrho 11 kab ntawv, 4bit xav tau 7 (6 rau kev sau nkaus xwb). Qee cov LCDs txhawb nqa cov ntaub ntawv xov xwm ntxiv, zoo li VFD Kuv tau them ntawm Hack Ib Hnub. HD44780 LCDs feem ntau yog 5volt ntu nrog cais cais rau lub teeb nraub qaum. Lub Tsheb Npav Pirate tsuas muaj tsib 5volt kam rau ua I/O pins, yog li peb tau tsim lub khoos phis tawj me me nrog tus pin txaus los tswj lub LCD. Tsheb Npav Pirate tswj lub rooj tsav tsheb sib txuas los ntawm nws lub tsev qiv ntawv sib txuas hauv LCD. Muaj txuas ntxiv nyeem txog Bus Pirate HD44780 tus cim LCD adapter board thiab lub tsev qiv ntawv sib cuam tshuam. Kuv tuaj yeem muaj PCBs, cov khoom siv, lossis cov khoom siv sib dhos tsim los ntawm Seeed Studio txog $ 15, suav nrog kev xa khoom thoob ntiaj teb, ntau ntxiv ntawm no. Kuv tsis suav nrog qee cov ntsiab lus ua qauv thiab HTML cov ntxhuav hauv Cov Lus Qhia, koj tuaj yeem pom thawj daim ntawv tshaj tawm ntawm Cov Ntawv Tsis Txaus Siab blog.

Kauj ruam 1: Kho vajtse

Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse
Kho vajtse

Txheej txheem cej luam Hauv kab lus no peb piav qhia I2C adapter board rau HD44780-based LCDs. Peb ua kom pom nws nrog Bus Pirate universal serial interface. Tsheb Npav Pirate qhov chaws rau I2C-based HD44780 lub tsev qiv ntawv sib cuam tshuam yog pej xeem, yog li nws tuaj yeem hloov kho rau koj tus kheej cov haujlwm. HardwareFull loj Circuit Court duab [PNG]. Lub Circuit Court thiab PCB tau tsim nrog cov dawb version ntawm Cadsoft Eagle. Cov ntaub ntawv tsim qauv tuaj yeem rub tawm los ntawm Bus Pirate SVN. Ua ntej siv lub rooj hloov pauv, nco ntsoov txheeb xyuas cov ntaub ntawv rau koj lub LCD tiv thaiv tus pin pinout. Tsis yog txhua lub LCDs zoo ib yam. PCF8574 I/O expander IC Qhov no yog qhov yooj yim 8 I/O expander nti uas tau tswj los ntawm ob-xaim I2C interface. I2C interface tuaj yeem nkag tau los ntawm header JP1. The PCF8574 ua haujlwm los ntawm 2.5 txog 5volts. Cov I/O pins ua haujlwm ntawm cov khoom siv hluav taws xob, yog li yog peb pub nws 5volts nws cuam tshuam LCD ntawm 5volts. C1 (0.1uF) txiav txim siab IC los ntawm kev hloov pauv ntawm lub zog hluav taws xob. One tus pin ntawm PCF8574 tswj 3mm LED (LED1) los ntawm kev txwv tam sim no resistor R2 (1000 ohms). Lub teeb ci LED los qhia txog kev sib txuas lus zoo ntawm Bus Pirate thiab lub adapter. PCF8574 tsis tuaj yeem siv hluav taws xob txaus tam sim no rau lub zog LED, yog li peb ua lub zog LED los ntawm 5volt mov thiab hloov hauv av. LCD Lub khoos phis tawj adapter sib txuas lus nrog HD44780-raws tus cwj pwm LCD hauv 4bit ua ke sib cuam tshuam hom. 4bit interface pins - RS, RW, EN, thiab D4 -D7 - txuas nrog rau xya ntawm PCF8574 I/O pins. Peb nyiam siv 0.1 "txiv neej tus pin header los txuas lub adapter rau LCD, koj tuaj yeem feem ntau ntsaws LCD tiv thaiv tus pin los tsim kev sib cuag txaus rau kev sim nrawm. Trimmer resistor R1 (10K) muab qhov sib piv hloov qhov hluav taws xob rau tus pin 3 ntawm Lub taub hau LCD. Peb tsis txuas lub teeb nrig vim tias muaj ntau yam sib txawv ntawm lub teeb pom kev zoo. Muab lub zog rau lub teeb pom kev zoo LED tuaj yeem ua rau lub vijtsam puas xav tau qhov tsis zoo. header JP2. Peb muab tus pin thib ob lub hwj chim txuas rau Bus Pirate tus rub tawm cov neeg tawm tsam. PCB Circuit thiab PCB tau tsim nrog cov dawb version ntawm Cadsoft Eagle. Cov ntaub ntawv tsim tuaj yeem rub tawm los ntawm Bus Pirate SVN. PCB yog ib leeg-ib sab, txhua qhov dhau los ntawm qhov tsim nrog ib lub xaim xaim xaim (pom liab). Peb tuaj yeem muaj PCBs, cov khoom siv, lossis cov khoom siv sib dhos tsim los ntawm Seeed Studio txog li $ 15, suav nrog kev xa khoom thoob ntiaj teb, ntau dua no. txhua th qhov ntxhib-qhov) C10.1uF/10volts+R110000 (10K) ohm ib leeg tig trimmer/potentiometer, 6mmR21000 (1K) ohm resistor, 1/4 wattLED13mm (T1) LED, redJP1+JP20.1 "txiv neej header, 5 pinsIC1PCF8574N, 8 ntsis I2C I/O expander DIP16ICS116 tus pin DIP qhov rau IC1I tsis tuaj yeem suav nrog qee qhov kev teeb tsa ntsiab lus thiab HTML cov ntxhuav hauv Cov Lus Qhia, koj tuaj yeem pom thawj daim ntawv tshaj tawm ntawm Cov Ntawv Tsis Txaus Siab blog.

Kauj ruam 2: Kev sib txuas

Kev sib txuas
Kev sib txuas

Ntaus: HD44780 cim LCD. Bus: 4bit sib npaug, nrog PCF8574 I2C adapter board. Power yuav tsum tau: 5volts. References: piv txwv ntaub ntawv [PDF], HD44780 hais kom ua siv, HD44780 LCD uber-site. Complaub Tsheb Pirate sib tham cav rau qhov ua qauv qhia no. tsim lub adapter rau lub tsev qiv ntawv LCD ntawm Bus Pirate universal serial interface, tab sis nws yuav ua haujlwm nrog txhua yam uas tuaj yeem hais lus I2C raws tu qauv. Ua tibzoo saib Bus Bus Pirate qhov chaws rau tus piv txwv I2C-> HD44780 kev siv. Cov lus kuj tseem qhia txog kev sib txuas raw mus rau PCF8574 IC yog tias koj ua raws nrog yam tsis muaj lub rooj tsav xwm txuas. Kev sib txuas I2C ntawm tus adapter thiab Bus Pirate xav tau rub tawm cov neeg tawm tsam ntawm 2 thiab 10K. Nov yog cov ntaub ntawv ntau ntxiv txog kev sib xyaw hluav taws xob cuam tshuam nrog rub tawm, thiab Bus Pirate on-board rub-up resistors. Kuv tsis tuaj yeem suav nrog qee qhov kev teeb tsa ntsiab lus thiab HTML cov ntxhuav hauv Cov Lus Qhia, koj tuaj yeem pom thawj daim ntawv tshaj tawm ntawm Cov Ntawv Tsis Txaus Siab blog.

Kauj Ruam 3: Kauj Ruam 1. Teeb Lub Tsev Qiv Ntawv

Kauj Ruam 1. Teeb Lub Tsev Qiv Ntawv
Kauj Ruam 1. Teeb Lub Tsev Qiv Ntawv

Kev sib cuam tshuam Peb tau npog cov qauv tsim thiab yuav txuas nws li cas rau Bus Pirate, tam sim no nws yog lub sijhawm kawg los sau ib yam dab tsi rau LCD. HiZ> m <<11 <<1 <<W <

p << Yog2 <<v <<< tau txais daim ntawv tshaj tawm voltageVOLTAGE MONITOR: 5V: 4.9 | 3.3V: 3.3 | VPULLUP: 5.0 << CovNias 'm' hauv Bus Pirate lub dav hlau thiab xaiv lub tsev qiv ntawv LCD. Tam sim no nws tsuas yog txhawb HD44780 tus cim LCDs siv PFC8574 adapter piav qhia hauv thawj ib nrab ntawm kab lus no (xaiv 1). Ua kom lub zog siv hluav taws xob (loj 'W') thiab rub tawm cov khoom tiv thaiv (ntawv qhia zaub mov 'p'). Txheeb xyuas qhov ntsuas hluav taws xob (ntawv qhia zaub mov 'v') thiab nco ntsoov tias rub tawm qhov hluav taws xob (Vpullup) nyeem ib puag ncig 5volts.

Kauj Ruam 4: Kauj Ruam 2. Pib dua thiab Pib Ua Haujlwm

Kauj Ruam 2. Pib dua thiab Pib Ua Haujlwm
Kauj Ruam 2. Pib dua thiab Pib Ua Haujlwm
Kauj Ruam 2. Pib dua thiab Pib Ua Haujlwm
Kauj Ruam 2. Pib dua thiab Pib Ua Haujlwm

Cov lus no piav qhia ib-byte cov lus txib uas tswj hwm HD44780 LCD, ntawm no yog cov ncauj lus kom ntxaws. Cov lus txib no tuaj yeem nkag los ntawm Bus Pirate cov kab hais kom ua, tab sis peb tau tsim macros rau lawv feem ntau kom txuag sijhawm. LCD> (0) <<< qhia cov zaub mov macro0. Macro menu <<< cov ntawv qhia zaub mov1. LCD Pib dua << <pib dua lub LCD2. Pib LCD <<< rov pib dua thiab pib ua LCD3. Clear LCD <<< ntshiab LCD, rov qab tus cursor rau 04. Cursor txoj haujlwm ex: (4: 0) <<< teeb tsa tus cursor postion5. Write test text <<Macro 0 qhia txog cov ntawv qhia zaub mov rau txhua hom Pirate Bus. LCD> (2) <<< pib ua LCD duab tso saib kab: 1. 1 <<< ib kab lus tso saib2. Ntau <<2 'RESET <<< macro 2 suav nrog rov pib ua ntu zus INIT <<Pib pib LCD macro (2) teeb tsa lub vijtsam rau 4bit interface hom, ua kom pom tus cursor, thiab teeb tsa ob peb lwm yam kev xaiv muaj txiaj ntsig. Kho tus naj npawb ntawm cov kab tso saib, xaiv 1 rau ib kab ib kab lus, lossis 2 rau tag nrho lwm cov lus. Tom qab pib ua haujlwm, lub vijtsam yuav tsum pom meej nrog tus cursor pom ntawm lub ces kaum. Yog tias nws tsis ua haujlwm, txheeb xyuas I2C kev txuas, rub tawm cov neeg tawm tsam, thiab lub zog xa khoom, tom qab ntawd sim dua. Macro 1 tsim cov ntu no. Macro 2 suav nrog kev rov pib ua ntu zus, yog li tsis tas yuav siv macro 1 ua ntej macro 2.

Kauj Ruam 5: Kauj Ruam 3. Sau Cov Ntawv Cim

Kauj Ruam 3. Sau Cov Ntawv Cim
Kauj Ruam 3. Sau Cov Ntawv Cim
Kauj Ruam 3. Sau Cov Ntawv Cim
Kauj Ruam 3. Sau Cov Ntawv Cim

LCD> (6:80) <<Cov lej sau macro sau LCD nrog cov lej ntsuas nruab nrab ntawm 0 thiab 9. Tus lej tom qab cov nyuv qhia rau Bus Pirate pes tsawg tus lej ntsuas los sau, peb siv 4x20LCD, yog li peb sau 80 tus lej los sau nws. Daim ntawv ceeb toom tias tus cursor xaus ntawm txoj haujlwm 0, hauv thawj '0'. LCD> (7:80) <<Cov cim sau macro sau LCD nrog cov cim ASCII, nkag mus rau qhov ntau tom qab cov nyuv. Daim ntawv ceeb toom tias kab nrig nrig txuas ntxiv ntawm qhov thib peb, thib peb ntawm qhov thib ob, thiab qhov thib ob ntawm qhov kawg. Cov cim tsis txuas ntxiv vim tias cov cim LCDs tsis qhwv los ntawm ib kab mus rau lwm qhov. Peb yuav tham me ntsis ntxiv txog qhov no tom qab.

Kauj Ruam 6: Kauj Ruam 4. Ntshiab LCD

Kauj Ruam 4. Ntshiab LCD
Kauj Ruam 4. Ntshiab LCD

LCD> (3) <<Qhov tseeb LCD loj xa HD44780 hais kom tshem tawm lub vijtsam thiab xa tus cursor rov mus rau thawj txoj haujlwm. Nkag mus '[0b1' hauv Bus Pirate los teeb tsa lub interface rau kev hais kom ua hom ([) thiab xa HD44780 kev tshuaj ntsuam kom meej (0b00000001) yam tsis muaj qhov loj.]

Kauj Ruam 7: Kauj Ruam 5. Ntaus Ntawv

Kauj Ruam 5. Ntaus Ntawv
Kauj Ruam 5. Ntaus Ntawv
Kauj Ruam 5. Ntaus Ntawv
Kauj Ruam 5. Ntaus Ntawv

LCD> (8) <<< ntxig tus neeg siv cov ntawv nkag mus rau kab ntawv nkag mus rau ntawm txoj haujlwm tus cursor. HD44780 LCD demo <<Tom qab tshem lub LCD hauv qib 4, tus cursor tau muab tso rau ntawm thawj qhov thaiv. Peb kuj tseem tuaj yeem teeb tsa nws nrog cov lej (4: 0), uas txav tus cursor mus rau tus cim thawj. Qhov ntxig cov ntawv ntawm tus cursor macro nug cov ntawv nkag, thiab tom qab ntawd luam nws mus rau LCD thaum koj nias nkag. LCD> (4 0x40) <& lt

LCD> (8) <<< ntxig cov ntawv Sau cov ntawv kom ntxig rau ntawm txoj haujlwm tus cursor. Bus Pirate v2go <<Sau ntawv mus rau kab thib ob yog nyuab nyuab dua, nws yeej pib ntawm tus cim 64 ntawm 4x20 LCD. Yog tias koj txuas ntxiv los ntawm qhov kawg ntawm kab 1 (tus cim 20) ces koj yuav xaus rau thaum pib ntawm kab peb! Nplooj ntawv no muaj qhov sau zoo ntawm daim duab qhia chaw rau ntau tus cim LCD ntau qhov ua ntej, peb tso tus cursor ntawm kab thib ob (4: 0x40). Tom ntej no, qhov 'ntxig cov ntawv' macro tuav peb cov lus nkag thiab luam nws mus rau LCD. LCD> (4: 0x14) (8) (4: 0x54) (8) <<< ntau cov kab lus sib xyaw ua ke sau cov ntawv nkag mus rau ntawm txoj haujlwm tus cursor. Firmware v2.0+ <<< peb ntaus qhov no Sau cov ntawv nkag mus rau ntawm txoj haujlwm tus cursor. DangerousPrototypes <<Lub Tsheb Npav Pirate lees txais ntau lub macros ntawm tib kab, yog li tag nrho lub vijtsam tuaj yeem sau ib zaug. Peb tau sau ntawv mus rau ob kab kawg nrog ib kab ntawm kab lus sib txuas peb tuaj yeem siv '(3) (4: 0) (8) (4: 0x40) (8) (4: 0x14) (8) (4: 0x54) (8) 'kom tshem tawm cov LCD thiab sau tag nrho plaub kab nrog rau ib qho lus nkag nkag.

Kauj Ruam 8: Kauj Ruam 6. Nyeem Los Ntawm LCD

Kauj Ruam 6. Nyeem Los Ntawm LCD
Kauj Ruam 6. Nyeem Los Ntawm LCD

Lub Tsheb Npav Pirate thiab LCD adapter board tuaj yeem nyeem los ntawm LCD. Peb mam li nyeem cov ntawv peb tau sau rau lub vijtsam (DDRAM), tab sis koj tseem tuaj yeem nyeem cov chaw thiab tus cwj pwm tus cwj pwm (CGRAM) los ntawm kev teeb tsa qhov chaw nyob raug. LCD> [0b10000000 '' '<<< teeb tsa tus nyeem ntawv' '] HD44780 RS LOW, COMMAND MODE <<< sau npe xaiv tus pin lowCMD WRITE: 0x80 <<Ua ntej tshaj, peb qhia Tsheb Npav Pirate xa cov ntaub ntawv mus rau LCD hais kom sau npe ([). Tom ntej no, peb siv teeb tsa DDRAM chaw nyob hais kom ua (0b1xxxxxxx) los teeb tus nyeem ntawv taw qhia rau pib DDRAM (xxxxxxx = 0000000).] LCD>] rrrrrrr <<< nyeem cov ntaub ntawv nco HD44780 RS HIGH, DATA MODE <<< sau npe xaiv pin highREAD: 0x48 <<< 'H'READ: 0x44 <<<' D'READ: 0x34 <<< '4'READ: 0x34 <<<' 4'READ: 0x37 <<< '7'READ: 0x38 < << '8'READ: 0x30 <<<' 0'LCD> Thaum kawg, qhia rau Bus Pirate nyeem los ntawm cov ntaub ntawv nco (]), thiab tom qab ntawv nyeem ob peb bytes (rrrrrrr). Peb tau txais "HD44780", cov ntawv peb tau sau rau lub vijtsam hauv kauj ruam 5. Koj tseem yuav tsum tuaj yeem siv qhov luv luv r: 7 los nyeem xya bytes, tab sis nws tsis ua haujlwm hauv qhov firmware tam sim no - peb yuav kho qhov no ua ntej tso tawm tom ntej.

Kauj Ruam 9: Ua Ntau Ntxiv

Ua Ntau
Ua Ntau

Muab cov lus piav qhia dav dav ntawm StepThe HD44780 character LCD adapter is a ke accessory for the Bus Pirate. Nws tuaj yeem siv rau qhov kev sim nrawm, lossis ntau dua kev txhim kho logic. lossis sib sau ua ke cov khoom siv tsim los ntawm Seeed Studio txog $ 15, suav nrog kev xa khoom thoob ntiaj teb, ntau ntxiv ntawm no. Kuv tsis tuaj yeem suav qee qhov kev teeb tsa cov ntsiab lus thiab HTML cov ntxhuav hauv Cov Lus Qhia, koj tuaj yeem pom thawj daim ntawv tshaj tawm ntawm Cov Ntawv Tsis Txaus Siab blog.

Pom zoo: