Cov txheej txheem:

Txo Kev Siv Roj Teeb Rau Digispark ATtiny85: 7 Cov Kauj Ruam
Txo Kev Siv Roj Teeb Rau Digispark ATtiny85: 7 Cov Kauj Ruam

Video: Txo Kev Siv Roj Teeb Rau Digispark ATtiny85: 7 Cov Kauj Ruam

Video: Txo Kev Siv Roj Teeb Rau Digispark ATtiny85: 7 Cov Kauj Ruam
Video: tuav wb lub neej kom ruaj khov - Mang Vang ft. Christina Xyooj [Official Audio] 2021-22 2024, Hlis ntuj nqeg
Anonim
Txo Kev Siv Roj Teeb Rau Digispark ATtiny85
Txo Kev Siv Roj Teeb Rau Digispark ATtiny85
Txo Kev Siv Roj Teeb Rau Digispark ATtiny85
Txo Kev Siv Roj Teeb Rau Digispark ATtiny85

lossis: Khiav Arduino nrog 2032 npib cell rau 2 xyoos.

Siv koj li Digispark Arduino Board tawm ntawm lub thawv nrog Arduino program nws rub 20 mA ntawm 5 volt.

Nrog 5 volt power bank ntawm 2000 mAh nws yuav tsuas yog siv rau 4 hnub.

Kauj Ruam 1: Txo Cov Khoom Siv Hluav Taws Xob los ntawm Kev Siv LiPo Roj Teeb

Txo Cov Khoom Siv Hluav Taws Xob los ntawm Kev Siv LiPo Roj Teeb
Txo Cov Khoom Siv Hluav Taws Xob los ntawm Kev Siv LiPo Roj Teeb

Siv lub roj teeb LiPo nrog 3.7 volt raws li muab koj li Digispark pawg thawj coj kos tsuas yog 13 mA.

Nrog roj teeb ntawm 2000 mAh nws yuav ua haujlwm rau 6 hnub.

Kauj ruam 2: Txo CPU moos

Yog tias koj tsis siv USB txuas, lej hnyav lossis pov npav nrawm hauv koj qhov haujlwm, txo lub moos nrawm. Piv txwv li hnyav pov npav infrared tau txais lub tsev qiv ntawv IRMP khiav zoo ntawm 8 MHz.

Ntawm 1 MHz koj Digispark thim 6 mA. Nrog roj teeb ntawm 2000 mAh nws yuav ua haujlwm rau 14 hnub.

Kauj Ruam 3: Tshem tawm ntawm Lub Rooj Tswjhwm Saib Lub Hwjchim LED thiab Lub Hwjchim Tswj Lub Hwjchim

Lov tes taw lub zog LED los ntawm kev tawg cov tooj liab uas txuas lub zog LED rau lub diode nrog rab riam lossis tshem tawm / lov tes taw 102 resistor.

Txij li thaum koj tab tom siv lub roj teeb LiPo tam sim no, koj tseem tuaj yeem tshem tawm cov tswj hwm lub zog IC. Ua ntej nqa cov pins sab nraud nrog kev pab ntawm cov hlau txuas thiab tus pin. Tom qab ntawd muab lub tshuab txuas txuas loj thiab tshem tus tswj hwm. Rau cov tswj hwm me me, siv cov laug ntau thiab ua kom sov tag nrho 3 tus pin ua ke, tom qab ntawd tshem nws.

Ntawm 1 MHz thiab 3.8 volt koj Digispark tam sim no kos 4.3 mA. Nrog roj teeb ntawm 2000 mAh nws yuav ua haujlwm rau 19 hnub.

Kauj Ruam 4: Tshem Tawm USB D- Pullup Resistor (cim 152) Los ntawm 5 Volt (VCC) thiab Txuas Rau USB V+

Disconnecting USB D- Pullup Resistor (cim 152) Los ntawm 5 Volt (VCC) thiab Txuas Rau USB V+
Disconnecting USB D- Pullup Resistor (cim 152) Los ntawm 5 Volt (VCC) thiab Txuas Rau USB V+

Qhov kev hloov kho no tau sib xws nrog all1.x versions ntawm micronucleus bootloader. Yog tias koj twb muaj 2.x bootloader tshiab ntawm koj lub rooj tsavxwm, koj yuav tsum hloov kho rau ib qho 2.5 version nrog "activePullup" hauv nws lub npe. Txoj hauv kev yooj yim tshaj plaws los ua qhov no, yog txhawm rau teeb tsa pob tshiab digispark thiab hlawv lub bootloader nrog pom zoo (!!! tsis yog lub neej ntawd lossis txhoj puab heev !!!) version.

Ua txhaum cov hlau tooj liab nyob ntawm ib sab ntawm tus tiv thaiv uas taw rau ATtiny qhov no ua rau USB cuam tshuam thiab tig mus ua txoj haujlwm rau Digispark board ntawm USB. Txhawm rau kom nws rov zoo dua, tab sis tseem txuag lub zog, txuas tus tiv thaiv (cim 152) ncaj qha rau USB V+ uas yooj yim muaj nyob rau sab nraud ntawm shottky diode. Lub diode thiab nws sab raug tuaj yeem pom los ntawm kev siv lub ntsuas ntsuas txuas ntxiv. Ib sab ntawm cov diode no txuas nrog tus pin 8 ntawm ATtiny (VCC) thiab Digispark 5V. Lwm sab txuas nrog USB V+. Tam sim no USB rub tawm tus neeg tawm tsam tsuas yog ua haujlwm yog tias Digispark pawg thawj coj saib txuas nrog USB xws li thaum lub sij hawm programming.

2 cov kauj ruam tom kawg kuj tau sau tseg ntawm no.

Ntawm 1 MHz thiab 3.8 volt koj li Digispark tam sim no kos 3 mA. Nrog roj teeb ntawm 2000 mAh nws yuav ua haujlwm rau 28 hnub.

Kauj Ruam 5: Siv Kev Pw Tsaug Tsis Siv Sijhawm ()

Siv pw tsaug zog Tsis txhob ncua ()
Siv pw tsaug zog Tsis txhob ncua ()

Hloov chaw ncua ntev koj tuaj yeem siv lub zog txuag CPU pw. Kev pw tsaug zog tuaj yeem ntev li ntawm 15 milliseconds mus rau 8 vib nas this hauv cov kauj ruam ntawm 15, 30, 60, 120, 250, 500 milliseconds thiab 1, 2, 4, 8 vib nas this.

Txij li lub sijhawm pib los ntawm kev pw tsaug zog yog 65 milliseconds nrog lub Hoobkas digispark fuse teeb tsa, tsuas yog qeeb qeeb dua 80 ms tuaj yeem hloov pauv los ntawm kev pw tsaug zog.

Thaum pw tsaug zog koj Digispark thim 27 µA. Nrog 200 mAh khawm cell 2032 nws yuav pw tau 10 lub hlis.

Yuav kom raug, Digispark yuav tsum tsawg kawg sawv txhua txhua 8 vib nas this, khiav tsawg kawg 65 milliseconds thiab kos ib ncig 2 mA tam sim no. Qhov no ua rau qhov nruab nrab tam sim no ntawm 42 µA thiab 6 lub hlis. Hauv qhov xwm txheej no nws yuav luag tsis muaj qhov sib txawv yog tias koj qhov program khiav rau 10 milliseconds (txhua txhua 8 vib nas this).

Txoj cai siv pw tsaug zog yog:

#suav nrog #suav nrog qhov hloov pauv uint16_t sNumberOfSleeps = 0; sab nrauv hloov pauv tsis tau kos npe ntev millis_timer_millis; teeb tsa tsis muaj dabtsis () {sleep_enable (); set_sleep_mode (SLEEP_MODE_PWR_DOWN); // deepest sleep mode…} void loop () {… sleepWithWatchdog (WDTO_250MS, muaj tseeb); // pw tsaug zog rau 250 ms… sleepWithWatchdog (WDTO_2S, muaj tseeb); // pw tsaug zog rau 2 s…}/ * * aWatchdogPrescaler tuaj yeem yog 0 (15 ms) txog 3 (120 ms), 4 (250 ms) mus txog 9 (8000 ms) */ uint16_t computeSleepMillis (uint8_t aWatchdogPrescaler) {uint16_t tResultMillis = 8000; rau (uint8_t i = 0; kuv txuag 200 uA // siv wdt_enable () vim nws ua haujlwm tias WDP3 me ntsis nyob hauv ntsis 5 ntawm WDTCR sau npe wdt_enable (aWatchdogPrescaler); WDTCR | = _BV (WDIE) | _BV (WDIF); // Watchdog cuam tshuam pab + rov pib cuam tshuam tus chij -> xav tau ISR (WDT_vect) sei (); // Pab cuam tshuam cuam tshuam sleep_cpu (); // Tus saib xyuas cuam tshuam yuav ua rau peb sawv los ntawm kev pw tsaug zog wdt_disable (); // Vim tias kev cuam tshuam tom ntej yuav tsis yog ua rau rov pib dua, txij li wdt_enable () teeb tsa WDE / Watchdog System Reset Enable ADCSRA | = ADEN; / * * Txij li lub sijhawm timer yuav raug xiam oob qhab millis tsuas yog tsis tau pw hauv hom IDLE (SM2… 0 khoom yog 000) * / yog (aAdjustMillis && (MCUCR & ((_BV (SM1) | _BV (SM0))))! = 0) {millis_timer_millis += computeSleepMillis (aWatchdogPrescaler);}} / * * Qhov kev cuam tshuam no ua kom lub cpu tsaug zog * / ISR (WDT_vect) {sNumberOfSleeps ++;}

Kauj Ruam 6: Hloov Kho Fuses

22 mA ntawm 27 mA tau kos los ntawm BOD (BrownOutDetection/undervoltage detection). BOD tuaj yeem tsuas yog xiam oob qhab los ntawm kev rov sau dua cov fuses, uas tsuas tuaj yeem ua tiav nrog ISP programmer. Siv tsab ntawv no koj tuaj yeem txo tam sim no mus rau 5.5 µA thiab tseem txo lub sijhawm pib los ntawm kev tsaug zog mus rau 4 milliseconds.

5 ntawm qhov seem 5.5 µA tau kos los ntawm cov neeg saib xyuas nquag siv. Yog tias koj tuaj yeem siv rov pib dua sab nraud kom sawv, tam sim no kev sib koom ua ke tuaj yeem nqes mus rau 0.3 µA raws li tau hais hauv daim ntawv teev npe.

Yog tias koj tsis tuaj yeem ncav tus nqi no, qhov laj thawj tuaj yeem yog, qhov rov qab tam sim no ntawm schottky diode ntawm VCC thiab rub tawm siab dhau. Nco ntsoov tias 12 MOhm resistor tseem rub 0.3 µA ntawm 3.7 volt.

Qhov no ua rau kwv yees tam sim no noj ntawm 9 µA (2.5 xyoos nrog 200 mAh khawm cell 2032) yog tias koj piv txwv li. txheej txheem cov ntaub ntawv txhua 8 vib nas this rau 3 milliseconds zoo li ntawm no.

Kauj Ruam 7: Cov Lus Qhia Ntxiv

Tam sim no daim duab ntawm Digispark board.

Qhov project siv cov lus qhia no.

Pom zoo: