Cov txheej txheem:
- Kauj Ruam 1: Kev Txhim Kho Software
- Kauj Ruam 2: Kev Kho Vajtse Txuas
- Kauj ruam 3: Software Chaw
- Kauj Ruam 4: Sau thiab Thauj Khoom
- Kauj Ruam 5: Khiav App ntawm Lub Xov Tooj Ntawm Tes
- Kauj Ruam 6: Cov ntsiab lus
Video: Yuav Pib Li Cas Nrog IDE rau NRF51822, ARM® KEIL MDK V5 + ST-Txuas: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:27
Txheej txheem cej luam
Thaum kuv pib txhim kho daim ntawv thov nRF51822 rau kuv txoj haujlwm nyiam, kuv pom tias tsis tau teeb tsa cov ntaub ntawv ntawm cov ncauj lus no. Ntawm no, yog li, Kuv xav sau qhov kuv tau txais dhau los.
Qhov no piav qhia dab tsi ua rau kuv nyuaj rau siv "Softdevice" piv txwv app rau hauv pawg thawj coj. Lub cajmeem ntawm daim ntawv thov ble_app_hrm uas tau muab los ntawm Nordic SDK tau nthuav tawm ntawm no.
Thiab raws li qhia hauv daim duab 1, ST Nucleo-F401RE, Waveshare BLE400 thiab nRF51822 Pawg Thawj Coj tau siv, tab sis BLE400 tsis tsim nyog kom deb li koj tuaj yeem txuas ST-Txuas thiab koj li nRF51822 pawg thawj coj.
Thiab qhov zoo ntawm kev siv ST-Txuas ntawm Nucleo tau raug coj los muab lub zog ntawm 3.3 lossis 5V rau pawg nRF51822. Yog li, lub zog siv hluav taws xob yuav tsum tau npaj thaum siv ST-Txuas cov cuab yeej vim tias qee yam ntawm ST-Txuas cov cuab yeej zoo li tsis muaj lub peev xwm ntawm kev txhawb nqa lub microcontroller.
Kuv pom tias kuv lub nRF51822 pawg thawj coj yog "nRF51822_xxAA" uas muaj 256kB ROM (program nco me me) thiab 16kB RAM (duab thib ob).
Cov txheej txheem muaj cov hauv qab no.
- Kev Txhim Kho Software
- Kho vajtse txuas
- Software Chaw
- Sau thiab Thauj Khoom
- Khiav lub app ntawm lub xov tooj ntawm tes (Android)
Txhua cov ntaub ntawv tau txais raws li lub Cuaj Hlis 28, 2018.
Kauj Ruam 1: Kev Txhim Kho Software
Rub tawm MDK-ARM v5.26 lossis tom qab los ntawm ARM KEIL thiab teeb tsa nws hauv Windows 10. Thaum teeb tsa, Keil µVision IDE tau teeb tsa nrog ARM CMSIS thiab xws li. Tab sis, tom qab ntawd, lub kaw lus tsis muaj Nordic SDKs teeb tsa.
Thaum Keil µVision IDE xub pib, Pob Installer xa tawm. Hauv Pob Installer, cov software pob tsim nyog rau pawg phiaj los tsim kho tuaj yeem teeb tsa.
Saib daim duab 1.
Nws yog lub tswv yim zoo los nyem lub pob "Txheeb Rau Kev Hloov Kho Tshiab" txhawm rau hloov kho Pob Installer ua ntej.
Hauv Devices tab, tshawb nrhiav thiab xaiv lub hom phiaj ntaus ntawv, "nRF51822_xxAA" kom cov pob khoom cuam tshuam tshwm sim hauv Cov Piv txwv tab.
Hauv cov lus qhia no, kuv xaiv "ble_app_hrs_s130_pca10028 (nRF51 PCA10028)". Tsis txhob hnov qab uncheck "Qhia piv txwv los ntawm cov pob teeb tsa nkaus xwb" txhawm rau nrhiav txoj haujlwm hauv Piv Txwv tab txij li kev teeb tsa tseem tsis tau ua tiav ntawm qhov no.
Nyem rau "Nruab" khawm kom pib ntim (thiab tseem luam) qhov piv txwv qhov project. Thaum lub sijhawm luam cov phiaj xwm rau koj phau ntawv teev npe tsis raug cai, koj tau nug ob peb zaug los teeb tsa lwm Cov Software Pob uas xav tau los ntawm txoj haujlwm.
Saib daim duab 2.
Tom qab kev teeb tsa tiav, µVision qhib qhov haujlwm.
Nco ntsoov tias thawj qhov haujlwm nyob hauv C: / Keil_v5 / ARM / PACK / NordicSemiconductor / nRF_Examples / 11.0.0-2.alpha / ble_peripheral / ble_app_hrs / pca10028 / s130 / arm5.
Kauj Ruam 2: Kev Kho Vajtse Txuas
Ntawm no, daim duab qhia pom daim kab xev tiag.
Cov duab nthuav qhia txoj hauv kev txuas ntawm ST-Txuas thiab BLE400 nrog nRF51822 pawg thawj coj saib. Tsuas yog 4 kab ntawv xav tau raws li cov lus hauv qab no.
ST -Txuas (Nucleo) - nRF51822
+5V - USB5V
GND - NCO
SWCLK - SWDCLK
SWDIO - SWV
Txhawm rau xaiv ST-Txuas, "CN2" dhia yuav tsum qhib raws li qhia hauv daim duab.
Nco tseg: Hloov chaw muab lub zog ntawm 3.3V ua haujlwm ib yam nkaus.
Kauj ruam 3: Software Chaw
Cov txheej txheem hauv ntu no yuav tsum tau ua raws, txwv tsis pub nws tsis mus qhov twg.
Saib daim duab 1.
(1) Ua ntej tshaj plaws, xaiv "nrf51422_xxac_s130" los ntawm "Xaiv Lub Hom Phiaj" cov ntawv qhia zaub mov nco hauv toolbar ntawm µVision. Lub npe txawv ntawm lub cuab yeej phiaj xwm, tab sis qhov no yuav ua vim lawv qhov sib xws.
Saib daim duab 2
(2) Hauv Project qhov rai, sab laug-nyem "main.c" hauv Daim Ntawv Thov thiab xaiv "Txhais lus main.c" hauv cov ntawv qhia zaub mov kom suav nrog cov ntawv tsim nyog (daim duab thib 3). Nco ntsoov tias "nrf51422_xxac_s130" yuav tsum raug xaiv nyob ntawm qhov no lossis qhov haujlwm no tsis ua haujlwm.
(3) Nyem rau "Kev Xaiv Rau Lub Hom Phiaj" txhawm rau teeb tsa IDE (daim duab 1). Raws li kev ua haujlwm dhau los, "Txhais" tau teeb tsa lub hom phiaj microcontroller kom raug, nws tau lees paub tias IROM1: 0x1B000 hauv Pib, 0x25000 hauv Qhov Loj thiab IRAM: 0x20001F00 hauv Pib, 0x6100 hauv Qhov Loj raws li pom hauv Cov Phiaj Xwm tab (daim duab 4).
Saib daim duab 5.
(4) Hauv Debug tab, xaiv "ST-Link Debugger" los ntawm "Siv:" nco-down.
(5) Nyem rau "Chaw" khawm kom qhib "Cortex-M Lub Hom Phiaj Tsav Tsheb Teeb" lub qhov rais. Paub meej tias Debug tab qhia tias lub hom phiaj microcontroller txuas nrog (daim duab thib 6). Yog tias nws tsis yog, rov qab mus rau ntu Khoos phis tawj Kev Sib Txuas thiab tshawb xyuas qhov txuas txuas dua.
Saib daim duab 7.
(6) Hauv Flash Download tab, nyem rau "Add" khawm hauv Programming Algorithm thiab ntxiv "nRF51xxx External Connectivity Board". Ib qho ntxiv, "Pib dua thiab Khiav" tuaj yeem tshawb xyuas kom cia ST-Txuas rov pib dua thiab ua haujlwm.
Nyem OK thiab kaw "Option For Target" window.
(7) Tom ntej no, xaiv "flash_s130_nrf51_x.x.x-x-x_softdevice" los ntawm "Xaiv Lub Hom Phiaj" cov ntawv qhia zaub mov nco hauv toolbar.
(8) Nyem rau "Kev Xaiv Rau Lub Hom Phiaj". Hauv Debug tab, xaiv "ST-Link Debugger" los ntawm "Siv:" nco-down.
(9) Nyem rau "Chaw" khawm kom qhib "Cortex-M Lub Hom Phiaj Tsav Tsheb Teeb" lub qhov rais. Ib zaug ntxiv kom ntseeg tau tias Debug tab qhia tias lub hom phiaj ntaus ntawv tau txuas nrog. Yog tias nws tsis yog, rov qab mus rau ntu Khoos phis tawj Kev Sib Txuas thiab tshawb xyuas qhov txuas txuas dua.
(10) Hauv Flash Download tab, nyem rau "Add" khawm hauv "Programming Algorithm" thiab ntxiv "nRF51xxx External Connectivity Board". Thiab "Erase Full Chip" hauv "Download Function" tuaj yeem xaiv los tso rau ST-Txuas lwv lub rooj tsav xwm nco thaum pib flashing es tsis txhob siv tus kheej tshem tawm.
Nyem OK thiab kaw "Option For Target" window.
Tam sim no koj tau npaj los sau cov cai thiab nyem rau nRF51822.
Nco ntsoov tias txawm hais tias Ntaus Ntawv hauv "Kev Xaiv Rau Lub Hom Phiaj" qhia tias nRF51422_xxAC tau raug xaiv, uas ua haujlwm tau zoo.
Kauj Ruam 4: Sau thiab Thauj Khoom
Ua ntej tshaj plaws, ntawm no, xaiv "flash_s130_nrf51_x.x.x-x-x_softdevice" los ntawm "Xaiv Lub Hom Phiaj" nco cov ntawv qhia zaub mov hauv qhov toolbar thiab nyem lub pob Rub kom nyem lub cim xeeb. Koj pom "Txheeb Xyuas OK" yog tias rub tawm tau zoo (daim duab 1 & 2).
Tom qab ntawd, xaiv "nrf51422_xxac_s130" los ntawm "Xaiv Lub Hom Phiaj" cov ntawv qhia zaub mov nco thiab nyem khawm Tsim kom suav cov lej. Koj pom cov lus raws li qhia hauv daim duab thib 3.
Tom ntej no, nyem qhov Download khawm kom nyem lub cim xeeb. Koj pom tib cov lus zoo li daim duab 4.
Tom qab ua tiav qhov flashing, koj pom LED3 yog ntsais muag (yees duab).
Tam sim no, teeb tsa lub app hauv koj lub xov tooj ntawm tes, koj pom tias qhov program ua haujlwm zoo li cas.
Kauj Ruam 5: Khiav App ntawm Lub Xov Tooj Ntawm Tes
Nruab "nRF Toolbox rau BLE" app los ntawm Nordic Semiconductor hauv lub xov tooj ntawm tes lossis lub ncoo (daim duab 1).
Pib HRM thiab txuas nRF51822 (yees duab).
Kauj Ruam 6: Cov ntsiab lus
Muaj qee cov ntsiab lus hauv qhov kev qhia no;
- fais fab pawg nRF51822 txhawm rau txuas ST-Txuas
- txhais cov ntaub ntawv main.c ua ntej muab tso ua ke thiab rub tawm cov cai yog tias qhov piv txwv qhov project tau theej hauv cov npe uas tsis yog phau ntawv qub
- teeb tsa "nRF51xxx External Connectivity Board" hauv ntu Programming Algorithm
Kuv vam tias cov lus qhia no yuav pab cov hobbyists zoo li kuv.