Yuav Ua Li Cas Sau Ib Qho Program Rau Microcontroller

Cov txheej txheem:

Yuav Ua Li Cas Sau Ib Qho Program Rau Microcontroller
Yuav Ua Li Cas Sau Ib Qho Program Rau Microcontroller

Video: Yuav Ua Li Cas Sau Ib Qho Program Rau Microcontroller

Video: Yuav Ua Li Cas Sau Ib Qho Program Rau Microcontroller
Video: 💞🎯🌐#Hais txog yuav ua li cas yus thiaj nrhiav tau yus tus kheej 🌐🎯9/30/2021 2024, Kaum ib hlis
Anonim

Sau cov program rau microcontroller nrog kev paub txog cov hauv paus ntawm cov kev pab cuam lus yog yooj yim heev. Koj tsuas yog yuav tsum txiav txim siab seb lub microcontroller koj xav siv. Xav txog kev sau qhov program rau PIC16F877, suav nrog txhua yam thev naus laus zis thiab cuam tshuam thiab muaj qhov zoo heev ntawm kev ua haujlwm.

Yuav ua li cas sau ib qho program rau microcontroller
Yuav ua li cas sau ib qho program rau microcontroller

Cov Lus Qhia

Kauj ruam 1

Qhib tawm cov phiaj xwm MPLAB uas raug xaiv ua ntej lawm thiab xaiv qhov Khoom Siv Project / project Wizard los ntawm cov ntawv qhia zaub mov. Tom qab ntawd lub qhov rais yuav qhib qhov twg nyem "Next". Xaiv PIC16F877 los ntawm cov npe muaj cov microcontrollers thiab nyem Next.

Kauj ruam 2

Hauv qhov rai uas qhib, xaiv lub compiler uas yuav ua tus txheej txheem ntawm koj qhov kev pab cuam yav tom ntej. Nco ntsoov xaiv HITECH PICC Toolsuite hauv Active Toolsuite sau. Nws yog lus C compiler. Tom qab ntawv muab txoj haujlwm no rau npe (TestPIC) thiab sau nws cov npe. Tsis txhob sau ua ntawv Lavxias, txwv tsis pub muaj teeb meem yuav tshwm sim thaum qhib cov ntaub ntawv. Nyem Next thiab tom qab ua tiav. Yog li, ib qho khoob khoob qhov project tau npaj tiav.

Kauj ruam 3

Nyem Ntaub Ntawv / Tshiab. Nyob rau hauv lub qhov rai uas tsis muaj npe uas tshwm sim, xaiv File / Save as … Sau lub npe TestPIC.c thiab mus rau daim nplaub tshev nrog daim phiaj xwm. Kos rau lub thawv tom ntej no Ntxiv Ntaub Ntawv rau Qhov Haujlwm. Hauv qab no, tso tus lej no rau hauv lub qhov rai qhib qhov project #include _CONFIG (0x03F72); rau cov menyuam i = 0; tsis lees lub ntsiab (chaw khoob) {T0IE = 0; GIE = 0; TRISB = 0; PORTB = 0; thaum (1 == 1) {PORTB ++; rau (i = 0; i

Kauj ruam 4

Qhib Cov Khoom Siv / Kev Siv Kho Khoom Siv … Ntawm no, teeb tsa cov txiaj ntsig ntawm cov kev xaiv rau qhov project: Oscillator - HS (tus quartz resonator yuav ua raws li lub tshuab hluav taws xob moos), WatchDog Timer - Off (tua tawm qhov pib ntawm microcontroller), Lub Hwjchim Up Timer - Rau (nyob hauv lub xeev pib dua), Brown Out Ntes - Ntawm, Qhov Kev Pab cuam tsawg - Tsis xiam oob khab, Flash Program Sau - Qhib, Cov Ntaub Ntawv EE Nyeem Tiv Thaiv - Tawm), Code Tiv Thaiv - Tawm (xiam MK kev tiv thaiv) Cov.

Kauj ruam 5

Sib sau cov kab ntawv. Txhawm rau ua qhov no, nyem qhov Project / Tsim Txhua. Tom qab muab tso ua ke tiav lawm, lub qhov rai yuav tshwm sim txog qhov ua tiav tiav. Tom qab ntawv, TestPIC.hex cov ntaub ntawv yuav tshwm nyob rau hauv cov phiaj xwm project, uas yuav muaj tus lej tshwj xeeb. Sau rau tus microprocessor siv tus programmer.

Pom zoo: