Cov txheej txheem:

Tsim Lub Computer W/ Kev Nkag Siab Yooj Yim ntawm Cov Khoom Siv Hluav Taws Xob: 9 Kauj Ruam (nrog Duab)
Tsim Lub Computer W/ Kev Nkag Siab Yooj Yim ntawm Cov Khoom Siv Hluav Taws Xob: 9 Kauj Ruam (nrog Duab)

Video: Tsim Lub Computer W/ Kev Nkag Siab Yooj Yim ntawm Cov Khoom Siv Hluav Taws Xob: 9 Kauj Ruam (nrog Duab)

Video: Tsim Lub Computer W/ Kev Nkag Siab Yooj Yim ntawm Cov Khoom Siv Hluav Taws Xob: 9 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Tsim lub Computer W/ Kev nkag siab yooj yim ntawm Electronics
Tsim lub Computer W/ Kev nkag siab yooj yim ntawm Electronics

Koj puas tau xav ua piv txwv tias koj tau ntse tiag tiag thiab tsim koj tus kheej lub computer los ntawm kos? Koj puas paub tsis muaj dab tsi hais txog dab tsi nws yuav siv los ua lub computer liab qab yam tsawg kawg nkaus? Zoo, nws yooj yim yog tias koj paub txaus txog hluav taws xob los pov qee ICs ua ke kom raug. Cov lus qhia no yuav xav tias koj ua tau zoo ntawm qhov ntawd, ntxiv rau ob peb yam ntxiv. Thiab yog tias tsis yog, nws tseem yuav tsum tsis txhob nyuaj ua raws yog tias koj paub tias yuav ua li cas breadboarding/prototyping tiav. Lub hom phiaj ntawm cov lus qhia no yog kom koj ua haujlwm "khoos phis tawj" yam tsis paub ntau txog lawv ua haujlwm li cas. Kuv yuav npog cov xov hlau thiab cov hauv paus ntawm cov phiaj xwm, nrog rau muab txoj haujlwm luv luv rau koj. Yog li cia peb pib.

Kauj Ruam 1: Cov Khoom thiab Cov Khoom

Qhov Chaw thiab Khoom
Qhov Chaw thiab Khoom
Qhov Chaw thiab Khoom
Qhov Chaw thiab Khoom

"Computer" xav tau: lub zog, kev tawm tswv yim, kev ua haujlwm, nco thiab tso tawm. Technically peb yuav muaj txhua yam no. Kuv yuav npog cov khoom no hauv qhov kev txiav txim ntawd.

Rau lub zog, koj yuav xav tau 5 volt (ntawm no sau ua 5V) qhov chaw. Nws tau pom zoo tias nws yog ib qho chaw tswj hwm yog li koj tsis txhob kib kib ib feem hauv koj lub voj voog. Peb cov tswv yim yuav yog cov nyees khawm. Kev ua yog piav qhia tus kheej; peb siv tus processor. Nco yuav tsuas yog suav nrog ROM. Tus txheej txheem sab hauv lub hom phiaj sau npe yuav txaus siv raws li RAM. Cov zis yuav yog LEDs.

1 LM7805C - 5V Regulator

1 ZYLOG Z80 - Tus Txheej Txheem

1 AT28C64B - EEPROM

1 74LS273 - Octal D Flip -Flop

1 74HC374E - Octal D Flip -Flop

3 CD4001BE - Quad NOR Gate

1 NE555 - Lub Tshuab Hluav Taws Xob

21K Ohm tus tiv thaiv

1 10K Ohm Resistor

1 10K Ohm Resistor Network; 8 Bussed LOSSIS 8 Ntxiv 10K resistors

11 uF Capacitor

1 100uF Capacitor

1 Laub Khawm

1 3x4 Button Matrix LOSSIS 8 Ntxiv Push Button

8 LED - Kev Xaiv Xim Tsis Muaj Teeb Meem

8 330 Ohm Resistors lossis Resistor Network

1 Tiag tiag Breadboard lossis Ntau Qhov Me

Ntau thiab ntau ntawm Cov Kab

Hauv kuv lub tswv yim kuv muaj tus pas ntawm SRAM teeb tsa. Koj tsis tas yuav txhawj xeeb txog qhov ntawd. Kuv tsuas yog ntxiv nws mus rau cov txheej txheem kom pom tseeb txog kuv li kev siv hluav taws xob tiag tiag thiab kuv ntxiv nws rau hauv Circuit Court rau kev siv yav tom ntej. Kuj ntxiv rau qhov txheej txheem yog plaub quad LOS SIS lub rooj vag (74LS36). Ob lub qhov rooj tsis siv 'cov khoom siv tau txuas rau VCC thiab lawv cov txiaj ntsig tau tso tawm ntab (tsis kos). Tsis tas li tsis kos lossis teev tseg saum toj no yog ob lub capacitors ntawm lub zog hluav taws xob.

Kuv tab tom pub zaub mov tswj 12V rau hauv 5V tus tswj hwm kom pub tag nrho lub khob cij. Nws tau sov dua, yog li kuv txuas lub dab dej kub kom txias nws. Yog tias koj siv tsawg dua 12V los pub tus tswj hwm (siv tsawg kawg 7V), nws yuav tsum txias dua.

Z80 yog qhov uas khawv koob tshwm sim. Nws yuav siv cov lus qhia khaws cia hauv ROM thiab ua rau lawv. EEPROM khaws peb txoj haujlwm rau tus txheej txheem los ua.

Lub octal flip-flop uas yog peb cov cuab yeej tso tawm uas kaw cov ntaub ntawv ntawm cov tsheb npav mus rau nws tus kheej tso tawm. Qhov no tso cai rau peb hloov pauv dab tsi ntawm lub tsheb npav, uas yog kauj ruam tseem ceeb heev ua tiav ntau zaus hauv ib qho kev qhia, yam tsis hloov pauv qhov uas tus neeg siv/saib pom. Cov flip-flop tsis tuaj yeem tsav tam sim no kom pom lub teeb LEDs, yog li lawv pub rau hauv ob ntawm plaub quad NOR lub qhov rooj nti uas ua rau cuam tshuam 8 cov kab ntawv kom tsav cov LEDs. Txij li thaum lawv tawm ntawm lub rooj vag hloov pauv, peb kuj tseem yuav tsum xaim cov LEDs kom thim rov qab, tab sis peb yuav los rau qhov ntawd thaum peb los txog qhov ntawd. Lwm qhov NOR nti yog siv rau kev txiav txim siab logic tab sis tsuas yog siv peb lub rooj vag.

Lub octal flip-flop siv rau cov tswv yim yog qhov tseem ceeb tib yam nkaus. Cov tso tawm flip-flops tuav lawv cov zis los siab lossis qis yog li nws siv tsis tau los tsav tsheb npav; nws yuav tuav cov ntaub ntawv ntawm lub npav. Cov flip-flop siv rau kev hloov pauv hloov tus /RESET tus pin nrog /EN, uas ntau dua lossis tsawg dua txuas cov txiaj ntsig ntawm (thiab los ntawm) lub nti yog li nws yuav tsis tuav cov ntaub ntawv (tri-xeev tso tawm).

Kauj Ruam 2: Txuas lub Hwj Huam, Moos thiab Rov Pib Dua Hluav Taws Xob

Txuas lub Hwjchim, Moos thiab Rov Pib Dua Lub Vev Xaib
Txuas lub Hwjchim, Moos thiab Rov Pib Dua Lub Vev Xaib
Txuas lub Hwjchim, Moos thiab Rov Pib Dua Lub Vev Xaib
Txuas lub Hwjchim, Moos thiab Rov Pib Dua Lub Vev Xaib
Txuas lub Hwjchim, Moos thiab Rov Pib Dua Lub Vev Xaib
Txuas lub Hwjchim, Moos thiab Rov Pib Dua Lub Vev Xaib

NCO TSEG: Rau txhua ntu, xaim lub hwj chim ntsia ua ntej. Ntawm txhua yam kom tsis txhob hnov qab xaim, cov chips yuav tsawg dua qhov muaj sia nyob tsis nco qab txuas lub zog.

Lub zog hluav taws xob yog qhov yooj yim tshaj plaws txuas rau xaim, ua raws los ntawm kev rov pib dua thiab cov xov tooj sib txuas, raws li. Hauv daim duab, 12V lub tswv yim nyob ntawm lub hwj huam hluav taws xob mus rau sab xis. Cov xaim xim av, zais ib qho xim daj hauv qab nws, pub 12V rau tus tswj hwm. Cov txiaj ntsig ntawm tus tswj hwm pub rau txhua lwm lub zog hluav taws xob ntawm lub khob cij thiab txhua lub zog txuas sib koom ua ke vim tias qhov khoom siv hluav taws xob ua haujlwm li cas.

Tus processor yuav tsum muaj lub voj voog moos ua haujlwm. Tsis muaj nws, nws yuav cia li zaum ntawm nws hauv lub xeev pib thiab tsis ua dab tsi. Lub moos ua haujlwm cov txheej txheem sab hauv ua haujlwm hloov pauv kom nws tuaj yeem tsim cov cim qhia kom ua khoom. Txhua lub moos nkag yuav ua, txawm tias yooj yim tiv thaiv thiab khawm khawm. Tab sis nws yuav siv sijhawm ntau teev los ua cov lus qhia. Cov lus qhia kom sau mus rau qhov tso tawm yuav siv 12 mus nyob hauv nws tus kheej. Tej zaum koj tsis xav zaum qhov ntawd thiab nias lub pob 100+ zaug kom tau txais ib lub voj ntawm cov cai (tus lej tiag yog qhov kawg ntawm kev qhia). Qhov ntawd yog NE555 yog rau. Nws ua qhov hloov pauv rau koj thiab nws ua li ntawd ntawm tus lej (kuj) nrawm.

Ua ntej koj pib xaim dab tsi, koj yuav xav mus tom ntej thiab txiav txim siab yuav ua li cas koj xav kom koj cov khoom tso tawm ntawm lub rooj tsavxwm. Kuv lub xov tooj hluav taws xob zoo ib yam tsuas yog muab tso rau hauv qab ntawm pawg thawj coj saib nws yuav tawm ntawm txoj kev ntawm lwm yam khoom. Peb yuav xav tias koj paub yuav ua li cas thiaj ua lub moos yooj yim nrog tus timer. Yog tias koj tsis ua, koj yuav xav saib "555 Astable" thiab ua raws li kev qhia. Siv 1K resistor mus ntawm 5V kev tsheb nqaj hlau thiab tus pin 7 ntawm lub sijhawm (R1) thiab 10K ntawm tus pin 7 thiab tus pin 2 (R2). Nco ntsoov khi tus pin rov pib dua, tus pin 4, mus rau 5V kev tsheb nqaj hlau kom lub sijhawm ua haujlwm tau zoo. Kuv muab ib qho LED tso rau ntawm kuv li kuv tuaj yeem txheeb xyuas tau tias lub moos tau ua haujlwm tiag, tab sis nws tsis xav tau.

Lwm qhov kev xaiv nrog NE555 yog teeb tsa nws ua lub qhov rooj TSIS siv thiab siv 1K tus tiv thaiv los khi cov zis rov qab mus rau cov tswv yim. Feem ntau nws tau pom zoo kom siv 3 lub sijhawm ua qhov no, tab sis kuv pom tias tsuas yog 1 yuav tsum ua haujlwm zoo. Tsuas yog paub tias yog tias koj ua qhov no, nws yuav oscillate ntawm qhov nrawm heev thiab nws yuav nyuaj heev, ua tsis tau txawm tias, los qhia tias LEDs tso tawm yog flashing. Qhov teeb tsa no hu ua "ring oscillator."

Nco ntsoov tias peb tseem tsis tau txuas lub moos mus rau lub khoos phis tawj. Peb tsuas yog ua kom nws npaj tau. Tsis tas li nco ntsoov cov logic nti nyob saum lub moos hauv daim duab. Nws tau ntxiv txoj hauv kev tom qab thiab qhov ntawd tsuas yog qhov chaw ib nrab uas tsim nyog tso rau nws. Nws yog siv rau kev xaiv RAM/ROM. Cov lus qhia no tsis quav ntsej RAM yog li koj yuav tsis muaj lub nti ntawm koj lub rooj tsavxwm.

Tam sim no peb xaim qhov pib dua Circuit. Ua ntej koj yuav tsum nrhiav chaw nyob ntawm koj lub rooj tsavxwm rau nws. Kuv xaiv sab xis ntawm lub moos. Ntxiv koj lub khawm rau lub rooj tsavxwm. Siv 1K resistor los khi ib sab ntawm lub pob rau 5V kev tsheb nqaj hlau. Peb RESET pins ua haujlwm qis, txhais tau tias peb yuav tsum tuav lawv siab. Qhov ntawd yog qhov resistor yog rau. Qhov kev sib tshuam no tseem yog qhov chaw pib teeb tsa txuas. Lwm sab ntawm lub pob mus ncaj rau hauv av. Yog tias koj xav tau lub zog rov pib dua, ntxiv 10uF capacitor rau qhov kev sib txuas ib yam nkaus. Nws yuav ua kom muaj qhov hluav taws xob ntawm qhov pib dua tus pin qis ntev txaus kom qhib qhov hloov pauv hloov pauv hauv lub khoos phis tawj thiab flip-flop.

Kauj Ruam 3: Txuas Z80

Tam sim no peb mus rau qhov tsis txaus ntseeg. Peb yuav tsum xaim tus tsiaj nyaum uas yog Z80. Ntawm kuv lub rooj tsavxwm, kuv tso Z80 nyob rau sab saum toj ntawm tib seem ntawm pawg thawj coj raws li kev rov pib dua. Raws li tau hais ua ntej, xaim lub hwj chim ntsia ua ntej. 5V mus rau tus pin 11 ntawm sab laug thiab hauv av yog ib tus pin nqes tab sis sab xis. Koj kuj tseem tuaj yeem pom qhov txawv qhov dav ntawm lub nti. Nws yuav ua rau koj muaj 3 qhov txuas sib txuas ntawm ib sab ntawm lub khob cij thiab 2 ntawm lwm qhov. Nws tsuas yog ua kom yooj yim dua rau xaim khoom ntxiv yog tias koj xaiv ua li ntawd.

Cov lej lej hauv qab no-Kuv xav tias koj paub yuav suav pes tsawg tus lej ntawm IC-yog cov khoom siv tsis tau siv thiab yuav tsum tau txuas rau txoj kab 5V: 16, 17, 24, 25.

Nco peb lub moos? Nws ouput mus rau tus pin 6 ntawm z80. Kev rov pib dua lub xov tooj txuas rau tus pin 26. Yog tsis muaj lwm yam khoom siv ntawm lub rooj tsavxwm, qhov no yog kom deb li kuv tuaj yeem tau txais koj nrog cov hlua ntawm z80 nws tus kheej. Kev txuas xov txuas ntxiv rau nws yuav ua tiav hauv cov theem tom ntej.

Vim tias kuv twb tau tsim lub Circuit Court ua ntej kuv txawm txiav txim siab sau cov lus qhia no, Kuv yuav tuav ntawm daim duab kom txog rau qib tom ntej.

Kauj ruam 4: Txuas lub ROM

Txuas lub ROM
Txuas lub ROM

NCO TSEG: Koj yuav xav tuav ntawm qhov muab nws tso rau ntawm lub rooj tsavxwm yog tias nws tseem xav tau cov phiaj xwm (ntau ntxiv tom qab ntawd).

Txog ROM, Kuv tso nws nyob ib sab ntawm Z80 ntawm sab xis thiab tseem tshem nws ib tus pin rau ntawm lub khob cij. Qhov no tau tso cai rau kuv xaim lub npav npav ncaj qha, tab sis ntau ntxiv tom qab ntawd. AT28C64B yog EEPROM, lub ntsiab lus nws tuaj yeem ua haujlwm tau ntau zaus los ntawm kev hloov qee tus pin thiab qhib. Peb tsis xav kom peb EEPROM yuam kev rov tsim dua nws tus kheej thaum nws nyob hauv Circuit Court. Yog li ib zaug koj muaj koj lub zog ntsia hlau txuas, xaim tus pin 27 (/WE) mus rau 5V kev tsheb nqaj hlau kom tsis txhob sau cov yam ntxwv zoo rau nws.

Kuv qhov haujlwm me me, kuv tsuas xav tau 5 kab ntawv qis (A0-A4) txuas, tab sis kuv xaim A5, A6 thiab A7 lawm yog li kuv tuaj yeem sau cov haujlwm loj dua yam tsis muaj haujlwm ntxiv. Cov kab ntawv chaw nyob ntxiv (A8-A12) raug khi ncaj qha rau hauv av txhawm rau tiv thaiv tsis xav tau nkag mus rau qhov chaw nyob siab dua los ntawm cov tswv yim ntab. Nrog cov chaw nyob tsis tau siv cov khoom siv khi rau hauv av thiab sau kev tswj khi rau 5V, thaiv qhov seem yog qhov yooj yim dua. Nrhiav A0 ntawm tus txheej txheem thiab xaim nws mus rau A0 ntawm ROM. Tom qab ntawd pom A1 ntawm tus txheej txheem thiab xaim nws mus rau A1 ntawm ROM. Ua qhov no kom txog thaum koj txuas tag nrho cov chaw nyob ua ke. Hauv daim duab, kuv qhov chaw nyob npav mus rau ROM tau ua tiav hauv txoj kab xiav. Qhov chaw nyob npav mus rau RAM tau ua tiav hauv kab liab. Cov xov hlau no tau raug txiav ua ntej thiab tshem tawm thaum lawv los rau hauv cov khoom siv thaiv kab hluav taws xob thiab tau zoo tshaj plaws rau cov hlua no.

Tom qab koj tau txais cov chaw nyob xaim (qhov no hu ua chaw nyob npav), ua qhov zoo ib yam rau tus pin cim D0, tom qab ntawd D1, D2, thiab lwm yam. Ua qhov no rau tag nrho cov ntaub ntawv pins (D0 - D7) thiab koj muaj cov ntaub ntawv tsheb npav. Peb yuav luag ua tiav txuas lub ROM. Nrhiav ROM's /CE (nti pab tau) tus pin thiab xaim nws mus rau tus txheej txheem tus pin 19, /MREQ (thov nco) thiab tom qab ntawd pom ROM's /OE (tso tawm kom pom) thiab xaim nws mus rau tus lej pin 21, /RD (nyeem). Tam sim no peb tau ua tiav. Tag nrho cov no tau ua tiav nrog cov xov hluav taws xob vim tias lawv yuav tsum tau mus rau lwm sab ntawm lub tshuab ua haujlwm thiab lub khob cij tsis muaj chav txaus los siv cov kab thaiv zoo li ntawd.

Kauj Ruam 5: Txuas Cov Lus Tso Tawm

Txuas Cov Hluav Taws Xob
Txuas Cov Hluav Taws Xob
Txuas Cov Hluav Taws Xob
Txuas Cov Hluav Taws Xob

Vim tias nws tsis muaj neeg nyiam, kuv tau xaiv ntu ntu ntawm sab laug ntawm Z80 rau qhov tso tawm. Muab lub flip-flop tso rau ntawd thiab txuas lawv cov ntsia hlau. Pin 1, /MR (rov pib dua) tuaj yeem txuas ncaj qha rau tus pin rov pib dua ntawm tus txheej txheem, tab sis koj tuaj yeem tso nws khi rau 5V txoj kev tsheb nqaj hlau. Ua qhov no tsuas yog ua rau nws qhia cov ntaub ntawv tsis zoo txog thaum thawj sau. Daim ntawv ceeb toom yuav ua li cas lub nti muaj lub moos nkag ntawm tus pin 11. Cov tswv yim no coj txawv txawv uas nws tau qhib thaum tus pin nce siab. Tsis tas li nco ntsoov tias tus pin no TSIS YOG tib lub moos uas tsav lub processor. Lub moos no latches cov ntaub ntawv lees paub ntawm lub tsheb npav.

Nco ntsoov li cas peb txuas D0 - D7 ntawm ROM rau tib tus pin ntawm tus txheej txheem? Ua tib yam nkaus rau cov nti no. Nws D0 mus rau D0 ntawm cov tsheb npav thiab lwm yam. Cov pins uas pib nrog "Q" yog cov txiaj ntsig. Ua ntej peb xaim cov ntawd, peb yuav tsum ntxiv cov chips ntxiv. Kuv siv lub qhov rooj plaub NOR vim tias kuv muaj lub raj ntawm lawv thiab kuv twb xav tau ib qho, tab sis hais txog ib qho nti yuav ua haujlwm yog tias koj xaim nws kom raug. Kuv tuaj yeem khi ib qho tswv yim ntawm txhua lub rooj vag mus rau hauv av thiab siv lwm cov tswv yim zoo li, zoo, cov tswv yim, tab sis kuv tau xaiv los xaim ob lub tswv yim ua ke kom yooj yim.

Kuv tso cov chips hauv qab flip-flop kom yooj yim rau xaim ncaj qha yam tsis muaj cov dhia tab sis kuv tau khiav qis ntawm cov xov hlau ntawm qhov no yog li nws tsis muaj teeb meem tiag tiag thaum kawg. Q0, Q1….. Q7 ntawm lub flip-flop mus rau cov tswv yim ntawm tus kheej lub rooj vag. Nrog 4 lub rooj vag hauv txhua pob/nti, kuv xav tau 2 pob thiab siv txhua lub rooj vag. Yog tias koj pom ib qho version ntawm flip-flop uas tuaj yeem tsav lub LEDs yam tsis xav tau kev ua haujlwm zoo li no, ob daim ntawv no tsis xav tau. Yog tias koj siv rooj vag ua qhov tsis zoo uas tsis muaj qhov hloov pauv rov qab (THIAB/LOSSIS/XOR), tom qab ntawd koj tuaj yeem xaim cov LEDs raws li koj xav tau. Yog tias koj siv tib seem ib yam li kuv thiab/lossis cov txiaj ntsig tau thim rov qab, cov LEDs yuav tsum tau xaim raws li tau piav qhia hauv qab no. Thawj daim duab qhia IC ntu ntawm cov zis.

Siv 330 Ohm resistors los khi cov LEDs zoo (Anode) mus rau 5V txoj kev tsheb nqaj hlau thiab txuas qhov tsis zoo (cathode) rau qhov tso tawm ntawm lub rooj vag. Koj tuaj yeem pom hauv daim duab thib ob uas kuv tau siv ob lub tsheb npav tiv thaiv, txhua tus nrog tsuas yog tsib tus tiv thaiv sab hauv. Cov hlua LEDs zoo li qhov no yuav ua rau lawv pom kev thaum cov zis tawm. Peb ua qhov no vim tias cov zis tawm thaum lub tswv yim qhib. Ua kom ntseeg tau tias koj taug qab cov rooj vag twg uas koj tso tawm los ntawm kev tswj flip-flop. Tshwj tsis yog tias koj cov LEDs yuav tawg lossis lawv qhov kev txiav txim tsis muaj txiaj ntsig, poob ntawm lawv tuaj yeem ua rau tsis meej pem tom qab thaum koj nug koj tus kheej tias vim li cas cov zis tsis raug.

Kauj Ruam 6: Txuas lub tswv yim

Txuas lub tswv yim
Txuas lub tswv yim

Nqa 74HC374 flip-flop thiab tso rau qhov chaw. Kuv qhov chaw nyob qis dua Z80 mus rau hauv qab ntawm pawg thawj coj saib. Nco ntsoov zaum kawg thaum peb txuas D0 rau D0 thiab D1 rau D1 thiab ntxiv rau? Lub sijhawm no peb txuas Q0 rau D0 thiab Q1 rau D1 thiab ntxiv rau. Ua tsaug uas peb tsis tas yuav ntxiv cov chips tsis nyob rau lub sijhawm no, haha. Hloov chaw peb yuav txuas 10K Ohm rau txhua tus "D" tus pin (D0-D7) thiab hauv av thiab tom qab ntawd khawm rau tib tus pin thiab 5V kev tsheb nqaj hlau. Lossis koj tuaj yeem siv lub tsheb npav resistor thiab txo koj qhov suav ntau. Ib qho 3x4 khawm qhov sib piv (tsis muaj qhov tso tawm matrixed !!) yuav pab ib yam. Daim duab qhia pom tag nrho ntawm cov kab hluav taws xob nkag nrog rau cov kua nplaum logic (ntu ntawd yog tom ntej).

Kauj Ruam 7: Khov Logic

Peb muaj ib yam kawg los xaim. Nws tau hu ua "kua logic" vim nws tau siv los txiav txim siab tswj cov cim kom nws ua haujlwm tag nrho; nws yog dab tsi tuav lub Circuit Court ua ke. Thaum tus txheej txheem xav sau cov ntaub ntawv mus rau qhov tsim tawm, ob qho tib si /IORQ thiab /WR (20 thiab 22 feem) mus qis thiab cov ntaub ntawv raug xa mus tau lees paub ntawm cov ntaub ntawv tsheb npav. Lub moos tus pin ntawm ob lub flip-flops tau ua haujlwm siab, txhais tau tias cov ntaub ntawv raug kaw thaum tus pin tau txais lub teeb liab siab. Peb siv NOR rooj vag thiab xaim /IORQ rau ib qho nkag ntawm lub qhov rooj thiab /WR mus rau lwm lub tswv yim. Thaum twg yog qhov siab, txhais tau tias IO cov khoom siv hluav taws xob tsis raug xaiv lossis sau tsis ua haujlwm, qhov tso tawm pub rau lub moos ntawm lub flip-flop tseem qis. Thaum ob qho kev nkag tau qis, thiab tsuas yog thaum, cov zis tawm mus siab thiab cov flip-flop latches cov ntaub ntawv.

Tam sim no peb yuav tsum xaim lub tswv yim tig tig. Peb tuaj yeem xaim lub xov tooj ntawm tus pin zoo ib yam li yav dhau los, tab sis siv /IORQ thiab /RD. Tab sis tsis zoo li lwm qhov flip-flop, peb kuj muaj /OE tus pin uas xav tau qis qis thaum /IORQ thiab /RD qis. Peb tuaj yeem siv lub qhov rooj OR. Lossis peb tsuas tuaj yeem siv lub teeb liab uas peb twb muaj rau lub moos thiab hloov nws nrog ib qho ntawm ob lub rooj hloov pauv uas peb twb muaj lawm. Thaum lub sijhawm hais qhia cov lus qhia no, Kuv tsis muaj lub rooj OR lossis muaj, yog li kuv siv ib qho kev xaiv tom kawg. Siv qhov kev xaiv tom kawg txhais tau tias kuv tsis xav tau ntxiv ib qho ntxiv ib qho ntxiv lawm.

Kauj ruam 8: Programming

Puas yog koj cov xov hlau raug thiab qhov kuv piav qhia meej, txhua yam uas seem yog kom tau txais ROM programmed. Muaj ob peb txoj hauv kev mus txog qhov no. Koj tuaj yeem siv txoj hauv kev yooj yim thiab xaj ib qho tshiab tawm ntawm Digikey. Thaum koj tab tom xaj khoom ib feem, koj yuav muaj qhov kev xaiv xa cov ntaub ntawv HEX thiab lawv yuav ua haujlwm nws ua ntej lawv xa nws. Siv HEX lossis OBJ cov ntaub ntawv txuas nrog cov lus qhia no thiab tsuas yog tos kom nws tuaj txog hauv ntawv. Qhov Xaiv 2 yog los tsim tus programmer nrog Arduino lossis qee yam. Kuv tau sim txoj kev ntawd thiab nws ua tsis tau luam qee cov ntaub ntawv kom raug thiab nws coj kuv lub lis piam los daws qhov ntawd. Kuv tau ua tiav qhov kev xaiv 3, uas yog los ua haujlwm nws los ntawm txhais tes thiab tig tig los tswj qhov chaw nyob thiab cov kab ntawv.

Thaum hloov pauv ncaj qha rau OP Code ntawm tus txheej txheem, tag nrho cov haujlwm no tsuas yog nyob hauv 17 bytes ntawm qhov chaw nyob, yog li kev ua haujlwm ntawm tes tsis txaus ntshai. Qhov kev zov me nyuam thauj mus rau lub hom phiaj dav dav rau npe B tus nqi ntawm 00. Sau npe B yog siv rau khaws cia qhov tshwm sim ntawm kev ntxiv yav dhau los. Raws li Daim Ntawv Sau Npe yog qhov ua lej, peb yuav tsis siv nws los khaws cov ntaub ntawv.

Hais txog daim ntawv teev npe A, peb ua tus IN hais kom ua, uas nyeem cov ntawv nkag, thiab khaws cov ntaub ntawv nyeem hauv A. Tom qab ntawd peb ntxiv cov ntsiab lus ntawm npe B thiab tso tawm cov txiaj ntsig.

Tom qab ntawd, sau npe A tau theej rau hauv npe B. Thiab tom qab ntawd peb ua cov kab lus dhia. Vim tias txhua qhov kev dhia mus rau tus lej qis ntawm kab ntawm qhov chaw nyob, thiab vim hais tias lub siab byte ntawm cov lus qhia dhia tau muab rau hauv qhov kev sib cav zaum ob thiab yog "00," peb tuaj yeem yuam kom txhua qhov dhia ua raws NOP. Peb ua qhov no los muab sijhawm rau ntawm kev qhia tawm thiab nyeem cov lus nkag los tiv thaiv kev nkag yuam kev. Txhua qhov dhia siv kaum teev mus thiab txhua NOP siv plaub. Yog tias lub voj siv sijhawm ntev heev rau koj nyiam, koj tuaj yeem nce lub moos nrawm lossis koj tuaj yeem rov tsim dua nws kom siv ib qho dhia qis dua.

Kauj Ruam 9: Xeem

Yog tias koj txuas txhua yam kom raug thiab koj ROM tau teeb tsa kom raug, muaj ib qib kawg uas yuav tsum ua: ntsaws nws thiab pom tias nws ua haujlwm. Nias lub pob thiab tos ob peb feeb. Nws yuav siv sijhawm 81 teev mus rau txoj haujlwm kom mus txog nws thawj lub voj thiab txhua lub voj siv sijhawm 74 teev.

Yog tias nws tsis ua haujlwm, kos rau luv thiab txuas tsis txuas (qhib) thiab lwm yam teeb meem thaiv kab. Yog tias koj xaiv tawm ntawm lub zog-rov pib dua, koj yuav tsum tau ua phau ntawv rov pib dua ua ntej tus txheej txheem ua dab tsi. Koj tseem tuaj yeem txuas LEDs rau lub npav npav kom pom tias lawv coj tus cwj pwm li cas. Kuv tau muaj teeb meem nrog kuv tus kheej, yog li kuv kaw lawv ncaj qha mus rau lub tsheb npav cov ntaub ntawv hloov chaw. Qhov no tso cai rau kuv pom dab tsi tab tom sib tham ntawm tus txheej txheem thiab ROM yam tsis tas yuav txhawj xeeb txog yog tias ROM tau nyeem raug, yog li yuav xav tau daim duab qhia sijhawm thiab kuv tsuas yog tsis xav koom nrog qhov ntawd. Hloov los ua qhov kev xaiv zoo vim tias thaum kawg kuv tau ntes teeb meem OP Cov lej uas tau khaws cia tsis raug.

Pom zoo: