Attiny25/45/85 FW Development Thread

1901 posts / 0 new
Last post
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 7 hours 20 min ago
Joined: 01/12/2013 - 14:40
Posts: 6411
Location: (469219) 2016 HO3

Hmm… The C20 has a weird nylon retainer / spring setup, while both the X6R and L4 look like they’ll need the driver piggybacked. None seem ideal. But all I really need for development is a simple tube light head and some extruded parts set up for easy access. The host is more for testing real-world use later in the process.

What would be really cool is a Roche F6 with a switch in the tail instead of a glass breaker. Of course, that also would require a special driver due to the way the switch is handled… like, a derivative of Helios’ driver.

pilotdog68, I think the attiny13a might be able to handle a dual-PWM ramping firmware with the ability to use a tail switch for momentary tactical purposes. No mode groups, but you’d have quick access to virtually every possible level. Would this work? (I’ve been meaning to make one of those, but don’t yet have a FET+1 with an e-switch)

Tom E
Tom E's picture
Offline
Last seen: 12 hours 52 min ago
Joined: 08/19/2012 - 08:23
Posts: 10823
Location: LI NY

pilotdog68 wrote:
I got it during the 8/25 sale

Ahh, missed that... Could be the Crelant 2015 version has some internal design changes, maybe. Jack's review was back in 2013. I'm thinking though they only changed the LED to XM-L2.

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6352
Location: Held against my will in IOWA, USA

Ramping isn’t my thing personally, but I’ll be very interested in whatever you come up with. The more options we have for dual-switch lights the better.
.
.
I’m just worried all the cool kids are going to move on to the big mcu’s and I’ll be sitting here in the dirt with my 13’s :bigsmile:

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6352
Location: Held against my will in IOWA, USA

Tom E wrote:

pilotdog68 wrote:
I got it during the 8/25 sale

Ahh, missed that… Could be the Crelant 2015 version has some internal design changes, maybe. Jack’s review was back in 2013. I’m thinking though they only changed the LED to XM-L2.


I ordered the one that said 2015 version because it looked like the side button didn’t stick out an obnoxious amount (like some others did).

Even from Store.Crelant.com the price is only ~$25, so I’m not sure if they’re “fake” crelants or not. I’m just hoping the quality is as good as Jack’s sample was. They shipped e-packet, so hopefully it will come quickly. If been saving my Nichia 219c for it.

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 7 hours 20 min ago
Joined: 01/12/2013 - 14:40
Posts: 6411
Location: (469219) 2016 HO3

Tom E wrote:
Check out my X6R mod details in post #78 here: http://budgetlightforum.com/node/38998. It’s a fwd clicky tail switch and is now running my e-switch/NOINIT combo on a 25.

Oh, I totally missed that. It looks like all the hard parts (figuring out what to do) are done! I should probably go for the X6R as a host instead. Smile

The X6R definitely looks like a nicer host overall… and having the switch built in to the piggyback setup would make testing easier. Plus having the charge circuit and indicator LEDs continue working after the mod is an unexpected bonus.

I feel like a fish, flip-flopping around so much today.

vestureofblood
vestureofblood's picture
Offline
Last seen: 2 days 5 hours ago
Joined: 08/17/2012 - 15:21
Posts: 1481
Location: Missouri

Tom E wrote:

ToyKeeper wrote:
Thanks! Both the EE X6R and UF-C20 look like good hosts for this. The X6R has a bonus of built-in indicator lights (though I don't think there will be any spare pins to drive them), while the C20 is smaller and uses e-switch wires, and specs of its innards are published in JackCY's review. Edit: I can't tell what size the EE X6R driver is; looks like 20mm. I think it might have the switch onboard though, with a custom-fit driver, so it might need a smaller driver piggybacked onto it like how this Convoy L4 moddid it. If I understand correctly, I think the pins will be...
reset18VCC
OTC27Voltage ADC
e-switch36PWM 1 (FET)
GND45PWM 2 (7135)

(I think pins 2 and 3 can be swapped, but both will be needed) So, no room for indicator lights. But plenty of code space for extra modes and options. :)

Check out my X6R mod details in post #78 here: http://budgetlightforum.com/node/38998. It's a fwd clicky tail switch and is now running my e-switch/NOINIT combo on a 25.

 



Hi Tom,
I am just curious of you got the PM I send you on 8/24/15 or not?

In Him (Jesus Christ) was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not.
http://asflashlights.com/ Everyday Carry Flashlights, plus Upgrades for Maglite.

ImA4Wheelr
Offline
Last seen: 12 hours 10 min ago
Joined: 02/03/2013 - 14:51
Posts: 7444
Location: SC

TK, the F35 is pretty a sweet little light.  The host may still be on sale for $15.  There is a ton of space in the driver compartment.  You would just need to rig up something to hold the momentary switch.  You could use plastic, wood, copper, sugru, etc.

 

I wouldn't use a long post switch like below.  Just stuck it in there to get the concept across.

Tom E
Tom E's picture
Offline
Last seen: 12 hours 52 min ago
Joined: 08/19/2012 - 08:23
Posts: 10823
Location: LI NY

vestureofblood wrote:

Hi Tom,
I am just curious of you got the PM I send you on 8/24/15 or not?

Yes, sorry, been tied up - no progress. I'll pm you today, later.

RMM
RMM's picture
Offline
Last seen: 5 hours 12 min ago
Joined: 07/23/2013 - 13:47
Posts: 3985
Location: USA

Hey guys, I finally got an AVR Dragon so I can do HV programming.  If any of you have bricked chips you want reset you can send them to me and I'll try and fix them for you (no cost, just shipping).  

I've got a few more projects to get out of the way then I'm going to flash my beta firmware from a month or so ago and see if it actually works...it built then, but I never had a chance to try it.  

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6352
Location: Held against my will in IOWA, USA

Which variants of the Attiny45 and 85 are you using? Are they the same package size? I’m going to see if I can fit one of them on my new driver

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Halo...
Halo...'s picture
Offline
Last seen: 1 year 2 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

Attiny45 and 85 are only available in a wider package. But by bending the legs under, it can be made to fit on board meant for attiny13.

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6352
Location: Held against my will in IOWA, USA

I was going to see if I could fit the pads so you wouldn’t have to bend the legs

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

RMM
RMM's picture
Offline
Last seen: 5 hours 12 min ago
Joined: 07/23/2013 - 13:47
Posts: 3985
Location: USA

Here's what I would lovingly call a "ghetto mod" 17mm FET + 7135 driver.  It's rough around the edges, but it should work for those of you who are early adopters.  Still lots of edge clearance.  

Oshpark Link.

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6352
Location: Held against my will in IOWA, USA

So which package size did you use, Richard?

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

RMM
RMM's picture
Offline
Last seen: 5 hours 12 min ago
Joined: 07/23/2013 - 13:47
Posts: 3985
Location: USA

That's the SU instead of SSU.  Longer legs, same pin pitch, and room for a much wider body as well.  

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

Tom E
Tom E's picture
Offline
Last seen: 12 hours 52 min ago
Joined: 08/19/2012 - 08:23
Posts: 10823
Location: LI NY

Ahhh, cool!! Thanks Richard! I gotta order some - do you think it's fairly low risk, meaning good shot at working well?

RMM
RMM's picture
Offline
Last seen: 5 hours 12 min ago
Joined: 07/23/2013 - 13:47
Posts: 3985
Location: USA

Yeah I think it's low risk for functionality, but high risk for being ugly.  Good thing is that nobody will see that side. Wink

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

ImA4Wheelr
Offline
Last seen: 12 hours 10 min ago
Joined: 02/03/2013 - 14:51
Posts: 7444
Location: SC

^ Nice to see this board RMM.  The pad for MCU Pin 1 looks really close to the FET gate pad.  Seems like solder may bridge the two pads.

RMM
RMM's picture
Offline
Last seen: 5 hours 12 min ago
Joined: 07/23/2013 - 13:47
Posts: 3985
Location: USA

The Oshpark render looks tighter than it is. It is close, but not that close.

Mountain Electronics : batteries, Noctigon, and much more! What's new? 

Helios-
Helios-'s picture
Offline
Last seen: 1 year 2 months ago
Joined: 01/18/2012 - 21:12
Posts: 2099

I created a 17mm mosfet +1 7135 meant for attiny13/ 25/ 45/ 85 (150mil / 208mil). It should have clearance for a programing clip. I’m planning to order a set to test out, then I’ll be happy to share it on oshpark.

LFPAK56 mosfet (for the popular NXP PSMN3R0-30YL), 0805 pads, small pin3 pad for an e-switch, OTC. Could also be used for e-switch + tail clicky lights like the EagleEye X6R.


Counterfeit 18650s, 2,<a href=“http://

Tom E
Tom E's picture
Offline
Last seen: 12 hours 52 min ago
Joined: 08/19/2012 - 08:23
Posts: 10823
Location: LI NY

Just ordered the 3 min for now. Hoping the 25's will be enough memory anyway, but you never know til you start adding. Just hate to waste time trying to save every byte - been there, done that years ago, back in the Z-80 days.

 Haven't started yet on expanding modes and config options, but I much prefer an e-switch for doing an advanced UI, and so far, the timing at 8 Mhz is dead on and needs no calibration.

 I gotta look into the benefits/features of the ATMEL AVR Dragon. Richard - I should just send you the 10-12 bricked 13's I have though - I will probably have no need for them anyway.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 7 hours 20 min ago
Joined: 01/12/2013 - 14:40
Posts: 6411
Location: (469219) 2016 HO3

Tom E wrote:

Hoping the 25’s will be enough memory anyway, but you never know til you start adding. Just hate to waste time trying to save every byte – been there, done that years ago, back in the Z-80 days.


Aww… but that’s half the fun! It’s like sudoko, or haiku, or trying to say something meaningful on twitter.

I figure nearly everything important can probably fit onto an attiny25v, though it’ll still need different firmwares for different types of lights or different styles of interfaces. And the attiny85v can probably fit nearly everything into one build.

But for some other projects, I’m using an ATmega32U4. Like, modding the firmware on a new keyboard.io whenever it shows up. Aside from basic stuff like modifying the keyboard layout, I think I can also make it run my old “water” demoscene effect on the keyboard LEDs. Only 64 pixels, but each one is individually-addressable with an RGB value. Partial derivative vector calculus computed at each keystroke! Smile

Tom E
Tom E's picture
Offline
Last seen: 12 hours 52 min ago
Joined: 08/19/2012 - 08:23
Posts: 10823
Location: LI NY

All sounds good! Yikes, done a few things with pixel addressable displays a ways back too - financial systems with those old style big board displays, early early rev. RGB graphics controllers. Worked on a few 2D graphic plotting systems as well with actual line drawing built-in!

Gotta go open up my BLF Manker A6's - just got a 3D and 5A in today. The 3D so far looks good - came apart easy at the threads. The threads and tube look good so far, boxes are excellent. Very hard to tell % wise what the real deal is - lots of issues reported, but who knows if it's common or 1 out of 50, or how bad the issues really are. I'm not too concerned - I really bought them just to see it all come together, and how it fairs, first hand. BLF is really breaking some new ground with this GB. I was never found of the A6 style host itself. Had a couple early ones, before Convoy sold them - wasn't happy with working with them, but that could have changed - was my early days of modding too Wink.

Mike C
Mike C's picture
Offline
Last seen: 3 days 11 hours ago
Joined: 01/22/2014 - 08:03
Posts: 1673
Location: Sweden

Just back from my one month computer-less vacation, not read through everything here so you might all be set by now…

I have working firmware for the 85 (I use the 85V 10SU version), but it’s not really sharable as it’s for my own specific driver design that uses different pins for everything. While I was gone my new driver board came from OSH Park where I’ve done some major changes I need to test before making available. Sharing one without the other is a little pointless because it’s all based on different pins, and I still have an 84 based project I want to complete.

I haven’t yet used the temp sensor on the 85, but I have on the 84. Seems to be reliable enough for overheating protection, providing you don’t need to be totally precise on the temperature. I’ll be setting mine with a margin for error. Once I’ve got the new 85 design built with components I will make the necessary adjustments and try it out. Registers are different between the 84 and 85, so I’ll need to tweak a few things.

On the 84 I’ve done some testing with a temperature controlled mode, meaning that the light gradually fades as the temp rises, trying to stick around an average temperature. I just did some quick testing, I’m not sure it’s worth the hassle completing. As mentioned earlier in this thread the temp characteristics of each light are so different that there would have to many calibration variables to actually be useful in any other light that the light it’s developed on.

I did read early on in this thread about the need for calibration and why not just stick to the turbo timer. Well, the turbo timer can be reset repeatedly offering no real temperature protection. I’ll still be using turbo timers but will be having an additional temperature controlled step down that can not be overridden by mode changes or turning it off. I’ve had a light almost start a fire in my backpack, so I know they can get pretty darn hot.

In some other thread (I think STAR) someone asked about holding the switch during start-up for hidden functions. I don’t know if that got answered, but I’m doing this on all my 84 and 85 based projects to access hidden features and mode programming stuff. However, I don’t use pin interrupts as I’ve seen on STAR versions. I run the WDT interrupt at the highest speed and check if the switch is pressed just as I’d check the voltage on the cap for startup or the battery level in the while(1) loop. It makes the logic so much easier.

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6352
Location: Held against my will in IOWA, USA

Here is my first entry into the Attiny85 crowd. It’s built specifically for the Eagle Eye X6R (That’s why those three big vias are there), but I don’t see why it wouldn’t function in any other 20mm application. I’ll share the actual oshpark link once it’s completely finished.

Quote:
First draft.

All it should need is for the pin size/location to be dialed in and adjust the ground ring around them.

- Single-sided FET+1*7135
- Footprint for ATTINY85V-10SU
- Same pinout as usual
- Maintained at least 1mm “keepout” around the outside
- 2.2mm drill pass-through for LED+ (also standard LED+ pad)
- Pin3 Pad and series resistor (to connect to the X6R charging circuit so the MCU knows when USB is connected)
- Pad for resistor on FET between PWM and GND


My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 7 hours 20 min ago
Joined: 01/12/2013 - 14:40
Posts: 6411
Location: (469219) 2016 HO3

Mike C wrote:
On the 84 I’ve done some testing with a temperature controlled mode, meaning that the light gradually fades as the temp rises, trying to stick around an average temperature. I just did some quick testing, I’m not sure it’s worth the hassle completing. As mentioned earlier in this thread the temp characteristics of each light are so different that there would have to many calibration variables to actually be useful in any other light that the light it’s developed on.

In some other thread (I think STAR) someone asked about holding the switch during start-up for hidden functions. I don’t know if that got answered, but I’m doing this on all my 84 and 85 based projects to access hidden features and mode programming stuff. However, I don’t use pin interrupts as I’ve seen on STAR versions. I run the WDT interrupt at the highest speed and check if the switch is pressed just as I’d check the voltage on the cap for startup or the battery level in the while(1) loop. It makes the logic so much easier.

I don’t have hardware yet, but the plan I’m going with is to let the user calibrate the temperature cutoff. Basically, run in turbo and save the temperature value every second or so, until the user turns the light off or presses the e-switch. From then on, that value will be what it uses as a maximum temperature. I think this will be an easy and effective way to make it work for different lights and different preferences.

As for the switch, I’ve also been planning to ditch the switch interrupt, because it takes a bunch of extra room and seems to make the code very fragile. We don’t exactly have a proper threading library on the attiny… so, I had also planned to go the WDT route.

But I’m starting with clicky-switch code and a small attiny25. E-switch stuff will have to happen later.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 7 hours 20 min ago
Joined: 01/12/2013 - 14:40
Posts: 6411
Location: (469219) 2016 HO3

pilotdog68 wrote:
Here is my first entry into the Attiny85 crowd. It’s built specifically for the Eagle Eye X6R …

Ooh, nice! I’ll probably want one. Smile

It’d be a lot nicer than drilling holes through a 17mm driver… please update with progress as events unfold!

Mike C
Mike C's picture
Offline
Last seen: 3 days 11 hours ago
Joined: 01/22/2014 - 08:03
Posts: 1673
Location: Sweden

Here is my 85 driver board I got home while I was away. The rather radical changes I made are that I’ve put the OTC, voltage divider and E-switch all on the same pin. The idea is that the voltage divider resistors will be of large enough values so that R2 also acts as a bleed resistor for the OTC, and as the OTC is on the same pin it will be constantly charged by the BAT+ input. Voltage readings should be normal except when the E-switch is pressed. I don’t know if I can get this to work, but I just have to try. Why? Because I want to use my smooth adjustable output level of any amount of AMC7135s on up to 7 on constant current with an additional single AMC7135 for PWM between, and also have a FET for turbo/boost mode. I’m doing this on the 84 and love it, so this is an experiment to see if it can be done on the limited amount of pins that the 85 has.

I actually managed to squeeze in a total of 10 x AMC7135s, but don’t know if it will be too tight to be able to flash the MCU, so I put those two additional ones next to the pins of the MCU so they are the ones to go if it’s too tight with 10.

No spring as I will bridge with stiff copper wire with vias on each end of the MCU, and the MCU needs folded legs. Resistors and caps are 0603 size. Ground tabs on the AMC7135s need to be cut off a little, as does the PSMN3R0-30YLD FET, and made custom Eagle parts for these cut parts. No other way to fit all this stuff on a 17mm board otherwise.

No idea if this will work at all. It’s just an idea I have to try… It is a hobby after all…

Edit: Removed images, new version in the pipeline…

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 7 hours 20 min ago
Joined: 01/12/2013 - 14:40
Posts: 6411
Location: (469219) 2016 HO3

Mike C wrote:
Here is my 85 driver board … I’ve put the OTC, voltage divider and E-switch all on the same pin. … smooth adjustable output level of any amount of AMC7135s on up to 7 on constant current with an additional single AMC7135 for PWM between, and also have a FET for turbo/boost mode.

Mad science, I tell you. Mad!

Wight tried something similar, and it was pretty cool. It seems like a simple FET+1 covers most of the functionality though, without the need for extra 7135 channels. Beyond that it’s kind of diminishing returns, with the extra 7135 channels getting used only for like one mode each. On the BLF A6, here is how the two channels are powered for evenly-spaced modes:

The modes are:

Group 1 7135 power FET power
Moon 0.8% 0
Low 8% 0
Med 1 43% 0
Med 2 100% 2.7%
High 1 100% 22%
High 2 100% 54%
Turbo 0 100%
Group 2 7135 power FET power
Low 8% 0
Med 90% 0
High 100% 35%
Turbo 0 100%

Extra channels would improve the modes labelled “High”, and maybe “Med 2”, but aren’t really needed for the rest.

I’m very curious to see if you can get the combined voltage/otc/e-switch pin to work though. Combining any two of those would help quite a bit with opening pins for other purposes.

DavidEF
DavidEF's picture
Offline
Last seen: 42 min 38 sec ago
Joined: 06/05/2014 - 06:00
Posts: 5100
Location: Salisbury, North Carolina, USA

ToyKeeper wrote:
Mike C wrote:
Here is my 85 driver board … I’ve put the OTC, voltage divider and E-switch all on the same pin. … smooth adjustable output level of any amount of AMC7135s on up to 7 on constant current with an additional single AMC7135 for PWM between, and also have a FET for turbo/boost mode.

Mad science, I tell you. Mad!

Wight tried something similar, and it was pretty cool. It seems like a simple FET+1 covers most of the functionality though, without the need for extra 7135 channels. Beyond that it’s kind of diminishing returns, with the extra 7135 channels getting used only for like one mode each. On the BLF A6, here is how the two channels are powered for evenly-spaced modes:

The modes are:

Group 1 7135 power FET power
Moon 0.8% 0
Low 8% 0
Med 1 43% 0
Med 2 100% 2.7%
High 1 100% 22%
High 2 100% 54%
Turbo 0 100%
Group 2 7135 power FET power
Low 8% 0
Med 90% 0
High 100% 35%
Turbo 0 100%

Extra channels would improve the modes labelled “High”, and maybe “Med 2”, but aren’t really needed for the rest.

I’m very curious to see if you can get the combined voltage/otc/e-switch pin to work though. Combining any two of those would help quite a bit with opening pins for other purposes.


IIRC, Mike had said in an earlier thread that he didn’t really like un-regulated output, so all the low-mid-high-whatever modes will have regulation and the FET is only used for Turbo mode. I can appreciate his reasoning, and I’m looking forward to seeing the finished (final tested version) driver.

Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone.
-Ayn Rand

Pages