Cov txheej txheem:

Cov Lus Qhia Tus Kheej Qhia Cov Khoom Plig: 16 Cov Kauj Ruam
Cov Lus Qhia Tus Kheej Qhia Cov Khoom Plig: 16 Cov Kauj Ruam

Video: Cov Lus Qhia Tus Kheej Qhia Cov Khoom Plig: 16 Cov Kauj Ruam

Video: Cov Lus Qhia Tus Kheej Qhia Cov Khoom Plig: 16 Cov Kauj Ruam
Video: Hwm Pheej Thoj - Rov Mus Txog Vib Nais 2024, Hlis ntuj nqeg
Anonim
Cov Lus Qhia Tus Kheej Qhia Cov Khoom Plig
Cov Lus Qhia Tus Kheej Qhia Cov Khoom Plig

Nyob ib ncig ntawm lub hli dhau los, peb tau txais tos peb cov tub ntxhais kawm tshiab rau hauv chav haujlwm. Kuv tus phooj ywg tuaj nrog lub tswv yim tias peb yuav tsum muaj qee yam khoom plig rau lawv, thiab qhov no yog qhov kuv coj rau qhov ntawd. Nws coj kuv ib hnub los sim seb yuav tsim li cas thawj zaug, tom qab ntawd ob peb teev los tsim qhov seem 4.

Lub trinket yog ATTINY414-tswj. Cov lus tau khaws cia ntawm MCU thiab tom qab ntawd tso tawm ib tsab ntawv nyob rau ib lub sijhawm ntawm qhov sib thooj anode 7 ntu tso saib. Koj tuaj yeem muaj cov lus ntev heev txij li kuv 10 tsab ntawv siv tsuas yog 400 bytes ntawm qhov chaw zov me nyuam ntawm 4k ntaus ntawv. 7 ntu tso saib cathode pins tau txuas nrog MCU los ntawm 1k resistors.

Kuv tau sim siv ntau qhov chaw kuv twb muaj ntawm tes li sai tau thiab nws hloov tawm peb tsuas yog yuav cov neeg tuav lub roj teeb thiab lub roj teeb. Lub trinket yog qhov pheej yig zoo los tsim ib yam, los ntawm tsuas yog ntau dua 2 $ txhua qhov tsis suav nrog lub roj teeb.

Cov khoom no zoo tagnrho rau kho kom zoo nkauj lossis dai rau ntawm koj lub hnab.

Nco tseg: Nov yog thawj qhov kev qhia thiab kuv tau yees duab tsawg dua qhov kuv xav tau. Kuv yuav ua rau cov neeg los ntawm kev kos qee cov duab kos rau cov kauj ruam uas kuv tsis muaj duab. Kuj thov txim rau qhov muaj peev xwm ua kom yuam kev sau ntawv.

Nco tseg 2: Koj tuaj yeem siv ib lub microcontroller rau txoj haujlwm no, tab sis tso rau hauv Cov Lus Qhia no yog rau ATTINY414 thiab lwm yam khoom siv tau tus pin.

Khoom siv

(Cov npe yog rau 1 daim)

Qhov

  • 1x Lub Rooj Sib Tham Tawm Tsam rau SOP28/TSSOP28 nti
  • 1x ATTINY414 (koj tuaj yeem siv lwm lub microcontrollers thiab hloov nws koj tus kheej)
  • 7x 1k resistors (THT, 1/4 lossis 1/8 W)
  • 1x 100nF capacitor (THT lossis SMD)
  • 1x 0.56in nquag anode 7 ntu zaub
  • 1 X swb
  • 1x Npib ntawm tes tuav lub roj teeb (Kuv siv CR2032 ntawm no.)
  • Qee qhov AWG30 xov hlau thiab cov ceg tiv thaiv (rau dhia hauv qhov chaw nruj)
  • Daim nplaum lossis daim kab xev ob tog (rau npog thaj tsam kom tiv thaiv kom luv)
  • 1mm ntsws lub cev
  • 1 x keychain

Cov cuab yeej

  • Soldering hlau thiab cov pa luam yeeb tawm
  • Pab txhais tes lossis tus tuav PCB
  • Cov kab uas hla me me (Kuv siv 0.025in.)
  • RMA Ua Haujlwm
  • Dej cawv los yog Isopropyl Alcohol + Txhuam txhuam
  • Cov ntaub so ntswg
  • Daim npog qhov ncauj
  • Microcontroller programmer (raws koj li MCU)

Kauj Ruam 1: Kev Tsim Dav Dav

General Tsim
General Tsim
General Tsim
General Tsim
General Tsim
General Tsim
General Tsim
General Tsim

Cov duab kos no yog cov txheej txheem ntxhib ntawm yuav ua li cas cov khoom raug muab tso rau ntawm pawg thawj coj tawg hauv kuv tsim.

Faj seeb: Lub rooj sib cais uas kuv siv muaj tus lej tus lej ntawm txhua lub qhov raws li tus lej IC tus lej ib sab ntawm txhua sab. Thaum kuv hais txog cov qhov no, Kuv yuav siv Txx rau sab saum toj (qhov chaw MCU tau muab tso) thiab Bxx rau sab hauv qab. Yog tias koj tsis meej pem txog qhov yuav muab cov khoom tso rau qhov twg, xa mus rau cov duab no.

Kauj Ruam 2: Kuaj Koj Cov Cheeb Tsam

Ua ntej koj pib, xyuas kom tseeb tias koj cov khoom tau ua haujlwm zoo, tshwj xeeb yog lub microcontroller thiab cov zaub. Txij li cov ntu yuav raug crammed hauv qhov chaw me me, ua tiav nws thiab tom qab ntawd pom tau tias koj cov zaub tsis ua haujlwm yog qhov kawg uas koj xav tau, yog li sim lawv ua ntej!

Kauj Ruam 3: Program Microcontroller

Qhov kev zov me nyuam

Txoj haujlwm rau microcontroller yog yooj yim zoo nkauj thiab muaj cov hauv qab no:

  • Teeb tus pin qis rau thawj tsab ntawv.
  • Qeeb me ntsis
  • Teeb tus pin txhua qhov siab kom tsis txhob tso saib (xaiv tau)
  • Qeeb me ntsis
  • Teeb tus pin qis rau tsab ntawv thib ob.
  • Yaug thiab rov ua dua

Kuv tau txuas cov cai kuv siv. Koj tuaj yeem suav nws nrog XC8 tus neeg sau ntawm MPLAB X. Txawm li cas los xij, txij li thaum kuv siv PA0 rau ntu A, koj yuav tsum tau xiam UPDI ntawm fuse me ntsis rau nws ua haujlwm (piav qhia hauv qab no).

Xaiv txoj cai chaw nres nkoj

Tam sim no koj yuav tsum xaiv cov chaw nres nkoj twg ntawm lub microcontroller siv. Feem ntau rau microcontroller nrog 14 tus pin, yuav muaj ib qho chaw nres nkoj 8-ntsis thiab ib qho chaw nres nkoj 4-ntsis. Txij li 7-ntu cov zaub muaj 8 cathode pins (suav nrog cov lej cim zauv), siv 8-ntsis chaw nres nkoj yog qhov yooj yim tshaj plaws vim tias koj tuaj yeem siv ncaj qha chaw nres nkoj nkag mus teeb tus nqi chaw nres nkoj hauv ib qho lus txib.

Kev Xav 1: Hla kev taug

Txawm li cas los xij, qhov kev xaiv yuav sib txawv vim yog koj lub microcontroller pinout thiab cov xov hlau hla ntawm koj li MCU thiab cov zaub. Txhawm rau ua txoj haujlwm yooj yim tshaj plaws, koj xav tau qhov tsawg tshaj plaws ntawm kev hla kab.

Piv txwv li, ntawm ATTINY414 8-ntsis chaw nres nkoj yog PORTA. Yog tias koj tau muab PA0 rau ntu A, PA1 rau ntu B thiab ntxiv rau, tus lej hla tus lej yog 1 (ntu F thiab G) uas pom zoo rau kuv.

Protip: Ib sab ntawm pawg thawj coj tuaj yeem nyab xeeb tsev tsib 1/4 w resistor.

Kev txiav txim siab 2: Pins 'hloov pauv kev ua haujlwm

Hauv qee kis, yog cov pins ntawm qhov chaw nres nkoj koj xav siv muaj lwm txoj haujlwm xws li cov phiaj xwm phiaj xwm, cov koob no yuav tsis ua haujlwm zoo li GPIO pins, yog li koj yuav tsum zam lawv lossis tsis ua haujlwm rau txhua qhov, qhov kev xaiv yog koj li.

Piv txwv li, ntawm ATTINY414 UPDI tus lej pin yog nyob ntawm A0 tus pin ntawm PORTA. Yog tias koj siv qhov chaw nres nkoj no ua qhov tso tawm, nws yuav tsis ua haujlwm vim tias qhov chaw nres nkoj yuav siv los ua UPDI tsis yog GPIO. Koj muaj 3 txoj kev xaiv ntawm no nrog lawv qhov zoo/qhov tsis zoo:

  • Lov tes taw UPDI ntawm cov khoom siv fuse: Koj yuav tsis tuaj yeem tsim kho lub cuab yeej dua tshwj tsis yog koj siv 12v txhawm rau rov ua haujlwm UPDI (hmoov tsis kuv tau ua qhov no tab sis koj tsis tas yuav).
  • Siv tsuas yog PA7-PA1: Koj yuav tsis muaj peev xwm siv tus lej cim zauv ntawm no tshwj tsis yog koj tseem siv PORTB los pab, tab sis koj tseem yuav muaj lub program muaj (xaiv zoo tshaj).
  • Siv PORTB los pab: Cov cai ntev dua tab sis tseem ua haujlwm yog tias tus pinout tsis zoo ib yam.

Protip: Sim xaiv lub microcontroller nrog tsawg tus lej ntawm tus lej programming, ATTINY414 siv UPDI uas tsuas yog siv 1 tus pin los sib txuas lus, yog li koj muaj ntau GPIO pins muaj.

Programming lub cuab yeej

Yog tias koj muaj lub khoos phis tawj ntsaws rau SMD lub cuab yeej koj yuav xav ua haujlwm nws ua ntej yuav hloov lub MCU mus rau pawg tswj hwm. Tab sis yog tias koj tsis ua, soldering thawj zaug yuav pab koj nrog lub cajmeem. Cov nqi yuav txawv. Hauv kuv qhov xwm txheej, kuv txuas PICKIT4 rau ib lub rooj sibtham tawm ces siv kuv tus ntiv tes thawb MCU tawm tsam lub rooj tsavxwm. Nws ua haujlwm tab sis tsis zoo heev (lub qhov (socket) yog tam sim no ntawm kuv daim ntawv teev npe).

Kauj Ruam 4: Solder Microcontroller

Solder lub Microcontroller
Solder lub Microcontroller

Tsis muaj dab tsi zoo nkauj ntawm theem no. Koj yuav tsum tau muab lub microcontroller tso rau ntawm lub rooj sib tsoo. Muaj ntau ntau cov lus qhia hauv Youtube yuav ua li cas thiaj li siv tau cov khoom SMD. Yuav kom xaus, qhov tseem ceeb yog:

  • Ntxuav cov hlau ntxig taub
  • Txoj cai ntawm cov laug
  • Txoj cai kub
  • Ntau cov dej ntws
  • Ua siab ntev thiab xyaum ua

Tseem ceeb: Nco ntsoov muab tus MCU tus pin 1 rau tus pin 1 ntawm pawg thawj coj tawg!

Tam sim no MCU tau muab muag rau hauv pawg thawj coj saib peb tuaj yeem txuas ntxiv mus rau theem tom ntej.

Kauj Ruam 5: Solder Capacitor

Solder lub Capacitor
Solder lub Capacitor

Muaj txoj cai ntawm tus ntiv tes xoo hauv cov khoom siv hluav taws xob uas thaum koj muaj IC hauv koj lub Circuit Court, ntxiv ib 100nF capacitor nyob ze nws lub hwj chim, thiab qhov ntawd tsis muaj qhov tshwj xeeb ntawm no. Tus capacitor no hu ua decoupling capacitor thiab nws yuav ua rau koj lub Circuit ruaj khov dua. 100nF yog tus nqi dav dav uas ua haujlwm nrog feem ntau ntawm cov khoom siv hluav taws xob.

Koj yuav tsum tau muab lub tshuab hluav taws xob tso kom ze li sai tau hla Vcc thiab GND pins ntawm MCU. Tsis muaj chaw ntau nyob ntawm no yog li kuv tsuas yog txiav nws ob txhais ceg kom loj thiab muab nws ncaj qha rau MCU ob txhais ceg.

Kauj Ruam 6: Flux Tu 1

Dej Ntxuav 1
Dej Ntxuav 1

Thaum cov dej ntws yog qhov tseem ceeb rau kev siv tshuaj tua kab. Tawm nws ntawm lub rooj tsavxwm tom qab siv lub tshuab tsis zoo rau koj vim nws tuaj yeem ua rau lub rooj tsavxwm puas. Cov dej ntws tawm tuaj yeem yaj tau siv Isopropyl Cawv. Txawm li cas los xij, koj kuj tseem yuav tsum so cov dej tawm ntawm lub rooj tsavxwm ua ntej cov cawv tawm mus lossis lwm qhov nplaum nplaum yuav tam sim no npog tag nrho lub rooj tsavxwm.

Nov yog cov txheej txheem uas kuv siv uas ua haujlwm tau zoo: tso lub rooj tsavxwm ib sab rau ntawm daim ntawv so ntswg, tom qab ntawd ntub daim txhuam cev pleev xim rau hauv cawv thiab sai sai "pleev xim" cawv rau ntawm lub rooj tsavxwm nqes mus rau ntawm daim ntaub so ntswg. Koj yuav pom cov xim daj tshwm ntawm daim ntaub so ntswg. Txhawm rau kom ntseeg tau tias feem ntau ntawm cov dej ntws tawm, xyuas yog tias koj lub rooj tsavxwm tsis nplaum thiab cov pas dej ntawm ib puag ncig cov pob qij txha feem ntau ploj mus. Saib daim duab saum toj no kom paub meej ntxiv.

Vim li cas qhov kev ntxuav no: Txhawm rau ntxuav lub microcontroller. Ib feem yuav nyuaj dua kom mus txog tom qab.

Kauj Ruam 7: Siv lub 7-ntu Zaub Zaub

Solder 7-segment Display
Solder 7-segment Display

Tam sim no peb yuav ua txhaum txoj cai hais txog kev siv cov khoom siv qis tshaj plaws ua ntej thiab pib los ntawm 7-ntu zaub. Txoj hauv kev no peb tsuas tuaj yeem siv cov tshuaj tiv thaiv rau 7-ntu tso saib ob txhais ceg.

Txij li tam sim no peb muaj qhov txwv tsis pub tso sab laug ntawm lub rooj tsavxwm, peb yuav txiav qhov qis hauv qab ib qho anode tus pin ntawm cov zaub los ua txoj hauv kev rau tus lej tsis zoo ntawm tus tuav lub roj teeb. Tom qab ntawd siv cov khoom qub. Tsuas yog khoov cov ceg ob sab sab me ntsis, tuav nws hauv qhov chaw (daim kab xev npog yuav pab tau ntawm no) thiab muab nws tso rau sab saum toj ntawm lub rooj tsavxwm.

Kauj Ruam 8: Rhuav Cov Hauv Qab-Resistors

Solder Cov Hauv Qab-Sab Resistors
Solder Cov Hauv Qab-Sab Resistors
Solder Cov Hauv Qab-Sab Resistors
Solder Cov Hauv Qab-Sab Resistors

Cov kauj ruam tom ntej yuav yog txhawm rau tiv thaiv cov neeg tawm tsam hauv qab hauv qab ntawm pawg thawj coj saib. Ua ntej peb pib, tso ob daim kab xev lossis daim nplaum hla TSSOP los peb tsis siv los tiv thaiv kom luv.

Tam sim no tias cov ntaub qhwv tau npog, tau txais koj cov resistors tawm thiab pib khoov lawv ob txhais ceg. Lawv yuav txuas ntawm MCU ob txhais ceg (LEFT sab ntawm lub rooj tsavxwm) thiab cov ceg tso saib (RIGHT sab ntawm lub rooj tsavxwm). Xyuas kom lawv tsis kov ib leeg thiab muaj chaw txaus ntawm lawv.

Protip: Koj pawg thawj coj tawg yuav tuaj nrog qee qhov qhov drilled ntawm lub rooj tsavxwm. Cov no yog cov chaw yooj yim los txuas cov keychain. Xyuas kom tseeb tias ib qho ntawm cov no tsis tau npog los ntawm cov ceg tiv thaiv.

Kauj Ruam 9: Solder Top-side Resistors

Solder Sab saum toj sab Resistors
Solder Sab saum toj sab Resistors
Solder Sab saum toj sab Resistors
Solder Sab saum toj sab Resistors

Yog tias koj tsis tuaj yeem haum txhua tus tiv thaiv nyob rau sab hauv qab ntawm pawg thawj coj saib, koj yuav tsum tau tso qee qhov rau sab saum toj. Txij li thaum lub microcontroller tseem nyob ntawm no koj yuav tsum tau ntsws-tubed koj cov ceg tawv tiv thaiv kom lawv tsis txhob kov lub microcontroller. Cov txheej txheem seem nyob twj ywm tib yam li cov kauj ruam kawg.

Kauj ruam 10: Solder Hloov

Solder Hloov
Solder Hloov

Qhov txuas ntxiv mus rau cov laug yog qhov hloov pauv swb kom tig lub zog qhib thiab kaw. Kuv siv 1P2T swb hloov ntawm no.

Ib zaug ntxiv vim qhov txwv tsis pub sab laug, txiav ib sab tus pin ntawm tus tes hloov qhov

Tom qab ntawd txuas tus pin sab ntxiv ntawm qhov hloov. Tawm hauv qhov chaw nruab nrab tus pin tsis muag khoom.

Kauj Ruam 11: Muab cov hlua thiab cov hlua dhia

Solder Cov Hlau thiab Jumpers
Solder Cov Hlau thiab Jumpers

Raws li koj tus qauv tsim, koj yuav muaj ntau lossis tsawg dua ntawm cov xov hlau los txuas. Hauv kuv qhov kev tsim, muaj 2 lub xov hlau (lub xov hlau txuas rau MCU) thiab 2 lub dhia (lub zog rau cov zaub thiab txuas txuas ntxiv rau MCU).

Tsuas yog solder lawv kom raug thiab koj zoo mus.

Kauj Ruam 12: Dej Ntxuav 2

Yog vim li cas qhov kev ntxuav no: Peb yuav tsis nkag mus rau sab hauv qab tom qab peb muab lub roj teeb tuav, yog li peb yuav tsum tau ntxuav tam sim no.

Kauj Ruam 13: Tuav Lub Roj Teeb Lub Pob + Lwm Yam Jumpers Ntxiv

Solder Tus Tuav Lub Roj Teeb + Ib Leeg Ntxiv
Solder Tus Tuav Lub Roj Teeb + Ib Leeg Ntxiv
Solder Tus Tuav Lub Roj Teeb + Ib Leeg Ntxiv
Solder Tus Tuav Lub Roj Teeb + Ib Leeg Ntxiv

Nov yog qhov kawg thiab qhov nyuaj tshaj plaws rau cov laug. Peb tsis muaj qhov txaus txaus tso rau sab laug rau tus tuav lub roj teeb yog li peb yuav solder nws zoo li no: Lub davhlau ya nyob twg zoo qhia lub qhov nrog tus tes hloov peb sab laug unsoldered (kauj ruam 10) thiab lub davhlau ya nyob twg tsis zoo mus rau hauv lub qhov peb tau tawm los ntawm txiav cov duab tso tawm (kauj ruam 7).

Tom qab ntawd, yog tias koj muaj cov dhia dhia ntxiv rau cov laug, txuas lawv tam sim no. Txog kuv qhov kev tsim, Kuv muaj ib lub jumper sab laug vim tias nws yuav tsum txuas mus rau tus lej tsis zoo ntawm tus tuav lub roj teeb.

Saib daim duab kom paub meej ntxiv.

Kauj Ruam 14: Ntxuav Dej 3

Yog vim li cas qhov kev ntxuav no: Qhov kev ntxuav zaum kawg.

Kauj Ruam 15: Kuaj + Kuaj Kawg

Ua ntej peb tso lub roj teeb rau hauv, xyuas kom tseeb tias tsis muaj ob txhais ceg kov ib leeg, hla ib qho dhau ntawm cov hlau lead, txheeb xyuas koj cov laug. Tom qab cov no ua tiav, koj tuaj yeem tso lub roj teeb rau hauv, qhib nws thiab nws yuav tsum ua haujlwm kom raug.

Yog tias tsis yog, txheeb xyuas txhua yam ntawm koj cov laug dua thiab tej zaum yuav tshuaj xyuas yog tias koj lub microcontroller program raug.

Kauj Ruam 16: Cov Khoom Kawg

Khoom Kawg
Khoom Kawg
Khoom Kawg
Khoom Kawg

Nrog koj zoo siab! Koj tau ua koj tus kheej cov khoom plig tus kheej! Nco ntsoov qhia nws nrog kuv ntawm no thiab txaus siab!

Pom zoo: