Cov txheej txheem:

Yuav Ua Li Cas Tsav Ntau LEDs Los Ntawm Ob Tus Microcontroller Pins: 6 Cov Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Tsav Ntau LEDs Los Ntawm Ob Tus Microcontroller Pins: 6 Cov Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Tsav Ntau LEDs Los Ntawm Ob Tus Microcontroller Pins: 6 Cov Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Tsav Ntau LEDs Los Ntawm Ob Tus Microcontroller Pins: 6 Cov Kauj Ruam (nrog Duab)
Video: Tswv Yexus lub neej thaum pib txug thaum xaus 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Tsav Ntau LEDs Los Ntawm Ob Tus Microcontroller Pins
Yuav Ua Li Cas Tsav Ntau LEDs Los Ntawm Ob Tus Microcontroller Pins

Siv qhov tseeb tias ntau lub microcontroller pins muaj peb lub xeev (+V, GND, lossis "muaj kev tiv thaiv siab", koj tuaj yeem tsav N*(N-1) LEDs los ntawm N pins. Yog li me ntsis 8pin microcontroller zoo li PIC12Fxxx lossis ATtiny11 tuaj yeem tsav tau 20 LEDs onits tsib qhov muaj pins tso tawm, thiab tseem muaj ib tus pin sab laug rau qee yam ntawm cov tswv yim. Saib kuj

Kauj Ruam 1: 20 LEDs ntawm 5 Pins

20 LEDs ntawm 5 Pins
20 LEDs ntawm 5 Pins

Cov qoob loo tam sim no ntawm tus lej qis-suav microcontrollers (6 tus pin rau 20 tus pin rau

tag nrho pob) yog tus nqi txaus nyiam thiab 'ntxim hlub', tab sis cov lus nug tshwm sim yuav ua li cas koj tuaj yeem siv qhov zoo tshaj plaws ntawm cov pins rau kev siv ntau yam xws li tsav tsheb LEDs. Ib txoj hauv kev txuas ncaj qha mus rau kev tsav tsheb LEDs siv ib tus pin rau txhua LED. Cov txheej txheem sib txuam sib txawv uas kab ntawm LED anodes tau tsav los ntawm ib txheej ntawm N pins thiab txhua kab ib txwm cathode tau tsav los ntawm lwm txheej ntawm M pins tswj kom pom N*M LEDs nrog N+M pins. Txawm li cas los xij, ntawm tus txheej txheem nrog tsuas yog 5 lossis tsawg dua cov txiaj ntsig (raws li yog nrog rau feem ntau 8-pin microcontrollers), qhov no nyuam qhuav tau txais koj cov txiaj ntsig ntau dua li kev tsav ncaj qha.

Kauj ruam 2: Charlieplexing

Charlieplexing
Charlieplexing

Piv txwv tias cov pins tso tawm yog qhov ua tau tri-xeev-muaj peev xwm (ua haujlwm siab, ua haujlwm qis, thiab muaj kev tiv thaiv siab (tawm tswv yim)) nws kuj tseem tuaj yeem faib cov kab thiab kab tsav tsheb thiab tswj N*(N-1) LEDs nrog tsuas yog N pins. Ib tus pin txuas nrog rau ib qho cathodes ntawm kab ntawm LEDs thiab tsav qis, thiab N-1 tus pin txuas ntxiv txuas nrog anodes thiab ib qho tsav siab rau lub teeb ntawd kab, lossis sab laug raws li cov tswv yim kom tawm ntawm LEDoff. Maxim hu cov txheej txheem no "Charlieplexing", thiab piav qhia hauv (1); Microchip tseem hais txog qhov no hauv lawv daim ntawv (2) (thiab ua piv txwv hauv PICKit 1 pawg thawj coj ib yam.) (1) "Charlieplexing-Txo Pin-Count LED Display Multiplexing" https://www.maxim-ic.com/appnotes. cfm/appnote_number/1880 (2) "Cov lus qhia n Tricks 8-pin FLASH PIC Microcontrollers" https://ww1.microchip.com/downloads/en/DeviceDoc/40040b.pdf (3) Charlieplexing LEDs- Theory An Instructable by rgbphil

Kauj Ruam 3: Muab Nws Ua Haujlwm

Muab Nws Ua Haujlwm
Muab Nws Ua Haujlwm
Muab Nws Ua Haujlwm
Muab Nws Ua Haujlwm

Qhov no tsav 20 LEDs los ntawm ATtiny11. Ib qho ua ntej ntawm pawg thawj coj no yog

ua tau tiag tiag thiab tshwm raws li nplooj ntawv tseem ceeb yees duab. Kuv ntshai daim duab ntawm schematic zoo nkauj tsis muaj kev cia siab; koj xav tau Eagle los qhia koj tias cov cim qhia tau txuas nrog qhov twg.

Kauj Ruam 4: Me Me thiab Ntau Yam Ntxiv …

Me dua thiab ntau yam ntxiv…
Me dua thiab ntau yam ntxiv…

Txij li feem ntau ntawm pawg thawj coj tau coj los ntawm LED teeb, peb tuaj yeem ua chav

rau ib qho Attiny nti LOSSIS microchip PIC12F nti. Txo cov LEDs nqes mus rau 3mm thiab mus rau ob tog ntawm pawg thawj coj saib, thiab peb tau txais qee yam txog 27x44mm Alas, pawg thawj coj no tseem tsis tau sim dua …

Kauj ruam 5: Itty Bitty

Nws Bitty
Nws Bitty

Microchip tau kawg lawv muaj 6 tus pin PIC10F chips, muaj peev xwm tsav tsheb tau

tsuas yog 6 LEDs los ntawm 3 tus pin tso tawm. Qhov no yog hais txog 16mm txoj kab uas hla. Mus rau 603 LEDs tso cai rau koj kom me dua me ntsis, tab sis kuv tsis paub meej tias yog dab tsi.

Kauj ruam 6: Software

Lub software tau txais me ntsis tsis meej rau cov laj thawj ua haujlwm:

1) rau PCBs qhia, LEDs tau teeb tsa hauv txoj hauv kev uas yooj yim rau PCB teeb tsa, ntau dua li "raug" qhov kev txiav txim me ntsis. IMO, qhov no yog txoj hauv kev ua tej yam, tab sis nws txhais tau tias Row 1 tsis tas yuav tsum tau txhais me ntsis 1, lossis coluimn 3 tsis txhais tau tias me ntsis 3. Qhov no yuav tsum muaj qib ntawm kev kos duab ntawm ib txwm kab/kab lus hais thiab khoom uas xav tau teeb tsa. 2) Txij li tib cov khoom siv rau anodes thiab cathodes, qhov sib txuas (kab) txuas rau qee cov khoom tuaj yeem nyob hauv nruab nrab ntawm kev tsav (kem) cov khoom. Qhov ntawd txhais tau tias koj yuav tsum hloov cov kab khoom ib ncig nyob ntawm seb lawv puas yog ua ntej lossis tom qab kab me ntsis rau cov kab ntawd. 3) Koj yuav tsum tau txais cov lus tso tawm rau ob qho tib si ioport thiab chaw nres nkoj qhia npe. Cov lej ASM txuas rau ATtiny11 yog "pov thawj ntawm lub tswv yim." Nws yog kev txaj muag tsis zoo thiab tawm tswv yim tsis zoo, tab sis nws yog txhua yam kuv tau sau txog tam sim no.

Pom zoo: