Attiny25/45/85 FW Development Thread

So for just $5,500 for a refurbished unit, I too can make these measurements? Smile Hhhhhmmmmmm......

Is Brown Out Detection needed for the memory decay trick? :~

BOD can be disabled in software but I don’t think it can be enabled in software if the fuses are set to BOD disable.

I'm thinking not because it seems to work, least for me...

You can measure down to picoamps with a µCurrent adapter.

Well, actually any volt-nut worth his salt needs three of them… man with two clocks never knows what time it is…

With a little patience, you can probably find a decent used one for less than $3000. I paid around $2400 for each of mine.

Proper calibration will probably set you back $500. I have the equipment to calibrate them (the SR104 10K resistor retails for $10K, you don’t want to know what the Fluke 732A/732B voltage references cost). There is a 3458A on Ebay right now that is up to $2000… calibrated… closes in 3 days.

That device looks cool! Still $66 USD, plus shipping I'm thinking but in a reasonable range. I gotta talk to my EE friends at work - I think they've done this without high end instruments. We got scopes, bench PS's, signal generators, flukes, etc., but don't think we have anything like that bench DMM -- not sure though.

Actually, any decent quality multimeter should be able to read down to micro-amps. I use Tektronix DMM912/914/916 meters. No longer made (?) but usually available on Ebay. With some patience you can probably snag one for less than $100.

seems lime you guys are speaking a totally foreign language lol ,this is way above my pay grade

Ok - think I got the new "n.n" battery status blinking working pretty well, thanks from T_K Wink.

I've partially integrated in her new headers, and tweaked the "n.n" blinking. With the default values for blink timing/rates she had, I really couldn't figure it out. The values I'm using now are more like the blink timing/rate a NiteCore MH20 does on it's switch LED. I took out the period blinking and made the blinks longer/slower. I find it really nice this way. I used the PWM values for voltages T_K had defined, measured by Dale for the wight FET+1 driver. There were only 5 values defined for the original 1-5 blinks, so I filled in all the values in-between for the full 2.0v to 4.4v levels. I tested it on a few cells at various levels and seems to always be within 0.1v. Probably could be tweaked a little but seems very close and reliable.

So far I'm pretty happy with how it's working in the UI - from OFF, do 1 click followed quickly by a click&hold - then the first digit of the volts blinks out (2-4 times), then pauses, then the 2nd digit blinks (0-9 times). This repeats over and over with a 2 sec delay in-between. One click aborts it.

Oops, did I make it do the readout too fast? I tried to make it quick but not too quick, but maybe I went too far?

BTW, if you want to get all the necessary voltage values, simply measure a full cell and an empty cell with battcheck.c, then feed the values into battcheck.py and it’ll spit out ADC values for each 0.1V value. Example input files are in battcheck/readings/*.volts .

It may then require minor tweaking to get things just right, but the values should at least be pretty close.

It’s weird having to offload all floating-point math since the attiny is terrible at it. I’m spoiled by full-featured CPUs where floating point is quick and easy.

Really dunno. Did you test it? The msec values looked really low. Was wondering then if they were actually intended to be in msecs?

I tried it with your values and could not distinguish the blinks from each other. The ratio of 1:4 of ON:OFF doesn't seem appropriate for this type of thing. Dunno if it's just my ol eyes/reaction or what. But I found the MH20 NiteCore really clean - very easy to follow, so sort of modeled the timing after it.

Edit: Nevermind. Think I didn't have the same BLINK_SPEED as you had - I did something wrong. Look'n again at the bistro.c code, you have 500 msecs pauses around the period - that's not how I ran it... Still, I like the way it came out.

Yes, I have it running on a few lights. I found the speed just about right.

The timing I used was…

  • Volts: Repeat (on for 62ms, off for 250ms) a few times.
  • Period: Wait 500ms, blink very briefly, wait 750ms.
  • Tenths: Repeat (on for 62ms, off for 250ms) a few times.
  • Wait 2 full seconds.
  • Start over.

The blink speed is adjustable at the top via a #define.

Ooops, see above Foot in Mouth.

Might have to re-visit your implementation, but for now, I like the way this is look'n.

For those asking/interested, the latest source code for this 45/85 version is posted here:

https://drive.google.com- 25-45-85 stuff

It's in a ZIP file called: eswBrOutCfg10-25.zip

I zipped up the whole solution/project. There's 3 required header files now - they are required to be in the same folder as the main source code file (eswBrOutCfg.c). It requires Atmel Studio 7.0 now to use it as-is. That google drive folder also has the batch files for doing the AVRDude stuff: fuses, dnld, etc. The fuses haven't changed.

Next: expand simple strobe to a bunch of blinky modes.

Mike - this sounds awesome btw! Sounds like you got about everything covered. I haven't looked into this much because of not having a dual switch light to use it on. I recall seeing a thread or post w/details on this mod, but not sure where now. I think

Got more done this eve on adding blinky modes - think the UI is good. Didn't test it yet, but should have a 12.5 Hz strobe, random strobe, police strobe, and 10 sec beacon mode. Can easily add more or pick and choose at compile time now - planning on a config UI for these "special" modes (what I call them).

Also fixed a couple of bugs I noticed in strobe and batt check. You can also now abort from batt check quickly.

Is there a code repository or something I can pull from to get revisions and updates?

This latest is not even dnlded to a driver yet. Hoping a little testing this morn, maybe this eve. Prior vers in post #389.

Update:

The latest source code for this 45/85 version is posted here:

https://drive.google.com- 25-45-85 stuff

It's in a ZIP file called: eswBrOutCfg 10-27.zip

This has the multiple strobe modes, and one 10 sec beacon mode. To access them, simply hold the button til strobe occurs, then simple click to the next, then the next. The selected strobe mode will "lock in" in ~1.2 secs, just like regular modes do. It works pretty well, but I need some sort of delay in-between - hard to tell where you are. There's some other tweaks I need to add, such as navigating to previous mode -- right now only 'next' mode works on a single click. Not much testing (like 2 mins literally), so all subject to change. It's a work-in-progress...

Update: couple of bugs I noticed in this vers:

  • for beacon, instead of being off for 10 secs, it was on moon mode on one occasion (not always)
  • mode lock-in time (~1.2 secs) should work ok in any strobe (special) mode, but instead of returning to previous solid mode, it seems to always go OFF

Oh boy, no responses. If anyone is still interested, latest is now posted in same google drive share as above.

It's in a ZIP file called: eswBrOutCfg 10-28.zip

This now has 3 strobe modes and two beacon modes (i.e. special modes). All 5 of these modes are accessible via the regular way: click&hold til the strobe activates, then click to next, click to next, etc. click&hold to go to previous special mode. A strobe mode will lock-in, just like a regular solid mode, the one click will exit to previous solid mode.

I fixed all known bugs -- all seems to be working as intended so far. It's pretty good. Special modes in order are:

  1. 12.5 hz strobe
  2. Police strobe (same as T_K's)
  3. full bike strobe (also same as T_K's)
  4. 2 sec beacon - 2 flash's every 2 secs (quick flash's)
  5. 10 sec beacon - 2 slow flash's every 10 secs

Need to get in more test time, but think I'll stay with this functionality for now. Anyone who want the source can pretty easily mod these special modes - it's table driven. Most of the rest is configurable thru the UI.

Didn’t you originally mention a random strobe? I meant to look at how you implemented your random.

Looking forward to flashing, thanks Tom.

Hopefully my 85v's will turn up tomorrow so I can get one into a light over the weekend.