Cov txheej txheem:

Kev cuam tshuam 8051 Microcontroller Nrog Lcd hauv 4-ntsis Hom: 5 Cov Kauj Ruam (nrog Duab)
Kev cuam tshuam 8051 Microcontroller Nrog Lcd hauv 4-ntsis Hom: 5 Cov Kauj Ruam (nrog Duab)

Video: Kev cuam tshuam 8051 Microcontroller Nrog Lcd hauv 4-ntsis Hom: 5 Cov Kauj Ruam (nrog Duab)

Video: Kev cuam tshuam 8051 Microcontroller Nrog Lcd hauv 4-ntsis Hom: 5 Cov Kauj Ruam (nrog Duab)
Video: Intro to the PIC32, Part 2 of 3: demo on a PIC32 board (EECS 2021 Class 10) 2024, Hlis ntuj nqeg
Anonim
Kev cuam tshuam 8051 Microcontroller Nrog Lcd hauv 4-ntsis Hom
Kev cuam tshuam 8051 Microcontroller Nrog Lcd hauv 4-ntsis Hom

Hauv qhov kev qhia no peb yuav qhia koj txog yuav ua li cas peb tuaj yeem cuam tshuam lcd nrog 8051 hauv 4-ntsis hom.

Kauj Ruam 1: Siv Software:

Siv Software
Siv Software
Siv Software
Siv Software
Siv Software
Siv Software

Raws li peb tab tom qhia proteus simulation yog li CODING THIAB YUAV UA LI CAS KOJ YUAV TSUM PAUB:

1 Keil uvision: Lawv yog cov khoom lag luam ntau los ntawm keil. yog li koj yuav xav tau c51 tus neeg sib tw. Koj tuaj yeem rub tawm software ntawd los ntawm no

2 Proteus Software rau simulation: Qhov no yog software los qhia simulation. Koj yuav tau txais cov ntaub ntawv ntau los rub tawm cov software no.

Yog tias koj ua nws hauv kho vajtse ces koj yuav xav tau ib lub software uas yog flash magic los tso cov cai hauv koj lub khoos phis tawj. Nco ntsoov flash magic tau tsim los ntawm nxp. Yog li koj tsis tuaj yeem xa tag nrho 8051 tsev neeg microcontroleer los ntawm cov software no. Yog li Philips raws tus tswj hwm nkaus xwb koj tuaj yeem rub tawm.

Kauj Ruam 2: Cov Cheeb Tsam Yuav Tsum Tau:

Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau

Nov ntawm peb cov vis dis aus peb tab tom siv kev sim ua piv txwv tab sis meej yog tias koj ua nws hauv koj cov cuab yeej koj yuav xav tau cov khoom siv no rau txoj haujlwm no:

8051 pawg thawj coj loj: Yog li yog tias koj muaj lub rooj tsavxwm no nws yuav zoo dua yog li koj tuaj yeem yooj yim upload cov cai los ntawm koj tus kheej.

LCD 16*2: Nov yog 16*2 lcd. Hauv lcd no peb muaj 16 tus pin.

USB rau UART hloov pauv: Qhov no yog 9Pin D hom txiv neej txuas rau Rs232 O/p Jumper Wires

Kauj Ruam 3: Daim duab Circuit:

Daim duab kos duab
Daim duab kos duab

Kauj Ruam 4: Txoj Cai Ua Haujlwm ntawm Txoj Haujlwm no:

Raws li hauv 8 ntsis peb xav tau txuas txhua 8 cov ntaub ntawv pins ntawm lcd rau microcontroller. Yog li tag nrho 11 tus pin ntawm microcntroller peb yuav tsum siv raws li peb muaj 3 tus pin tswj (rs, rw, e) hauv lcd ib yam. Yog li qhov zoo ntawm lcd hauv 4 ntsis yog tias peb tau txuag 4 pins ntawm microcontroller kom peb tuaj yeem siv cov pins no rau lwm txoj haujlwm.

Tam sim no txoj cai ua haujlwm ntawm txoj cai yog yooj yim heev. Ua ntej koj tsuas yog rub tawm cov cai.

Ok, Tam sim no kuv yuav ua ib txoj haujlwm los ntawm cov cai thiab yuav qhia yuav ua li cas hais kom ua lossis cov ntaub ntawv lcd tau txais. Hauv peb cov cai ua ntej cov lus qhia yog

cmd (0x08);

Yog li tam sim no nws yuav mus rau nws lub ntsiab lus

tsis muaj dab tsi cmd (tsis kos npe a) {

tsis kos npe x;

x = a & 0xf0;

cmd1 (x);

x = (a << 4) & 0xf0;

cmd1 (x);

}

yog li hauv cov haujlwm saum toj no koj tuaj yeem pom a tsis muaj dab tsi tab sis 0x28. Tam sim no dhau x = a & 0xf0, qis nibble yuav dhau los ua 0. raws li peb tab tom siv THIAB tus neeg teb xov tooj nrog 0xf0. Yog li hauv nibble siab dua peb tsuas muaj cov ntaub ntawv, tom qab ntawd los ntawm cmd1 (x) peb tab tom xa 0x20 mus rau chaw nres nkoj 2 thiab lcd txuas nrog cov khoom siab dua ntawm chaw nres nkoj 2 yog li nws yuav tau txais 2, tam sim tam sim no peb xav tau xa tom ntej nibble uas tsis muaj dab tsi ua 0x8. Yog li rau qhov koj tuaj yeem pom hauv txoj haujlwm x = (a << 4) & 0xf0, peb tab tom hloov tus nqi 4 zaug thiab tom qab ntawd peb tau siv thiab ua haujlwm nrog 0xf0.

Yog li cia li nkag siab qhov no

a << 4 tsis muaj dab tsi tab sis 0x28 << 4, uas txhais tau tias 00101000 << 4, Yog li peb yuav tau txais

10000000 thiab peb tab tom nrog 0xf0 thiab peb yuav tau 0b10000000 uas yog 0x80, thiab los ntawm kev ua haujlwm tom ntej cmd1 (x) peb xa cov ntaub ntawv ntawd mus rau lcd thiab tam sim no nws yuav tau txais 0x80 yog li txoj hauv kev no peb tau xa tag nrho cov ntaub ntawv 0x28.

Yog li tib txoj hauv kev txhua lo lus txib thiab cov ntaub ntawv lcd yuav tau txais.

Kuv vam tias koj nkag siab qhov no. Tseem koj tuaj yeem tshawb xyuas cov vis dis aus uas yog hauv cov kauj ruam tom ntej. Cov lus piav qhia tag nrho txoj haujlwm tau muab hauv qhov vis dis aus.

Kauj ruam 5: Code thiab Video

Koj tuaj yeem tau txais cov cai los ntawm peb GitHub Txuas

Kev piav qhia tag nrho txoj haujlwm tau muab rau hauv cov vis dis aus saum toj no.

Yog tias koj muaj kev tsis ntseeg txog txoj haujlwm no thov tawm lus rau peb hauv qab no. Thiab yog tias koj xav kawm paub ntau ntxiv txog kev teeb tsa kab ke koj tuaj yeem mus ntsib peb tus youtube channel

Thov mus saib thiab nyiam peb Facebook nplooj ntawv rau hloov tshiab tas li.

Cov channel no tsuas yog tam sim no peb tau pib tab sis txhua hnub koj yuav tau txais qee cov vis dis aus hais txog kev teeb tsa thiab IoT.

Ua tsaug & Ua tsaug,

Pom zoo: