Cool stuff for Raspberry Pi, Arduino and all electronics hobby projects
Notifications
Clear all

[Solved / Archived] Witty Pi3 Rev2 changes itself "State when power connected" from time to time !? ATtiny841 flash bad batch?

4 Posts
2 Users
0 Likes
101 Views
 vita
(@vita)
Posts: 2
New Member
Topic starter
 

We run several Witty Pi3 Rev2 boards, and set all to "Default state when powered" from default off, to on, since they shall power as soon as the 20V battery is attached. Boards are in the field and after maybe weeks and i do not exactly know how many battery attaches it happens that the Witty apparently forgets and falls back to off, which is a problem in our hardware setting. Not all of our boards do that. And i had one which even once powered (as needed) and i cut the battery after 1min, attached it again and then didn't power, ... when i read then the register, it was 0 (so no auto-power), but unfortunately i did not read it the time just before when it did the auto-power...

Recovery Voltage and Low Voltage are both set off (or 255). On one of these nasty candidates the 3V battery measures 3.05V, which is ok i guess and moreover most likely nothing to do with it... as i guess the "default state" is a register in the ATtiny841 flash?

so i suspect the ATtiny flash has production tolerances and their is a chance of errors of hardware, when something is just on the edge off specs it can behave "randomly"...

 

This topic was modified 2 months ago by vita
 
Posted : 29/05/2024 11:45 am
(@admin)
Posts: 371
Member Admin
 

The "Default state when powered" option is, like other options, saved in the EEPROM. If any EEPROM data is lost, or randomly get modified, most probably is due to the previous brown-out (input voltage was too low and MCU worked under-voltage).

Recently we enabled 2.7V B.O.D (brow-out detection) in ATtiny841 by configuring the fuses to E:F5, H:DD, L:E2. I would suggest you to do the same (by flashing the firmware with proper fuse parameters), so brown-out will not corrupt the data in EEPROM again. There is a tutorial for Witty Pi 4 here, and you can do the same for Witty Pi 3.

Latest firmware for Witty Pi 3 can be downloaded from: https://github.com/uugear/Witty-Pi-3/raw/master/Firmware/WittyPi3/WittyPi3.ino.hex

 
Posted : 29/05/2024 11:59 am
 vita
(@vita)
Posts: 2
New Member
Topic starter
 

thanks for the quick reply:)

is the MCU supplied by the 3V battery? if yes, brown out would only happens if battery runs low. if not, we do often "brown outs", since we often cut the 20v battery in normal operation. I just want to estimate the

Posted by: @admin

most probably is due to the previous brown-out

 

, because in my case we have several wittys (distributed at customers) and it is some effort to reflash them all, and i would probably do it if i have a guaranteed solution.

otherwise i'll might change to witty pi4, i do have some here, so question is regarding

Posted by: @admin

Recently we enabled 2.7V B.O.D

 

are these (bought last august) already flashed with the fuses?

 

sorry for being super picky. hopefully understandable, since our customers are running devises the fields and we aim reliability.

 
Posted : 29/05/2024 3:52 pm
(@admin)
Posts: 371
Member Admin
 

Posted by: @vita

is the MCU supplied by the 3V battery?

No, for both Witty Pi 3 and Witty Pi 4, that CR2032 battery only powers the RTC. The MCU only gets power by the power source connected to Witty Pi. Directly cutting power should be fine (although it may be bad to your Pi's SD card). The worst situation would be the battery gets over-discharged and its voltage drops too low, and the MCU has to work undervoltage. B.O.D is there to prevent the MCU to continue working, when the voltage is really low.

Posted by: @vita

are these (bought last august) already flashed with the fuses?

Unfortunately not. Only the newly back-to-stock Witty Pi 4 today (2024.05.29) and onward comes with B.O.D enabled.

 

 
Posted : 29/05/2024 7:43 pm
Join Waitlist We will inform you when the product arrives in stock. Please leave your valid email address below.