#qi-hardware IRC log for Sunday, 2016-04-03

wpwrak(writing to SD-card during system shutdown) you mean to save the time / cap state ? that would go to internal flash. SD would be way too slow and power-hungry06:27
wpwrak(expensive components) please bear in mind that the BOM cost is something < USD 2006:32
wpwrak(xtal sharing) i wish :) long ago i had just one xtal. alas, rfkill means that rf and MCUs each need their own set. maybe 32 kHz could be shared from MCU to RF.06:39
wpwrakfrom sMCU that is06:40
wpwrak(no alarm needed) true, for now there's nothing that actually needs to wake up after some time. but i'd rather keep that option, at least for a while. the idea is that anelok's functionality can evolve.06:44
wpwrakan example: a common defense-in-depth feature would be to erase keys from memory as soon as they time out. so that would require a wakeup.06:45
DocScrutinizer05yet to be seen if IRQ doesn't work at 1.3V15:58
DocScrutinizer05INT actually15:59
DocScrutinizer05I admit I didn't read the friggin datasheet too thoroughly - it was too fuzzy to be any fun to read16:32
DocScrutinizer05a typical case of "get an evaluation board!"16:33
DocScrutinizer05I don't see any special undervoltage circuit being mentioned anywhere in the datasheet, just a pretty clear "if Vbat >Vcc then Vbat  will get directly switched to all the internal power rails of the chip"16:35
DocScrutinizer05so the 1.8V is just a limit for the waranted electrical properties to be in specs16:36
DocScrutinizer05IOW the chips are not tested&binned for any operation conditions outside those specs, but that doesn't mean the chip instantly stops working16:37
DocScrutinizer05undervoltage anyway is inside ABSMAX still ;-)16:38
DocScrutinizer05>> The device is fully accessible through the I2C interface whenever VCC is between 3.6V and 1.8V. I2C operation is not guaranteed when VCC is below 1.8V. The AS1801 maintains the time and date when VCC is as low as 0.9V.<<16:59
DocScrutinizer05anyway watch out! >> The startup time is usually less than 1 second when using a crystal with the specified characteristics.<<17:01
DocScrutinizer05relevant for cold startup17:40
DocScrutinizer05((BOM cost is something < USD 20)) yeah, I know about that BOM problem. A 1 buck more for a supercap is already quite hefty, but on the credit side of balance there are massively improved product specs17:53
DocScrutinizer05anyway you're free to use a dual footprint here for 100uF standard X5R or a 11mF supercap. Possibly your customers will be happy to pay a 5 bucks more for having a decent bat-less grace time17:55
DocScrutinizer05there's also another aspect that's also relevant for the original design with RTC in MCU: users regularly notice it's time for a bat swap  only when device stops or already stopped working. With MCU RTC you already lost time when that happens. With CMOS RTC the time will stay accurate until battery voltage drops below 0.9V, and even then user has 1h minimum time to remove battery and find a fresh one to insert for one minute to 17:59
DocScrutinizer05recharge capacitor17:59
DocScrutinizer05well, not exactly to the point. Should have rephrased "and even then", anyway you get the picture18:00
DocScrutinizer05it's simple enough for hackers to swap the cap at home, DIY18:23
DocScrutinizer05product variants seem feasible too18:25
wpwrak(bat swap) anelok can sense the battery voltage. so it can pretend that it needs replacing a little before it actually does :)19:27
DocScrutinizer05yes, that occurred to me too while writing19:29
DocScrutinizer05the 1 to 10h bat-out time seem a pretty decent selling point to me though19:31
DocScrutinizer05also accuracy of the RTC, compared to any "embedded" solution which is commonly known to be inferior19:32
DocScrutinizer05and last not least the massively less complex software requirements19:34
DocScrutinizer05not even thinking about R&D verification and debugging effort19:41
DocScrutinizer05it's almost impossible for me to list the set of test conditions that need to get verified for the embedded MCU clock design19:43
DocScrutinizer05while for the RTC design such list comes natural since no housekeeping aka "shop closing" needed at all, as well as no time critical stuff during resume/power-up19:44
DocScrutinizer05particularly for the MCU clock design you need to verify the software to be free of any race conditions or deadlocks or other flaws, which most probably can even be proven to be impossible to get done19:48
DocScrutinizer05especially when you have other restrictions too, e.g. transactions that can't or must not get aborted by a NMI19:49
wpwrakif it's power out, pretty much everything can get aborted ;-)19:51
wpwrakanyway, the nice and simple RC solution looks quite sufficient for now. if it should turn out to be trouble, there'll always be time later to try something else. even better, the algorithm can be gradually improved, as needed.19:54
DocScrutinizer05is it possible to abort NAND writes? communication to display?19:59
DocScrutinizer05are NAND writes verified to work during massive Vcc fluctuations?20:00
DocScrutinizer05even when a previous series of NAND writes had to get aborted?20:01
wpwrakyou mean the internal NOR ? no, not really. but they're fast. the display should be gently shut down, says the data sheet. but it doesn't seem to mind unclean shutdowns. otherwise, i'd probably have noticed by now ;-)20:01
DocScrutinizer05what ebout a page erase in progreess? can you abort that and write to flash instead?20:03
DocScrutinizer05are all the routines in your OS reentrant?20:04
DocScrutinizer05none blocking IRQs?20:05
DocScrutinizer05I prolly could go on ad infinitum20:05
wpwraksector erase needs high power for some 13 ms20:06
DocScrutinizer05sure it *can* get done, the question is how reliable it is and how much effort you need to put in to make it reliable and even prove that it is20:06
wpwrakand i try to do that as little as possible, to not wear out the flash. so this means that the probability of a concurrent flash erase at battery removal is basically zero. even if the battery removal results from a fall or such.20:07
DocScrutinizer05when time keeping is of such paramount importance, I'd rather rely on a plain simple hw solution, even when it costs 1.50 more20:07
wpwraktime can get lost. i mean, you can have a stroke while in the midst of battery removal. in fact, that's probably more likely than the scenarios you're dreaming up :)20:08
DocScrutinizer05yes, exactly, and it will happen way more often than you are dreaming up, with a bat-out time of max 30s20:09
wpwrakthe current thing should be good for something like a minute, probably more20:09
DocScrutinizer05I still think such a usage scheme is not feasible without a decent pre-fail signal made from sort of mechanical switch that detects battery removal before it happens20:10
wpwrakand yes, if you don't manage to put in a new battery after all that time (or at least put back the old one), then you'll be greeted by the blinking 00:00 ;-)20:10
DocScrutinizer05that's the minimum needed20:14
DocScrutinizer05also: 20:17
DocScrutinizer05>>BATTERY EMPTY! Needs replacement20:17
DocScrutinizer05You can't use the device for longer than one minute now, soon you can't use it at all.20:17
DocScrutinizer05Please remove the two screws on bottom and open up case, swap battery for a new 1.5V AAA.20:17
DocScrutinizer05**Do not leave device without battery (new or old one) for more than 30s!** <<20:17
DocScrutinizer05also dim or shut down backlight when low battery20:20
DocScrutinizer05((put back old one)) good point I probably hadn't thought about if I was in such situation that the new battery slips away and falls under the desk while swappinng20:24
wpwrakit's an OLED. there is no backlight :)20:30
DocScrutinizer05aaah right20:31
wpwraki can dim it a little, but it's almost imperceptible20:31
DocScrutinizer05the question is if it reduces power consumption20:37
DocScrutinizer05imperceptable? good! :-)20:37
DocScrutinizer05you also want to block all block erases and possibly all "normal" writes during bat-low state20:38
wpwraknaw, a bit of regular nagging should do. most people will ignore it, and have anelok shut down on them, forcing them to get a new battery21:14
wpwrakhowever, those who care are likely to pay attention, and not risk unplanned shutdowns21:15
wpwrakit all depends on the use case. most people can get new batteries quickly, and have access to accurate time. so none of this troubles them overly. many of them will find having to set the time disproportionally inconvenient, though. that's why i'm making an effort to spare them this experience.21:17
wpwrakbut if they still don't cooperate, well, it's their loss :)21:17
wpwrakand then you have the fringe cases. they're important due to their marketing value. if james bond would choose anelok, that gives you a good feeling about it, right ? even if the number of attempts on your life had been fairly low so far21:19
wpwrakso the goal is to maximize that fringe utility without making the thing "expensive" for the rest21:20
DocScrutinizer05makes sense21:25
DocScrutinizer05but by same rationale you should request that users enter a battery change mode before removing battery21:26
DocScrutinizer05btw how is battery change soved mechanically?21:27
DocScrutinizer05solved even21:27
DocScrutinizer05I guess my "two screws" approach above isn't close to reality?21:28
DocScrutinizer05(if it was, it's simple enough to have a pre-fail that fires when case gets opened21:29
wpwrakyes, two screws :) if you look really carefully, you can see them: http://downloads.qi-hardware.com/people/werner/anelok/tmp/case-interim/case-20150714.png21:31
wpwrakjust a bit above the battery, pointing upwards21:31
DocScrutinizer05then how about a button meander on PCB and a patch of cunducting foam on the lid?21:32
wpwrakunproven materials. in any case, i expect power to ramp down slowly in comparison to MCU reaction time21:32
DocScrutinizer05or the other way around: a spring lever (wire) soldered over a hole in PCB and when the notch from lid doesn't press that spring up from PCB surface anymore, it touches surface and closes a contact21:33
wpwraki'll have some 1.3+ V to clean up. even if the initial fall is very quick, the MCU can then shut down stuff and gain time. massively, going from tens of mA (worst case) to tens of uA21:34
DocScrutinizer05or simply have a conductive painting or washer on the lid bolt that holds the screw, and a two patches of plain copper trace next to the hole in PCB. Those get shorted when lid is closed and screwed tight21:35
wpwraknaw, let's keep things simple :) we have caps to give us a bit of time. all that needs to happen is to survive the initial drop, then establish control. after that it's smooth sailing21:36
DocScrutinizer05how much simpler than two traces and a washer can it possibly get?21:36
whitequarktwo patches of trace... that will corrode and become unreliable21:37
wpwrakand chances are the initial drop will be gentle as well21:37
whitequarklike just ambient city air is enough, over a few years, not to mention more humid or more polluted places21:38
whitequarkor god forbid someone use something slightly corrosive nearby21:38
DocScrutinizer05whitequark: I've seen washer and screw contacts to traces since ages, they seem to work reliably21:38
whitequarkI'm really doubtful of the idea, I've seen many purposebuilt connectors based on exposed copper fail21:38
whitequarklike cardedge21:38
DocScrutinizer05tin coating21:38
whitequarkbetter but still bad21:39
whitequarkif you do ENIG plating then the board side should be fine pretty much forever21:39
DocScrutinizer05all sorts of AMP connectors are mounted to PCB exactly that way21:39
wpwrakwhitequark: except if there's that washer, scraping off the gold :)21:40
whitequarkI've never seen a cardedge connector with *tin* coating. I've seen ENIG and some crappier plating21:40
whitequarkand some really cheap ones using bare copper, almost always oxidized and/or corroded21:40
DocScrutinizer05the tin is sufficiently immune to deep corrosion, and the steel washer pierces the surface oxide and makes decent contact21:40
whitequarkpierces it and exposes it to further corrosion?21:40
whitequarkand also puts force on the PCB?21:40
whitequarkI'm not fond of this idea at all21:40
DocScrutinizer05well, it's a proven industry standard since ages21:41
wpwrakthere's almost no cost difference between gold and tin. so for the PCB i'd go for gold. though i'd definitely avoid mechanical interactions.21:41
whitequarkI would want a reference on that washer being "industry standard" :)21:41
whitequarkcardedge yes, but it doesn't use this sort of uncontrolled force21:42
DocScrutinizer05when you go for gold plating, you need a flat washer, not one of those that have teeth21:42
whitequarkand it needs plating on both the contacts and the board21:42
whitequarkhow does a flat washer 'pierce' the oxide?21:42
wpwrak(no difference) as far as PCBs are concerned. of course, it you go by ccm, kilo, or such, then yes, there is ;-)21:42
DocScrutinizer05uncontrolled force??21:42
DocScrutinizer05seems you have a wrong idea of what I had in mind21:42
whitequarkyes. compared to e.g. the springs in a cardedge receptacle21:43
whitequarkspringy contacts, I mean. those have a force that is limited by design21:43
whitequarkwhereas if you have a screw, the force is only limited by impatience of whoever's screwing it down21:43
DocScrutinizer05you're mixing up three things now, do you?21:43
whitequark< DocScrutinizer05> or simply have a conductive painting or washer on the lid bolt that holds the screw, and a two patches of plain copper trace next  to the hole in PCB. Those get shorted when lid is closed and screwed tight21:44
whitequarkgoing off just this one suggestion21:44
DocScrutinizer05so what? this is pinching the PCB between two solid points, not bending it21:44
DocScrutinizer05it can prolly withstand a ton of force like this, per cm^221:45
whitequarkokay, that's true. but I still don't see how a flat washer would defeat the oxide layer21:45
DocScrutinizer05which oxide layer? AuO2?21:46
whitequarkif we're going with ENIG then your idea works, yes21:46
whitequarkthe washer should also have a good plating21:46
whitequarknickel probably works, or even a pure nickel washer21:47
DocScrutinizer05nickle will do21:47
DocScrutinizer05which basically is all washers you ever seen21:47
wpwraki'll trust the caps :) i have some 60 uF sitting there. you can't empty that fast enough to make the low voltage interrupt come too late. then, a few us later, lots of things will get shut down and stop drawing power21:47
wpwrakat that time the MCU will still be some ~1 V above minima. it could now calculate the remaining digits of Pi, find a cure for cancer, or whatever MCUs do when they're really bored and in absolutely no hurry :)21:48
DocScrutinizer05frequently used on PCB with tin coating and tooth washer and screw+nut22:08
DocScrutinizer05since literally a century almost22:09
DocScrutinizer05often found integrated into standard PCB mounting: http://www.mikrocontroller.net/attachment/281300/zu-wenig-kleber.JPG22:10
DocScrutinizer05https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSyd6fj30YOKEDmsTfA4rCQ78J8R_Z5dVP0396Wtg-IX393utcNf-bwCw washer22:12
DocScrutinizer05with ENIG you want something like this https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQPyquu2W2XtDJ7ekZrlb-WuKqv7gwppGxz4BKLUbSprj5CYfTsSdDa6Q22:16
DocScrutinizer05or this https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS2aNedoP77wt18lquJjbp96Q6eeeGVEoYT8WXKKc72toIjeMJ8avCJng_KCg22:18
DocScrutinizer05you could even have two simple contact rings around the two screw holes in PCB, paint a conductive trace from one screw holding bolt to the other on lid, and use two of those https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQVplFjWtXVFZgDeO8QfEs4q-5Pn-jf-B6MzKp4GY9M6FCRFic0uIDuNsdpOA22:20
DocScrutinizer05maybe you want to spraypaint the lid resp lower part of case with conductive paint anyway, to improve shielding22:21
DocScrutinizer05from inside22:21
DocScrutinizer05I heard case is made of acrylic and painted from inside anyway. Graphite paint would come to mind22:22
DocScrutinizer05since we're talking several 100s of kOhm here anyway, for a normally-closed sensor, any such graphite paint and plain flexible/spring washers on both mounting holes would do22:24
DocScrutinizer05you want one anyway, for grounding the shielding ;-)22:24
DocScrutinizer05use the second for sensor instead of yet another grounding point22:24
DocScrutinizer05BOM: zilch22:26
DocScrutinizer05well, maybe two washers a 0.3ct22:26
DocScrutinizer05which you want anyway for grounding the shielding22:27
whitequarkgraphite paint, for particles to flake off and introduce faults22:31
whitequarkplanned obsolescence at its finest!22:31
DocScrutinizer05there's different kinds of grapphite spray, the one without binder to deposit loose graphite, and the one with binder to stay and act as shielding, explicitly mentioned as one of the primary usecases22:39
DocScrutinizer05if you don't like black graphite, use silver alu 22:39
DocScrutinizer05but yes, on *flexible* surfaces like rubber mats, all those sprays perform very poorly22:40
DocScrutinizer05particularly when you apply too much of the spray22:41
DocScrutinizer05ever wrote with a paint marker on a balloon? it's absolutely water and wipe resistent - until you deflate the balloon22:42
DocScrutinizer05((rubber mats)) I talk from own experience22:44
whitequarkah, didn't know about the one with binder22:46
whitequarkthose seem alright but labor intensive to apply22:46
DocScrutinizer05when you're ever going to fix an appliance remote control rubber mat, use a bin or cup to spray the graphite in, then take a fine brush and only gently paint the contact spots on the mat22:46
DocScrutinizer05((labor intensive)) well, very similar to any spray paint22:47
DocScrutinizer05OT: #panamapapers  LOL22:48
--- Mon Apr 4 201600:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!