Un zintsi sisiphaluka esidibeneyo esinamagalelo aliqela kunye nesiphumo esinye sedatha. Ngale nto, kunokwenzeka ukuba ukhethe indawo yokungena yenye yokungena kwayo ukuyihambisa ukuphuma kwayo. Oko kukuthi, unokukhetha ukuba yeyiphi igalelo onokuyithatha idatha okanye isuntswana kwigalelo kwaye ungalihoyi lonke igalelo. Oku kuqheleke kakhulu kwi-elektroniki xa unxibelelwano oluninzi kufuneka lwabelane ngomgca omnye okanye ibhasi.

Oko kukuthi, ngokulawula i-multiplexer onako khetha igalelo elifanelekileyo ngawo onke amaxesha. Yintoni eyenza ukuba kunokwenzeka ukuba ngaphandle konxibelelwano olunye kuphela, unokusebenza ngezixhobo ezininzi zokufaka ngexesha elinye ngaphandle kokuphazamisana. Kananjalo kuya kufuneka wazi ukuba i-demultiplexer ihlala isetyenziswa ngokudibeneyo kunye ne-multiplexer kwiiprojekthi ezininzi ...

## Yintoni ukuphindaphinda?

Ezi nkonzo zidibeneyo zibiziweyo ezininzi aziqhelekanga ngokuntsonkothileyo. Zenziwe ngamasango ambalwa enengqondo ngokuxhomekeke kwinani lokufakwa kwedatha kunye nolawulo kunokunyusa ubunzima. Bahlala bebandakanya 2n igalelo kunye nemveliso enye, kunye neendlela zolawulo. Kwaye ungazisebenzisa ezininzi ngokudibeneyo ukonyusa elo nani lamatikiti akhoyo.

Inokuqondwa njenge umkhethi. Umzekelo, cinga ukuba unayo elula kakhulu enegalelo ezimbini, ezona zilula ezinokwakhiwa. Isekethe iya kuba negalelo lolawulo olunye kunye nemveliso. Ukuba amagalelo ngu-A kunye no-B, ngongenelelo lolawulo onokululawula ukuba ngu-A odlulisa ixabiso lalo kwimveliso S okanye ukuba ngu-B owenzayo. Ukwenza oku, kuya kufuneka uguqule kuphela ixabiso lomgca wolawulo C. Umzekelo, ukuba C = 0 iyakuba ngu-A kwaye ukuba C = 1 iya kuba ngu-B.

Njengoko uya kuqonda, ukuba kukho amagalelo amaninzi, kuya kufuneka okungakumbi amagalelo olawulo yokhetho. Ngapha koko, i-multiplexer luhlobo olukhethekileyo lwe-decoder, enesiginali esenza ukuba nganye ibandakanywe kunye nesango kunye nesango OKANYE phakathi kwemveliso kunye namasango KUNYE Ngale ndlela inokukhethwa ngokulula.

Ngokubhekisele kwizicelo zayo, ungayisebenzisa ngobuninzi bezinto:

• Igalelo lokhetho lokwabelana ngebhasi enye okanye umgca xa unamagalelo amaninzi.
• I-serializer ukuze ithathe ixabiso lolungiselelo lwayo ngalunye ngokulandelelana.
• Ukuhanjiswa okuphindaphindayo kusetyenziswa imigca efanayo yoqhagamshelo lwedatha eyahlukeneyo evela kwizixhobo ezahlukeneyo. Umzekelo, khawufane ucinge ukuba ufuna ukusebenzisa ipini yedatha efanayo yokulawulwa kwezinto ezincinci ukunxibelelana neziphumo zedivayisi, kodwa inokuthumela ulwazi olunye ngexesha ...
• Yenza imisebenzi enengqiqo, njl.

### Iindidi ezininzi

Kuxhomekeke kwindlela lokwahlulahlulwa kosasazo, kukho iintlobo ezahlukeneyo multiplexers okanye multiplexing:

• Ngokwahlulwahlulwa rhoqo
• Ngokwahlulwa kwexesha
• Ngokwahlulahlula ikhowudi
• Ngokwahlulwa kwe ubude bamaza

Njengoko unokuthelekelela, zilawulwa rhoqo, lixesha ngewotshi, ngekhowudi yokubini, nangobude bamaza. Kodwa apha ndinomdla kuphela kwizinto eziqhelekileyo ...

Ukongeza kwiindidi, njengakwi-demultiplexer, ungayifumana nayo ngaphezulu okanye ngaphantsi amajelo 2, 4, 8, 16, njl., Kuxhomekeka kwinto oyifunayo kwiiprojekthi zakho ze-DIY.

### Umahluko kunye nedultultlexlex

Kwizinto zombane zedijithali kukho mzukiqi, isekethe yokudibanisa eyichasene nomphindaphindayo. Kule meko kuyakuba negalelo elinye lolwazi, kodwa linokudluliselwa kwiziphumo zalo ezahlukeneyo. Ngamanye amagama, kule meko, imiqondiso yolawulo iya kuthatha isigqibo sokuba yeyiphi na idatha edlulisiweyo edluliswayo.

Si uqhagamshela i-demultiplexer kwimveliso ye-multiplexerUnokuba nenkqubo eluncedo kakhulu yokufunda ukuba zisebenza kanjani zombini ezi zixhobo.

### Ukuthenga phi?

Ezi zixhobo zihlala ziphunyezwa kwi idipsi ilula kakhulu. Ungazifumana kwiintlobo ngeentlobo zeemveliso kunye nenani lokufaka okanye iziphumo xa unokuba ngumdibanisi. Ukongeza, zifumaneka ngokulula kwimithombo eyahlukeneyo yemithombo yeendaba okanye kwiivenkile ezikwi-Intanethi. Ukuba unomdla wokuthenga enye ngexabiso elifanelekileyo, le inokuba yimizekelo elungileyo ukuqala ngeeprojekthi zakho:

Ndikucebisa ukuba ufunde iidatha kubavelisi babo ukufumana umbono ocacileyo wabo isikhonkwane, njengoko zinokwahluka ngokuxhomekeke kumenzi okanye uhlobo olithengileyo.

#### cd74hc4067

Ukongeza, njengoko ubona, kukwakhona iimodyuli ezilungileyo kakhulu ezikuvumela ukuba ubenazo zombini izixhobo kwenye. Yimeko ye CD74HC4067 eyaziwayo, Imodyuli encinci enetekhnoloji ye-TTL enokukunceda ukuba usebenze kunye ne-banal zayo ezili-16 ngendlela eya kumacala amabini, ngokuba ne-MUX / DEMUX. Oko kukuthi, ungayisebenzisa njengotshintsho oluhle.

Ke, iArduino yakho inokufunda kwaye ibhale ukuya kuthi ga kwi-1Izixhobo ezi-6 ezahlukeneyo ngezikhonkwane ezi-5 kuphela, ezi-4 zazo zisetyenziselwa ulawulo kunye nenye eyongezelelweyo ukuqokelela umqondiso ekujongwe ukuba ufundwe okanye ubhalwe ngokwejelo elikhethiweyo.

Into emnandi ngale chip yile isebenza kunye neempawu zedijithali kunye ne-analog, ke iyahambelana neenzwa ezininzi ezisebenza kwi-analog kunye nezinye iichips zedijithali, kunye nobuninzi bezinto zombane ezahlukeneyo. Inika ukusebenza ngeendlela ezininzi. Kungenxa yoko le nto bekwabizwa ngokuba ngabandisi be-I / O okanye igalelo kunye nezinto zokukhulisa ...

Unokuyisebenzisela i- unxibelelwano ngezibuko lezibuko, Ibhasi ye-I2C okanye i-SPI, esele sithethile ngayo ngamanye amaxesha.

Ewe kunjalo, ngaphambi kokusebenza naye, kufuneka uqiniseke ukuba ukuhlangabezana voltages kunye nemisinga le sekethe iyavuma ukuze ingayonakalisi. Umzekelo, kule meko inokubonelela ukuya kwi-20 mA, kunye nevolthi ye-2 ukuya kwi-6v. Nangona kunjalo, ukuba ufuna ukusebenza ngamaza aphezulu unokusebenzisa i-relay okanye ngetransistor.

## Umdibaniso neArduino

Uhlobo lwe unamagalelo amaninzi kwibhodi yakho yeArduino okanye iziphumo ezingaphezulu, Kukusebenzisa aba baphindaphindayo kunye nabaphumeleli. Ngabo uya kuthintela ukuba uthenge ibhodi enexabiso eliphezulu enezikhonkwane ezingaphezulu, okanye ukusebenzisa amanye amaqhinga ukudibanisa yonke into oyifunayo.

Umzekelo, ungasebenzisa i- Imodyuli ye-MUX kunye ne-DEMUX ukwazi ukubanakho kokubini kwinto enye, kwaye emva koko uyihlanganise ngendlela elula kwiprojekthi yakho kunye neArduino. Nge-CD74HC4067 ungayidibanisa ngokulula, ke kuya kufuneka ulandele le mithetho:

• Vcc ye-MUX / DEMUX chip kufuneka uyixhume kwiVcc yeArduino okanye 5V.
• I-GND, umhlaba, kufuneka uyixhume kwi-GND yeArduino.
• Izikhonkwane eziphawulwe ngo-S0, S1, S2, S3 zezona zilawula ijelo elisebenzayo, ezine-Arduino digital I / O, ezinje nge-D8, D9, D10 kunye ne-D11.
• I-EN iyasebenza, ukuze isebenze njenge-multiplexer ungayiqhagamshela kwi-GND yeArduino.
• Kwaye i-SIG ngumqondiso wokuphuma oya kuthi umisele ijelo elikhethiweyo. Inokudibaniswa neArduino okanye nasiphi na isixhobo esifuna ukufunda imveliso. Kule meko ndiyidibanise ne-A0 ukufumana amaxabiso kwiArduino uqobo.
• Kwesinye isiphelo semodyuli uya kuba negalelo kule meko, eyi-C0-C10 onokuthi uqhagamshele kwizixhobo zakho.

Nje ukuba idityaniswe, ikhowudi yeArduino inokuba lula. Inkqubo ye- Umzobo weArduino IDE njenge-multiplexer Inokuba yile ilandelayo (le khowudi iya kucima kuphela kwaye ijonge kwiziteshi zabo ngokwahlukeneyo, kodwa ungayiguqula ukwenza iprojekthi oyifunayo):

```const int muxSIG = A0;
const int muxS0 = 8;
const int muxS1 = 9;
const int muxS2 = 10;
const int muxS3 = 11;

int SetMuxChannel(byte channel)
{
}

void setup()
{
pinMode(muxSIG, OUTPUT);
pinMode(muxS0, OUTPUT);
pinMode(muxS1, OUTPUT);
pinMode(muxS2, OUTPUT);
pinMode(muxS3, OUTPUT);
}

void loop()
{
for (byte i = 0; i < 16; i++)
{
SetMuxChannel(i);
digitalWrite(muxSIG, HIGH);
delay(200);
digitalWrite(muxSIG, LOW);
delay(200);
}
}

```

Ukuba ufuna ukuyisebenzisa njenge-DEMUX, kuya kufuneka uthathele ingqalelo kuphela ukuba i-C0-C10 iya kuba sisiphumo kwaye i-SIG iya kuba ligalelo. Kwimeko apho ufuna yisebenzise njenge-demultiplexer, ikhowudi iya kutshintsha ngolu hlobo:

```onst int muxSIG = A0;
const int muxS0 = 8;
const int muxS1 = 9;
const int muxS2 = 10;
const int muxS3 = 11;

int SetMuxChannel(byte channel)
{
}

void setup()
{
Serial.begin(9600);
pinMode(muxS0, OUTPUT);
pinMode(muxS1, OUTPUT);
pinMode(muxS2, OUTPUT);
pinMode(muxS3, OUTPUT);
}

void loop()
{
for (byte i = 0; i < 16; i++)
{
SetMuxChannel(i);

Serial.print(muxValue);
Serial.print("\t");
}
Serial.println();
delay(1000);
}

```

Khumbula ukuba unokufumana ulwazi oluthe kratya ngoncedo lwethu Inkqubo yasimahla yeArduino.

Izimvo, shiya eyakho

Xavier Ortiz sitsho

Molo, ndenza iprojekthi, into endiyenzayo ukusebenzisa i-74hc4067 yokufaka i-16 ye-infrared sensors sensors, kwaye inzwa nganye indiphendulela kwimveliso eyahlukileyo. Ewe, ukuba ndingayenza nge-mega ye-arduino kodwa kufuneka ndisebenzise i-infrared sensors ezingama-50 kwaye nganye nganye ivule imveliso, oko kukuthi, iziphumo ezingama-50, ndicinga ukusebenzisa uninzi lwe-744067 yegalelo lenzwa kunye ne-tlc5940 yeziphumo, kodwa yeyiphi ikhowudi yenkqubo ndilahlekile, enkosi kwangaphambili ngoncedo lwakho.