Buongiorno.
Devo far andare il SAMD21 con ultracapacitror da 1F.
Mi serve solo che conti un encoder lento sui due input.
Ho fatto come sotto, ma dura solo poche ore.
Ho abbassato tutti gli IO, ma lui consuma ancora troppo.
setup(:
LowPower.attachInterruptWakeup(digitalPinToInterrupt(EncA), EA, CHANGE);
LowPower.attachInterruptWakeup(digitalPinToInterrupt(EncB), EB, CHANGE);
LowPower.attachInterruptWakeup(digitalPinToInterrupt(Vcc), WK, CHANGE); // Congela quandp va via alimentazione
loop()
while(!Vcc_){
LowPower.deepSleep();
delay(10);
}
Poi avrò il problema che quando il cap scende sotto la minima tensione, senza il brownout, la CPU impazzirà.
Il Brownout degli AVR consumava tanto.
Datman
November 13, 2023, 4:34pm
2
V*C=I*T...
Con 1F e un abbassamento di tensione consentito di 0,5V:
T=0,5/I. Quindi, per esempio, con 100uA:
T=0,5/0,1m=5k = 5000s = 1h23m.
Da Aliexpress, però, trovi a pochi soldi condensatori da 10F 5,5V:
https://it.aliexpress.com/item/1005003533642178.html
Adesso consuma 250uA
Dovrebbe consumare 2.8uA
Il BOD solo 0.4uA
con 4uA dovrebbero essere 218 giorni.
C'è qualche periferica attiva che non so.
Ogni tentativo di abbassare il consumo sotto i 130uA ha dato esito negativo.
SPI.end();
Serial.end();
Serial1.end();
SerialUSB.end();
DAC->CTRLA.bit.ENABLE = 0x00; // Disable DAC
ADC->CTRLA.bit.ENABLE = 0x00; // Disable ADC
USB->HOST.CTRLA.bit.ENABLE = 0;
USB->HOST.CTRLA.bit.RUNSTDBY = 0;
// TC->COUNT16.CTRLA.bit.ENABLE = 0;
SERCOM0->SPI.CTRLA.bit.ENABLE = 0;
SERCOM1->SPI.CTRLA.bit.ENABLE = 0;
SERCOM2->SPI.CTRLA.bit.ENABLE = 0;
SERCOM3->SPI.CTRLA.bit.ENABLE = 0;
SERCOM4->SPI.CTRLA.bit.ENABLE = 0;
SERCOM5->SPI.CTRLA.bit.ENABLE = 0;
SERCOM0->USART.CTRLA.bit.ENABLE = 0;
SERCOM1->USART.CTRLA.bit.ENABLE = 0;
SERCOM2->USART.CTRLA.bit.ENABLE = 0;
SERCOM3->USART.CTRLA.bit.ENABLE = 0;
SERCOM4->USART.CTRLA.bit.ENABLE = 0;
SERCOM5->USART.CTRLA.bit.ENABLE = 0;
SERCOM0->I2CM.CTRLA.bit.ENABLE = 0;
SERCOM1->I2CM.CTRLA.bit.ENABLE = 0;
SERCOM2->I2CM.CTRLA.bit.ENABLE = 0;
SERCOM3->I2CM.CTRLA.bit.ENABLE = 0;
SERCOM4->I2CM.CTRLA.bit.ENABLE = 0;
SERCOM5->I2CM.CTRLA.bit.ENABLE = 0;
SERCOM0->I2CS.CTRLA.bit.ENABLE = 0;
SERCOM1->I2CS.CTRLA.bit.ENABLE = 0;
SERCOM2->I2CS.CTRLA.bit.ENABLE = 0;
SERCOM3->I2CS.CTRLA.bit.ENABLE = 0;
SERCOM4->I2CS.CTRLA.bit.ENABLE = 0;
SERCOM5->I2CS.CTRLA.bit.ENABLE = 0;
system
Closed
May 12, 2024, 1:50pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.