Cov txheej txheem:

Yooj Yim Heev Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3: 7 Cov Kauj Ruam (nrog Duab)
Yooj Yim Heev Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3: 7 Cov Kauj Ruam (nrog Duab)

Video: Yooj Yim Heev Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3: 7 Cov Kauj Ruam (nrog Duab)

Video: Yooj Yim Heev Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3: 7 Cov Kauj Ruam (nrog Duab)
Video: Qhia rub nkauj kho siab yooj yim heev 2024, Kaum ib hlis
Anonim
Yooj Yim Heev Muaj Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3
Yooj Yim Heev Muaj Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3
Yooj Yim Heev Muaj Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3
Yooj Yim Heev Muaj Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3
Yooj Yim Heev Muaj Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3
Yooj Yim Heev Muaj Tsawg BLE hauv Arduino Tshooj 3 - Nano V2 Hloov - Rev 3

Hloov tshiab: 7th Plaub Hlis 2019 - Rev 3 ntawm lp_BLE_TempHumidity, ntxiv Hnub/Sijhawm cov phiaj xwm, siv pfodApp V3.0.362+, thiab pib kaw thaum xa cov ntaub ntawv

Hloov tshiab: 24th Lub Peb Hlis 2019 - Rev 2 ntawm lp_BLE_TempHumidity, ntxiv ntau txoj hauv kev xaiv thiab i2c_ClearBus, ntxiv GT832E_01 kev txhawb nqa

Taw qhia

Qhov kev qhia no, A Redbear Nano V2 Hloov, yog Tshooj 3 ntawm 3. Nov yog Kev Kho 2 ntawm txoj haujlwm no. Kev kho dua 2 PCB suav nrog kev teeb tsa rau lub npib ntawm tes thiab lub ntsuas pa, ua kom yooj yim kev tsim kho thiab txhim kho huab cua ntws ncig lub sensor thaum tiv thaiv nws los ntawm tshav ntuj ncaj qha. Kev kho dua 1 nyob ntawm no.

Ntu 1 - Lub Tsev Muaj Tsawg Tsawg heev BLE cov cuab yeej ua tau yooj yim nrog Arduino npog kev teeb tsa Arduino rau tus lej nRF52 cov cuab yeej siv hluav taws xob tsawg, cov qauv txheej txheem thiab ntsuas cov khoom siv tam sim no. Nws tseem suav nrog tshwj xeeb lub sijhawm qis zog thiab cov sib piv thiab nthuav tawm cov tswv yim thiab siv pfodApp los txuas rau thiab tswj lub nRF52 ntaus ntawv.

Ntu 2 - Lub Hwj Huam Muaj Zog Kub Quaj Quaj Quaj Quaj tau siv Redbear Nano V2 tus qauv thiab Si7021 qhov ntsuas kub / av noo los tsim lub zog qis roj teeb / saib hnub ci. Nws tseem suav nrog kev hloov kho Si7021 lub tsev qiv ntawv kom muaj zog qis, kho BLE lub cuab yeej kom txo nws cov kev siv tam sim no mus rau <29uA thiab tsim qauv kev cai ntsuas kub/av noo rau koj lub xov tooj.

Ntu 3 - Kev Hloov Redbear Nano V2, qhov no, npog siv lwm yam nRF52 raws cov qauv hloov pauv ntawm Nano V2. Nws suav nrog xaiv cov khoom siv, kev tsim kho, tshem tawm nRF52 nti txheej txheem kev tiv thaiv, siv NFC pins li qub GPIO, thiab txheeb xyuas lub nRF52 pawg thawj coj tshiab hauv Arduino.

Cov lus qhia no yog daim ntawv thov siv ntawm Ntu 1 Lub Tsev Muaj Tsawg Tsawg heev BLE cov cuab yeej ua tau yooj yim nrog Arduino los ntawm kev tsim Lub Zog Muaj Tsawg Tsawg heev BLE Kub thiab Vaum Txheeb Xyuas siv SKYLAB SBK369 pawg thawj coj los hloov Nano V2. Cov ntawv qhia no qhia txog yuav tsim lub rooj tsav xwm tshiab txhais li cas thiab yuav tshem nRF52 lub phiaj xwm tiv thaiv li cas kom rov ua haujlwm dua. Cov ntawv qhia no siv tib daim duab ib yam li Tshooj 2 nrog tib qhov hloov pauv BLE tsis rau kev siv hluav taws xob tsawg thiab tuaj yeem siv los ntawm roj teeb LOSSIS roj teeb + hnub ci lossis hnub ci nkaus xwb. Kev kho dua ntawm BLE qhov ntsuas rau lub zog qis tau npog hauv Ntu 2

Rev 3 ntawm lp_BLE_TempHumidity npaj cov ntaub ntawv tiv thaiv hnub thiab sijhawm siv tsuas yog Arduino millis (). Saib Arduino Hnub thiab Sijhawm siv millis () thiab pfodApp siv qhov tseeb version ntawm pfodApp (V3.0.362+).

Rev 4 ntawm pfod_lp_nrf52.zip kuj txhawb nqa GT832E_01 module thiab qhov kev qhia no suav nrog siv NFC nRF52 pins raws li tus qauv GPIO's.

Tus saib xyuas tsim ntawm no yuav ua haujlwm tau ntau xyoo ntawm Npib Cell lossis 2 x AAA roj teeb, txawm tias ntev dua nrog kev pab hnub ci. Ib yam li tso saib qhov kub thiab txias tam sim no, tus saib xyuas khaws 36 teev dhau los ntawm 10 feeb nyeem thiab 10 hnub kawg ntawm kev nyeem ib teev. Cov no tuaj yeem ua tus cim rau ntawm koj lub xov tooj ntawm tes Android thiab qhov txiaj ntsig tau khaws cia rau hauv cov ntaub ntawv teev cia. Tsis xav tau Android Programming, pfodApp ua txhua yam ntawd. Cov zaub hauv Android thiab kab kos tau tswj hwm tag nrho los ntawm koj daim duab Arduino yog li koj tuaj yeem hloov kho nws raws li xav tau.

Ntu 2 tau siv Redbear Nano V2 board rau nRF52832 BLE tivthaiv. Txoj haujlwm no hloov pauv nrog tus nqi pheej yig dua SKYLAB SKB369. Raws li hauv Ntu 2, Sparkfun Si7021 pawg thawj coj tawg tau siv rau Kev ntsuas Kub / Vaum. Hloov kho lub tsev qiv ntawv qis zog siv nrog Si7021.

Kauj Ruam 1: Vim Li Cas Nano V2 Hloov?

i) Lub Nano V2 tsis tau tsim tawm rau ntau lub hlis thiab zoo li tsis haum rau hauv Particle.io kab ntawv yog li nws tsis paub meej tias nws yuav muaj sijhawm ntev npaum li cas.

ii) Nano V2 kim dua. Txawm li cas los nws kuj muaj cov yam ntxwv ntxiv. Saib hauv qab no.

iii) Nano V2 muaj cov khoom siv ntawm ob sab uas ua rau nws muaj qhov profile siab dua thiab ua rau nws nyuaj rau teeb tsa.

iv) Nano V2 muaj qhov txwv I/O pins muaj thiab siv D6 txog D10 xav kom ya dav hlau.

Txawm hais tias Nano V2 board yog kim dua li SKYLAB SKB369 pawg thawj coj, ~ US17 piv rau ~ US5, Nano V2 muaj ntau yam ntxiv. Nano V2 suav nrog 3.3V tus tswj hwm thiab muab cov khoom siv hluav taws xob, cov khoom siv ntxiv rau siv nRF52 DC/DC hloov pauv xaiv, lub kav hlau txais xov nti thiab uFL SMT kav hlau txais xov txuas.

Lwm txoj hauv kev yog GT832E_01 tus qauv siv los ntawm www.homesmartmesh.com. Rev 4 ntawm pfod_lp_nrf52.zip kuj txhawb nqa lub program GT832E_01 module. SKYLAB SKB369 thiab GT832E_01 muaj los ntawm

Redbear (Particle.io) kuj tseem muaj cov qauv liab qab yam tsis muaj 3V3 tus tswj hwm, DC/DC cov khoom lossis 32Khz cov khoom siv lead ua.

Tus qauv

Txoj haujlwm no muaj 4 ntu sib txheeb ywj pheej:-

Kev xaiv thiab kev tsim kho tshem tawm nRF52 coding tiv thaiv tus chij thiab cov phiaj xwm kos duab Tsim Tus Tshiab Arduino nRF52 Pawg Txhais Lus Txhais Rov Kho dua nRF52 NFC pins li GPIO's

Kauj Ruam 2: Kev Xaiv thiab Kev Tsim Kho

Kev Xaiv Cheeb Tsam

Ntxiv rau nRF52832 thiab Si7021 cov khoom xaiv hauv Tshooj 2, txoj haujlwm no ntxiv 3.3V tus tswj hwm thiab muab cov khoom siv hluav taws xob.

Qhov Voltage Regulator tivthaiv

Tus tswj hwm siv ntawm no yog MC87LC33-NRT. Nws tuaj yeem tswj tau txog 12V cov tswv yim thiab muaj lub zog tam sim no ntawm <3.6uA, feem ntau 1.1uA. Nano V2 siv TLV704 tus tswj hwm muaj qhov siab dua me ntsis tam sim no, feem ntau yog 3.4uA thiab tuaj yeem ua haujlwm siab dua qhov hluav taws xob, mus txog 24V. MC87LC33-NRT tau raug xaiv hloov vim tias nws cov ntawv qhia tshwj xeeb nws yuav teb li cas vim qhov ntsuas hluav taws xob poob qis dua 3.3V qhov twg raws li TLV704 cov ntawv tsis ua.

TLV704 qhia txog qhov nkag hluav taws xob ntawm 2.5V yam tsawg kawg nkaus thiab nws tsis meej los ntawm cov ntawv teev tseg dab tsi yuav tshwm sim hauv qab no. Lub nRF52832 yuav poob mus rau 1.7V thiab Si7023 yuav poob mus rau 1.9V. MC87LC33-NRT ntawm qhov tod tes qhia txog kev tawm tswv yim/qhov hluav taws xob sib txawv mus rau 0V rau cov dej ntws qis (Daim duab 18 ntawm cov ntawv teev tseg). Yog li muab qhov kev xaiv ntawm cov khoom siv, MC87LC33-NRT raug xaiv vim nws muaj qhov ua tau zoo tshwj xeeb.

Muab Capacitors

MC87LC33-NRT tus tswj hwm xav tau qee cov khoom siv hluav taws xob kom ruaj khov thiab teb tau. Ib qho khoom siv hluav taws xob tso tawm> 0.1uF raug pom zoo ntawm cov ntawv teev npe. SKYLAB SBK369 tseem qhia txog 10uF/0.1uF capacitors ntawm cov khoom nyob ze rau ntawm pawg thawj coj. Cov khoom siv loj dua pab txhawb nqa nRF52 TX tam sim no spikes. Ntawm no 4 x 22uF 25V thiab 3 x 0.1uF 50V Cov khoom siv hluav taws xob tau siv. Ib qho 22uF thiab 0.1uF capacitor tau muab kaw ze rau SKYLAB SBK369, 0.1uF tau muab tso ze rau ntawm MC87LC33-NRT cov zis kom ntseeg tau tias muaj kev ruaj ntseg thiab 22uF thiab 0.1uF tau muab tso rau ntawm cov tswv yim rau MC87LC33-NRT thiab ntxiv 2 x 22uF capacitors qhov twg soldered hla Vin/GND pins ua qhov txuas ntxiv tam sim no. Txog kev sib piv NanoV2 pawg thawj coj muaj 22uF / 0.1uF ntawm cov tswv yim rau TLV704 tus tswj hwm thiab 0.1uF ntawm nws cov zis.

Cov peev txheej tso dej ntxiv tam sim no tau teeb tsa ntawm cov tswv yim rau 3.3V tus tswj hwm kom lawv yuav them rau qhov hluav taws xob siab dua thaum khiav nrog lub hnub ci. Them rau qhov hluav taws xob siab dua sib npaug rau khaws cia ntau dua tam sim no los muab Tx spikes.

Ceramic X5R capacitors tau siv vim tias lawv muaj cov tsis muaj zog tiv taus thiab qis qis tam sim no. Qhov kev tiv thaiv feem ntau yog 100, 000MΩ lossis 1000MΩ - µF uas yog tsawg dua. Yog li rau 22uF peb muaj 22000MΩ, piv txwv li 0.15nA to ntawm 3.3V lossis 0.6nA rau plaub 22uF capacitors. Qhov ntawd yog qhov tsis tsim nyog. Txog kev sib piv ESR Tsawg, Tsawg Leakage Panasonic Electrolytic capacitors muaj cov dej ntws tawm ntawm <0.01CV. Yog li rau 22uF 16V capacitor qhov to yog <10uA. Nco tseg: Qhov no yog qhov xau ntawm qhov ntsuas hluav taws xob, 16V hauv qhov no. Cov dej xau qis dua ntawm qhov qis qis dua, piv txwv li <2.2uA ntawm 3.3V.

Daim Ntawv Teev Npe

Kwv yees tus nqi ib chav raws li Lub Kaum Ob Hlis 2018, ~ US $ 61, tsis suav nrog kev xa khoom thiab tus programmer los ntawm Ntu 1

  • SKYLAB SKB369 ~ US $ 5 piv txwv li Aliexpress
  • Sparkfun Si7021 breakout board ~ US $ 8
  • 2 x 53mm x 30mm 0.15W 5V solar cell xws li Overfly ~ US $ 1.10
  • 1 x PCB SKYLAB_TempHumiditySensor_R2.zip ~ US $ 25 rau 5 tawm www.pcbcart.com
  • 1 x MC78LC33 3.3V tus tswj hwm, piv txwv li Digikey MC78LC33NTRGOSCT-ND ~ US $ 1
  • 2 x 0.1uF 50V ceramic C1608X5R1H104K080A xws li Digikey 445-7456-1-ND ~ US $ 0.3
  • 4 x 22uF 16V ceramic GRM21BR61C226ME44L xws li Digikey 490-10747-1-ND ~ US $ 2
  • 1 x BAT54CW, np. Digikey 497-12749-1-ND ~ US $ 0.5
  • 1 x 470R 0.5W 1% resistor xws li Digikey 541-470TCT-ND ~ US $ 0.25
  • 1 x 10V 1W zener SMAZ10-13-F xws li Digikey SMAZ10-FDICT-ND ~ US $ 0.5
  • 3mm x 12mm nylon screws, xws li Jaycar HP0140 ~ AUD $ 3
  • 3mm x 12mm nylon ceev, xws li Jaycar HP0146 ~ AUD $ 3
  • Scotch Cuam Tshuam Mounting Daim Kab Xev 4010 xws li los ntawm Amazon ~ US $ 6.6
  • CR2032 lub roj teeb tuav, piv txwv li HU2032-LF ~ US $ 1.5
  • CR2032 roj teeb ~ US $ 1
  • Perspex ntawv, 3.5mm thiab 8mm
  • pfodApp ~ US $ 10
  • Cov Tshuaj Txhuam Hniav xws li Jaycar NS-3046 ~ AUD $ 13

Kauj Ruam 3: Kev tsim kho

Kev tsim kho
Kev tsim kho
Kev tsim kho
Kev tsim kho
Kev tsim kho
Kev tsim kho

Txoj haujlwm tau tsim los ntawm PCB me me. PCB tau tsim los ntawm pcbcart.com los ntawm cov ntaub ntawv Gerber no, SKYLAB_TempHumiditySensor_R2.zip Cov PCB ua raws li Nano V2 tus pin tawm thiab yog lub hom phiaj txaus txaus siv rau lwm qhov haujlwm BLE.

Nov yog daim duab (pdf version)

Ua ntej siv cov khoom siv SMD, tom qab ntawd teeb tsa SKYLAB SKB369 lub rooj tsavxwm

Yuav luag tag nrho cov khoom siv yog cov khoom siv saum npoo (SMD). Cov capacitors thiab IC's tuaj yeem nyuaj rau siv los ntawm txhais tes. Cov txheej txheem pom zoo yog tuav PCB hauv ib qho piv txwv thiab siv me me ntawm cov tshuaj txhuam txhuam rau hauv cov ntaub qhwv thiab tso cov khoom SMD, tshwj tsis yog SKB369 pawg thawj coj ntawm PCB. Tom qab ntawd siv rab phom cua sov, siv cua sov rau sab hauv qab ntawm PCB kom txog thaum cov tshuaj txhuam tau yaj thiab tom qab ntawd ua kom nrawm nrawm dua rau saum lub rooj tsavxwm kom ceev faj tsis txhob tshuab cov khoom tawm. Thaum kawg kov lub Cheebtsam nrog lub taub me me soldering hlau. Ceev faj nrog cov capacitors thiab resistor vim nws yooj yim rau yaj ob qho kawg thiab muaj cov khoom tuaj yeem xoob thaum siv ib qho kawg.

Qhov kev tshuaj xyuas no ntxiv 22uF 16V cov khoom siv hluav taws xob ntau. Cov khoom siv hluav taws xob ntxiv no txo qis qhov tam sim no rub los ntawm lub roj teeb thiab tseem txo qhov hluav taws xob poob qis thaum siv los ntawm lub hnub ci. Tsuav yog qhov hluav taws xob los ntawm lub hnub ci cell tseem nyob saum lub roj teeb qhov hluav taws xob ces tsis muaj qhov tam sim no tau kos los ntawm lub roj teeb.

Tom qab cov khoom SMD tau teeb tsa, koj tuaj yeem muab tshuaj txhuam hauv SKYLAB SKB369 pawg thawj coj saib. Muaj ob qhov kev sim ntsuas ntawm ib sab ntawm SKB369 tabs. Siv ob tus pin rau hauv daim duab los qhia hauv paus rau SKB369 lub rooj tsavxwm thiab ua tib zoo kho cov pins. (Saib cov duab piv txwv saum toj no siv Kev Hloov Kho 1 PCB) Tom qab ntawd muab ib tus pin ntawm sab rov qab los tuav lub rooj tsavxwm nyob rau hauv qhov chaw ua ntej siv lwm tus pin.

Nco tseg Gnd txuas xaim los ntawm CLK rau GND hauv ntu ua tiav. Qhov no tau teeb tsa tom qab lub program los tiv thaiv lub suab nrov ntawm CLK cov tswv yim los ntawm kev ua rau nRF52 nti mus rau hauv hom kev debug tam sim no

Mounting Case

Cov ntaub ntawv teeb tsa tau ua los ntawm ob daim ntawm perspex, 110mm x 35mm, tuab 3mm. Daim 3.5mm hauv qab lub hnub ci hlwb tau muab coj los ua 3mm nylon ntsia hlau. Qhov kev hloov kho tshiab no yog yooj yim dua tom qab Rev 1 thiab txhim kho huab cua ntws ncig lub ntsuas. Cov qhov ntxiv ntawm txhua qhov kawg yog rau kev teeb tsa, siv cov kab sib txuas piv txwv.

Kauj Ruam 4: Tshem Tawm NRF52 Coding Tiv Thaiv Chij

Tshem tawm NRF52 Coding Tiv Thaiv Chij
Tshem tawm NRF52 Coding Tiv Thaiv Chij
Tshem tawm NRF52 Coding Tiv Thaiv Chij
Tshem tawm NRF52 Coding Tiv Thaiv Chij
Tshem tawm NRF52 Coding Tiv Thaiv Chij
Tshem tawm NRF52 Coding Tiv Thaiv Chij

Txuas lub Rooj Tswjhwm Saib Xyuas Kub/Vaum mus rau Tus Kws Tshaj Lij tau piav qhia hauv Tshooj 1 raws li qhia saum toj no.

Nrog lub hnub ci thiab lub roj teeb tsis tau txuas, Vin thiab Gnd txuas nrog tus programmer's Vdd thiab Gnd (Tus coj daj thiab ntsuab) thiab SWCLK thiab SWDIO tau txuas rau Clk thiab SIO ntawm tus programmer header board (Dawb thiab Grey ua)

Tshem tawm nRF52 txoj haujlwm tiv thaiv

Los ntawm Nordic Semi - Debug and Trace page DAP - Debug Access Port. Ib tus debugger sab nraud tuaj yeem nkag mus rau lub cuab yeej ntawm DAP. DAP siv tus txheej txheem ARM® CoreSight ™ Serial Wire Debug Port (SW-DP). SW-DP ua raws li Serial Wire Debug raws tu qauv (SWD) uas yog ob tus lej sib txuas, SWDCLK thiab SWDIO

Tseem ceeb: Txoj kab SWDIO muaj qhov rub tawm sab hauv. SWDCLK kab muaj qhov rub tawm sab hauv.

CTRL -AP - Tswj Chaw Nkag Nkag. Qhov Chaw Nkag Nkag Nkag Nkag Nkag (CTRL-AP) yog qhov chaw nkag tau yooj yim uas tso cai tswj hwm lub cuab yeej txawm hais tias lwm qhov chaw nkag mus hauv DAP raug xiam los ntawm kev tiv thaiv chaw nres nkoj. Nkag mus rau qhov chaw tiv thaiv thaiv qhov debugger los ntawm kev nyeem thiab sau nkag mus rau txhua lub CPU sau npe thiab chaw nyob nco-mapped. Lov tes taw kev tiv thaiv chaw nres nkoj. Kev tiv thaiv chaw nres nkoj tuaj yeem tsuas yog xiam oob qhab los ntawm kev tshaj tawm ERASEALL cov lus txib ntawm CTRL-AP. Cov lus txib no yuav tshem tawm Flash, UICR, thiab RAM.

Xaiv CMSIS-DAP ua tus programmer rau Particle's Debugger thiab xaiv nRF5 Flash SoftDevice

Yog tias flash ua haujlwm, tom qab ntawd yog qhov zoo, tab sis feem ntau cov qauv yuav tau tiv thaiv kev rov tsim dua tshiab thiab koj yuav tau txais qhov yuam kev no tso rau hauv Arduino qhov rai

Qhib On-Chip Debugger 0.10.0-dev-00254-g696fc0a (2016-04-10-10: 13) Muaj ntawv tso cai hauv qab GNU GPL v2 Rau kab lus ceeb toom, nyeem https://openocd.org/doc/doxygen/bugs.html debug_level: 2 Cov ntaub ntawv: tsuas yog ib qho kev xaiv thauj; autoselect 'swd' adapter nrawm: 10000 kHz cortex_m reset_config sysresetreq Info: CMSIS-DAP: SWD Txhawb Cov Ntaub Ntawv: CMSIS-DAP: Interface Initialised (SWD) Info: CMSIS-DAP: FW Version = 1.10 Info: SWCLK/TCK = 1 SWDIO/ TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info: CMSIS-DAP: Interface npaj Info: txo kev thov ceev: 10000kHz txog 5000kHz ntau Info: moos ceev 10000 kHz Info: SWD IDCODE 0x2ba01477 Yuam kev: Tsis tuaj yeem nrhiav MEM -AP los tswj cov tub ntxhais yuam kev: Lub hom phiaj tseem tsis tau tshuaj xyuas tseem ua yuam kev thaum flashing SoftDevice.

Hauv qhov xwm txheej ntawd koj yuav tsum teeb tsa ERASEALL cov lus txib sau npe hauv nRF52 txhawm rau tshem lub cim xeeb thiab ua kom lub cuab yeej siv tau dua. Cov version ntawm openOCD muab nrog sandeepmistry nRF52 tsis suav nrog cov lus txib apreg xav tau los sau rau ERASEALL hais kom sau npe yog li koj yuav tsum teeb tsa tom qab.

Nruab OpenOCD version OpenOCD-20181130 lossis siab dua. Windows pre-compiled version yog muaj los ntawm https://gnutoolchains.com/arm-eabi/openocd/ Tus lej tshiab kawg muaj los ntawm

Qhib cov lus txib kom sai thiab hloov pauv mus rau OpenOCD install directory thiab sau cov lus txib

bin / openocd.exe -d2 -f interface/cmsis -dap.cfg -f phiaj/nrf52.cfg

Cov lus teb yog

Qhib On-Chip Debugger 0.10.0 (2018-11-30) [https://github.com/sysprogs/openocdownloadLicensed under GNU GPL v2 Rau kab mob qhia, nyeem https://openocd.org/doc/doxygen/ bugs.html debug_level: 2 Cov ntaub ntawv: nws pib xaiv thawj zaug muaj thauj thauj "swd". Txhawm rau hla kev siv 'thauj xaiv'. adapter ceev: 1000 kHz cortex_m reset_config sysresetreq Cov ntaub ntawv: Mloog ntawm chaw nres nkoj 6666 rau tcl sib txuas Info: Mloog ntawm chaw nres nkoj 4444 rau kev sib txuas hauv telnet Cov ntaub ntawv: CMSIS-DAP: SWD Txhawb Cov Ntaub Ntawv: CMSIS-DAP: FW Version = 1.10 Info: CMSIS-DAP: Interface Initialised (SWD) Info: SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info: CMSIS-DAP: Interface ready Info: moos ceev 1000 kHz Info: SWD DPIDR 0x2ba01477 Yuam kev: Tsis tuaj yeem nrhiav MEM-AP los tswj cov ntaub ntawv tseem ceeb: Mloog ntawm chaw nres nkoj 3333 rau kev sib txuas gdb

Tom qab ntawd qhib lub qhov rai dav dav xws li TeraTerm (Windows) lossis CoolTerm (Mac) thiab txuas rau 127.0.0.1 chaw nres nkoj 4444

Lub qhov rai telnet yuav qhia a> thiab cov lus txib tam sim yuav qhia Cov Ntaub Ntawv: lees txais 'telnet' kev txuas ntawm tcp/4444

Hauv lub qhov rai telnet (piv txwv li TeraTerm) typenrf52.dap apreg 1 0x04this rov qab 0x00000000 qhia tias lub nti raug tiv thaiv. Tom qab ntawd typenrf52.dap apreg 1 0x04 0x01 thiab tom qab ntawdnrf52.dap apreg 1 0x04this rov qab 0x00000001 uas qhia lub nti tam sim no tau teeb tsa rau ERASEALL ntawm kev rov pib dua tom ntej.

Kaw qhov kev sib txuas hauv telnet thiab tseem siv Ctrl-C kom tawm ntawm qhov program openOCD hauv qhov hais kom ua sai thiab tom qab ntawd hloov lub zog nRF52 tus qauv thiab tam sim no nws yuav npaj rau qhov program.

Tam sim no rov sim flashing lub softdevice.

Tam sim no koj tuaj yeem ua haujlwm nRF52 tus qauv los ntawm Arduino.

Kauj Ruam 5: Ua Haujlwm SKYLAB SKB369

Kev ua haujlwm SKYLAB SKB369
Kev ua haujlwm SKYLAB SKB369
Kev ua haujlwm SKYLAB SKB369
Kev ua haujlwm SKYLAB SKB369
Kev ua haujlwm SKYLAB SKB369
Kev ua haujlwm SKYLAB SKB369

Kaw Arduino thiab rov txhim kho qhov hloov tshiab kawg ntawm pfod_lp_nrf52 kev txhawb nqa los ntawm kev ua raws li Kev teeb tsa pfod_lp_nrf52 kho vajtse cov lus qhia. Qhov tseeb pfod_lp_nrf52 suav nrog SKYLAB SKB369 Nano2 hloov pawg thawj coj saib. Xaiv qhov ntawd los ua lub rooj tsavxwm thiab tom qab ntawd koj tuaj yeem tsim kho nws nrog Kev Kho 3 ntawm lp_BLE_TempHumidity, lp_BLE_TempHumidity_R3.zip, raws li tau piav qhia hauv Ntu 2.

Yog hais tias lub programming tsis ua. Kaw tag nrho Arduino lub qhov rais, tshem lub USB cable, rov pib dua Arduino thiab ntsaws tus programmer USB cable rov qab rau hauv thiab ntsaws nRF52 tus qauv USB muab rov qab rau hauv thiab sim dua.

Tom qab ntawd txuas ntawm pfodApp los tso saib qhov ntsuas kub thiab av noo tam sim no thiab yav dhau los. Thaum koj tau nthuav tawm cov phiaj xwm keeb kwm, kev nyeem, nrog lub sij hawm millisecond lub sijhawm, tau khaws tseg rau hauv cov ntaub ntawv teev cia ntawm koj lub xov tooj thiab tseem muaj nyob hauv cov ntaub ntawv nyoos.

Cov ntaub ntawv teev cia tseem muaj cov ntaub ntawv ntxiv uas tsim nyog los rov tsim cov phiaj xwm hnub thiab sijhawm hauv daim ntawv nthuav tawm. Saib Arduino Hnub thiab Sijhawm siv millis () thiab pfodApp kom paub meej

Kauj Ruam 6: Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus

Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus
Tsim Tus Tshiab Arduino NRF52 Pawg Txhais Lus

Txhawm rau txhawb nqa pawg thawj coj tshiab nRF52 koj yuav tsum tau a) ntxiv cov npe tshiab hauv cov kab ntawv sib txawv nrog cov ntawv hauv pawg thawj coj saib thiab b) hloov cov ntawv board.txt ntxiv rau pawg thawj coj tshiab rau Arduino.

Ntxiv qhov hloov tshiab nRF52 pawg thawj coj saib

Raws li tau piav qhia hauv Ntu 1, Txhim kho pfod_lp_nrf52 kho vajtse txhawb nqa, nrhiav cov khoom lag luam sub-directory ntawm sandeepmistry pob uas koj tau hloov kho nrog pfod_lp_nrf52 txhawb nqa. Qhib / kho vajtse / nRF5 / 0.6.0 / variants sub-directory thiab tsim cov npe tshiab rau koj lub rooj tsav xwm tshiab, piv txwv li SKYLAB_SKB369_Nano2replacement Hauv qhov tshiab / hardware / nRF5 / 0.6.0 / variants / SKYLAB_SKB369_Nano2replacement directory tsim peb cov ntaub ntawv variant.h, variant.cpp thiab pins_arduino.h Koj tuaj yeem luam lawv los ntawm ntawm lwm lub rooj tsav xwm sib txawv cov npe. Txog SKYLAB_SKB369_Nano2 kev hloov pauv, kuv tau pib theej cov ntaub ntawv los ntawm RedBear_BLENano2 hloov pauv.

pins_arduino.h cov ntaub ntawv

Cov ntaub ntawv pins_arduino.h tsis tas yuav hloov pauv. Nws tsuas yog suav nrog cov ntaub ntawv variant.h

variant.h cov ntaub ntawv

Kho cov ntaub ntawv variant.h txhawm rau txheeb xyuas tag nrho tus lej ntawm koj lub rooj tsav xwm yuav muaj, PINS_COUNT

NCO TSEG: Hauv pob sandeepmistry, NUM_DIGITAL_PINS, NUM_ANALOG_INPUTS thiab NUM_ANALOG_OUTPUTS teeb tsa raug tsis quav ntsej

Yog tias koj pawg thawj coj ua ntau dua lossis tsawg dua cov pins analog, hloov kho / * Analog Pins * / ntu ntawm cov ntaub ntawv variants.h.

NCO TSEG: Rau NanoV2 thiab SKYLAB cov laug cam Cov Analog pins tau teeb tsa rau Digital pins A0 == D0 thiab lwm yam

Qhov no tsis tseem ceeb. Koj tuaj yeem muab cov tswv yim Analog rau txhua tus yooj yim Arduino tus pin. Saib ces xiav/variant.h thiab xiav/variant.cpp cov ntaub ntawv rau qhov piv txwv.

Lub nRF52832 nti muaj 8 tus lej sib piv, tab sis SKYLAB_SKB369_Nano2 kev hloov pauv pawg thawj coj tsuas yog ua rau 6 ntawm lawv muaj kom phim Nano2.

Txhua tus lej tus lej, tshwj tsis yog RESET_PIN, hauv cov ntaub ntawv variant.h yog tus lej tus lej Arduino. Ntawd yog #define PIN_A0 (0) qhia tias D0 hauv daim duab arduino yog tus pin tib yam li A0. RESET_PIN yog qhov kev zam. Tus lej ntawd yog nRF52823 tus lej pin tus lej thiab 21 yog qhov kev xaiv siv tau nkaus xwb. Txawm li cas los xij pfod_lp_nrf52 kev txhawb nqa tsis tuaj yeem pab tus pin rov pib dua ntawm nRF52832

variant.cpp cov ntaub ntawv

Tsuas muaj ib qho nkag hauv cov ntaub ntawv variant.cpp, g_ADigitalPinMap array uas qhia Arduino tus lej tus lej rau nRF52832 nti P0.. pins

NCO TSEG: Hauv NanoV2 thiab SKYLAB cov laug cam, Arduino analog pins A0, A1… zoo ib yam li Arduino digital pins D0, D1…

Txog rau cov tswv yim Analog koj lub rooj tsav xwm muaj, cov nkag hauv g_ADigitalPinMap yuav tsum qhia daim npav nRF52832 AIN0, AIN1, AIN2, thiab tus lej tus lej. xws li AIN0 yog tus pin pin P0.02, AIN1 yog tus pin pin P0.03 thiab lwm yam pom nRF52832 tus pin teeb tsa saum toj no.

Siv (uint32_t) -1 rau daim ntawv qhia tsis raug. Piv txwv li SKYLAB_SKB369_Nano2 hloov lub rooj tsavxwm tsis muaj lub teeb tsa hauv LED, D13, yog li nws txoj haujlwm tau teeb tsa rau (uint32_t) -1

Hauv pfod_lp_nrf52.zip Redbear NanoV2, SKYLAB SKB369 thiab GT832E_01 cov kab ntawv sib txawv ntawm cov npe me me muaj cov duab qhia pom daim ntawv teeb tsa los ntawm variant.cpp. (Saib cov duab saum toj no)

Nyob rau hauv rooj plaub ntawm SKYLAB SKB369, muaj ntau tus pin los xaiv los ntawm. Tsuas yog txaus tau teeb tsa kom phim NanoV2. Hauv qhov xwm txheej ntawm GT832E_01, txhua tus pin uas muaj yuav tsum tau teeb tsa. Txawm tias tom qab ntawd tsuas muaj peb (3) cov tswv yim sib piv siv tsis tau rau rau (6) ntawm NanoV2. Zoo li qhov no ob lub NFC pins, P0.09 thiab P0.10, yuav tsum tau teeb tsa dua li GPIO's. Saib Reconfiguring nRF52 NFC pins li GPIO's hauv qab no.

Hloov kho cov boards.txt cov ntaub ntawv

Nov yog SKYLAB_SKB369_Nano2 kev hloov pauv nkag mus rau hauv boards.txt cov ntaub ntawv.

## SKYLAB_SKB369 Nano2 Hloov Chaw SKYLAB_SKB369_NANO2_REPLACEMENT.name =*SKYLAB SKB369 Nano2 Hloov

SKYLAB_SKB369_NANO2_REPLACEMENT.upload.tool = sandeepmistry: openocd

SKYLAB_SKB369_NANO2_REPLACEMENT.upload.protocol = cmsis-dap SKYLAB_SKB369_NANO2_REPLACEMENT.upload.target = nrf52 SKYLAB_SKB369_NANO2_REPLACEMENT.upload.use_1200bps_touch = tsis tseeb SKYLAB_SKB369_NANO2_REPLACEMENT.upload.wait_for_upload_port = cuav SKYLAB_SKB369_NANO2_REPLACEMENT.upload.native_

SKYLAB_SKB369_NANO2_REPLACEMENT.bootloader.tool = sandeepmistry: openocd

SKYLAB_SKB369_NANO2_REPLACEMENT.build.mcu = cortex-m4

SKYLAB_SKB369_NANO2_REPLACEMENT.build.f_cpu = 16000000 SKYLAB_SKB369_NANO2_REPLACEMENT.build.board = SKYLAB_SKB369_Nano2replacement SKYLAB_SKB369_NANO2_REPLACEMENT.build.core = nRF5 SKYLAB_SKB369_NANO2_REPLACEMENT.build.variant = SKYLAB_SKB369_Nano2replacement SKYLAB_SKB369_NANO2_REPLACEMENT.build.variant_system_lib = SKYLAB_SKB369_NANO2_REPLACEMENT.build.extra_flags = -DNRF52 SKYLAB_SKB369_NANO2_REPLACEMENT.build.float_flags = -mfloat -abi = nyuaj -mfpu = fpv4-sp-d16 SKYLAB_SKB369_NANO2_REPLACEMENT.build.ldscript = nrf52_xxaa.ld

SKYLAB_SKB369_NANO2_REPLACEMENT.menu.lfclk.lfrc.build.lfclk_flags = -DUSE_LFXO

SKYLAB_SKB369_NANO2_REPLACEMENT.menu.softdevice.s132 = S132

SKYLAB_SKB369_NANO2_REPLACEMENT.menu.softdevice.s132.softdevice = s132 SKYLAB_SKB369_NANO2_REPLACEMENT.menu.softdevice.s132.softdeviceversion = 2.0.1 SKYLAB_SKB369_NANO2_REPLACEMENT.menu.softdevice.s132.upload.maximum_size = 409600 SKYLAB_SKB369_NANO2_REPLACEMENT.menu.softdevice.s132.build.extra_flags = - DNRF52 -DS132 -DNRF51_S132 SKYLAB_SKB369_NANO2_REPLACEMENT.menu.softdevice.s132.build.ldscript = armgcc_s132_nrf52832_xxaa.ld

board.txt Chaw

Lus pom - kab pib nrog # yog cov lus pom.

Ua ntej - txhua lub rooj tsav xwm xav tau cov cim ua ntej tshwj xeeb los txheeb xyuas nws qhov txiaj ntsig. Nov yog cov ntawv ua ntej yog SKYLAB_SKB369_NANO2_REPLACEMENT.

Lub Npe - SKYLAB_SKB369_NANO2_REPLACEMENT.name kab qhia meej lub npe ntawm pawg thawj coj no los qhia hauv Arduino's board menu.

Tso cov cuab yeej - SKYLAB_SKB369_NANO2_REPLACEMENT.upload thaiv qhia meej tias lub cuab yeej twg siv rau kev rub tawm. Yog tias koj siv Particle Debugger ces siv raws tu qauv = cmsis-dap raws li qhia saum toj no.

Bootloader - Cov kab no zoo ib yam rau txhua lub rooj tsavxwm hauv no boards.txt

Tsim - Tsuas yog ob kab yuav tsum tau hloov kho tshiab hauv qhov thaiv no. SKYLAB_SKB369_NANO2_REPLACEMENT.build.variant kab qhia meej lub rooj tsav xwm no cov npe phau ntawv hauv cov kab ntawv sib txawv. SKYLAB_SKB369_NANO2_REPLACEMENT.build.board yog tus nqi txuas ntxiv rau ARDUINO_ thiab tom qab ntawv txiav txim siab thaum suav cov lej. xws li -DARDUINO_SKYLAB_SKB369_Nano2replacement Qhov no tso cai rau koj qhib/lov tes taw ib feem ntawm cov cai rau cov laug cam tshwj xeeb.

Tsawg Freq Clock - Kab kab no, SKYLAB_SKB369_NANO2_REPLACEMENT.menu.lfclk.lfrc.build.lfclk_flags, qhia qhov tseeb ntawm lub moos tsawg zaus, siv rau lp_timer. Muaj peb qho kev xaiv, -DUSE_LFXO, -DUSE_LFRC thiab -DUSE_LFSYNT. Qhov kev xaiv zoo tshaj plaws yog -DUSE_LFXO, yog lub rooj tsavxwm muaj sab nraud 32Khz siv lead ua. Yog tias tsis yog siv -DUSE_LFRC, uas siv sab hauv RC oscillator thiab kos me ntsis ntxiv tam sim no, ~ 10uA ntau dua, thiab tsawg dua lub sijhawm tsis raug. Tsis txhob siv -DUSE_LFSYNT vim qhov no ua rau lub nti ua haujlwm txhua lub sijhawm ua rau mAs kos tam sim no.

Softdevice - pfod_lp_nrf52 tsuas yog txhawb nRF52 chips thiab softdevice s132 yog li tsis muaj kev hloov pauv xav tau rau qhov thaiv no, tsis yog ua ntej.

Rov kho dua nRF52 NFC pins ua GPIO's

Ua tsis tau zoo ntawm nRF52 tus pin, P0.09 thiab P0.10 tau teeb tsa rau siv ua NFC thiab cia siab tias yuav txuas nrog NFC tus kav hlau txais xov. Yog tias koj xav tau siv cov no raws li lub hom phiaj dav dav I/O pins (GPIO's) tom qab ntawd koj yuav tsum ntxiv qhov txhais, -DCONFIG_NFCT_PINS_AS_GPIOS, mus rau pawg thawj coj ntawd … menu.softdevice.s132.build.extra_flags suav sau cov chaw hauv cov ntawv board.txt.

Piv txwv li pfod_lp_nrf52.zip, rov teeb tsa GT832E_01 tus pin rau siv raws li I/O. Tshooj GT832E_01 rau pawg thawj coj no, hauv cov ntawv boards.txt, muaj cov hauv qab no piav qhia ntxiv

GT832E_01.menu.softdevice.s132.build.extra_flags = -DNRF52 -DS132 -DNRF51_S132 -DCONFIG_NFCT_PINS_AS_GPIOS

Cov ntawv txuas hauv pfod_lp_nrf52.zip kuj tau raug hloov kho kom khaws qhov chaw no thiab tsis tas yuav hloov pauv.

Kauj Ruam 7: Xaus

Cov ntawv qhia no tau nthuav qhia hloov pauv rau Redbear NanoV2 siv SKYLAB SKB369 tus qauv. Lub roj teeb/hnub ci siv Lub Tshuab Ntsuas Kub Kub tau siv ua piv txwv qis zog BLE txoj haujlwm hauv Arduino rau SKYLAB module. Muab cov dej tam sim no ntawm ~ 29uA qhov ua tiav los ntawm kev kho qhov tsis sib txuas. Qhov no ua rau CR2032 npib cell roj teeb lub neej ~ 10 lub hlis. Ntev dua rau cov peev txheej muaj peev xwm ntau dua cov hlwb thiab cov roj teeb. Ntxiv ob lub hnub ci hnub ci pheej yig yooj yim txuas lub roj teeb tau 50% lossis ntau dua. Lub teeb ci hauv chav lossis teeb lub rooj yog txaus los ua lub zog saib xyuas los ntawm cov hnub ci.

Cov ntawv qhia no tseem suav nrog tshem tawm kev tiv thaiv nti los ntawm kev npaj ua ntej nRF52 thiab yuav teeb tsa lub rooj tsav xwm tshiab txhais li cas kom phim koj tus kheej PCB/Circuit

Tsis xav tau Android programming. pfodApp ua haujlwm txhua qhov ntawd.

Pom zoo: