Attiny25/45/85 FW Development Thread

1901 posts / 0 new
Last post
Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

I'm more interested in driving 3-4 outputs with this sort of setup. Is that what this 85 driver does? I know only 2 I/O pins can be used with PWM's, but a 3rd or 4th could be driven with fixed 7135's at full power I suppose - pretty cool, great for multi-color lights. That whacko nut zoomie light (on TMART and GB) with it's 3 XP LED's would be an interesting host for this.

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 12 hours 36 min ago
Joined: 02/03/2013 - 14:51
Posts: 7236
Location: SC

^ I believe the 25/45/85 have 4 pins that can have PWM output.  Pins 2, 3, 5, &  6.

13a has one PWM channel that can output to 2 pins (OC0A,OC0B).  The 25 et al have 2 PWM channels that can output to 4 pins (OC0A,OC0B,OC1A,OC1B).

Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

Ohhh?? Didn't realize that! I thought the 13A had 2 independent PWM's on max of 2 I/O pins it could support. Hhmm, didn't realize that was what T_K's firmware was limited to when combining the FET and 7135 - thought her dual mode tables were controlling 2 PWM values at the same time. Also thought the 25/45/85 had the same restrictions... I gotta go back into the specs.

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

pilotdog68 wrote:
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



Update: I have now shared the driver in post #135 of the X6R thread.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Mike C
Mike C's picture
Online
Last seen: 9 min 22 sec ago
Joined: 01/22/2014 - 08:03
Posts: 1518
Location: Sweden

DavidEF wrote:
all the low-mid-high-whatever modes will have regulation and the FET is only used for Turbo mode.

Correct. Not using PWM on the FET at all. It’s just full on for turbo.

Tom E wrote:
I’m more interested in driving 3-4 outputs with this sort of setup. Is that what this 85 driver does?

I’ll be driving 5 outputs. 3 outputs for AMC groups of 1, 2 and 4 for any number of 1 to 7 on in constant current, another output for driving a single AMC7135 with PWM, and the last is for the FET. I do this so I can seamlessly adjust the output from moonlight to all 8 AMCs full on, using PWM with the single AMC to fill in the gap between each constant current AMCs. I did it on my ZY-T08 project and just loved how it worked so now I want to try it on a 17mm driver for a triple XP-L HI light with dual switch setup and a FET for turbo mode.

I haven’t thought about the 85 having PWM on four pins as I only use it on one, except on my dual LED headlight project where I use two (but it uses the 84, not the 85).

Mike C
Mike C's picture
Online
Last seen: 9 min 22 sec ago
Joined: 01/22/2014 - 08:03
Posts: 1518
Location: Sweden

I guess I should clarify that this particular driver won’t suitable for multiple LED outputs (such as different color LEDS) as there is only one LED- and all AMCs and the FET are connected to it.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 54 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 4884
Location: (469219) 2016 HO3

Multi-LED lights would be very interesting, especially after hearing that the 25/45/85 have four usable PWM channels. Smile

Regulated output (with no PWM or very limited PWM) from zero to 3.04A also sounds really nice, and brings the driver up to par with high-end brands. I’d still put the FET on a PWM-capable channel though, to allow it to vary its output instead of jumping directly from 3A to 6A+ with nothing between.

On the attiny13a, there is one PWM counter, and it can optionally have two outputs with two different stopping points. Or it can have a single counter with a configurable ceiling. So, it has a couple different modes:

  • One channel: Counts from 0 to N each cycle and uses a duty cycle from 0 to X where 0 <= X <= N. N defaults to 255. This provides both pulse width modulation and pulse frequency modulation; the latter can be useful for fine-tuning output between individual PWM levels, and is used by Ferrero_Rocher/Ramping_UI_table.c .
  • Two channels: Counts from 0 to 255 each cycle, with one channel stopping at X and the other channel stopping at Y. The two channels are basically independent except for sharing a clock. This is what the BLF A6 does.

… and both can be configured for either a sawtooth wave (fast PWM) or a triangle wave (phase-correct PWM).

It sounds like the 25/45/85 doubles this, though the second set of PWM channels appears to have a slightly different feature set.

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

You guys already knew (or should have known) that the 85 could do 4 PWM outputs.  Did you not remember DrJones' RGBW driver?  

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

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 54 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 4884
Location: (469219) 2016 HO3

RMM wrote:

You guys already knew (or should have known) that the 85 could do 4 PWM outputs.  Did you not remember DrJones’ RGBW driver?  


Oh, I thought that used the 84, not 85. And I made the mistake (for months!) of believing wikipedia’s page comparing atmel chips, which appears to be wrong or at least a bit misleading. But the 25/45/85 data sheet confirms four PWM outputs, and the differences between them.
Mike C
Mike C's picture
Online
Last seen: 9 min 22 sec ago
Joined: 01/22/2014 - 08:03
Posts: 1518
Location: Sweden

The design I had in mind for running OTC, VDV and Esw on the same pin won’t work. Giving it another go by adding a MCU supervisor that has a built in 150ms delay. Thinking of the ADM1818 (from Analog Devices) because the RST (output) is low untill voltage level has been above a certain voltage threshold for 150ms (turning on the light). Then after the 150ms delay the + is let through to the VDV and OTC. The 150ms delay should give me enough time to read the OTC before the + voltage reaches it.

I’m no electronics guy, I just found this component by searching for a small delaying component with about the right delay. So does anyone with some knowledge about this stuff have any input? Even if it might work, are there better choices out there around the same size or smaller?

Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

Didn't know Dr Jones driver was 85 based - actually totally forgot bout it. Soo hard following his stuff - I always seem to have a broken link to his sites. Think it's mentioned here: http://budgetlightforum.com/node/27250.

Edit: If he reads what we go thru, he's probably sitting back laughing - he knows all this stuff: been there, done that... Smile We are breaking ground in making it public I suppose. Others, maybe many others, have gone through all this already. Remember the polish driver? 25 based I think.

The wikipedia article is definitely mis-leading. It shows no difference in PWM support between the 13 and 25/45/85's... Wow.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 54 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 4884
Location: (469219) 2016 HO3

I wonder why it uses software PWM at 2kHz instead of the hardware’s built-in PWM at 20kHz.

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 12 hours 36 min ago
Joined: 02/03/2013 - 14:51
Posts: 7236
Location: SC

You think DJ used Pin 1 for the momentary switch?  No real board traces visible and very limited info seems to be provided.

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

You can use pin 1 as an I/O, even on the 13, but after you do that you can't reprogram it without an HVSP programmer.  That's another reason I bought a Dragon.

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

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

I’m about to place a mouser order, so I figured I would pick up a few of the 25’s for future use.

Will the ATTINY25-20SSU work, or do I need the ATTINY25V-10SSU?

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Mike C
Mike C's picture
Online
Last seen: 9 min 22 sec ago
Joined: 01/22/2014 - 08:03
Posts: 1518
Location: Sweden

The 25-20SSU is guaranteed to function down to 2.7V, the 25V-10SSU will run down to 1.8V. The only other difference (besides price) is CPU speed, but for flashlight usage this doesn’t matter. I’m guessing you’ll be fine with the 2.7V 20-SSU, but there is a slight possibility that unpredictable things might happen if your voltage happens to drop below that.

For my 85 projects I only go with the 85V for peace of mind, but I bought them from Farnell that have slightly weird prices. Buying only a few and the 85 is much cheaper, but buying 25 or more and the 85V is cheaper. So I bought 25 of the 85Vs… Cheaper and don’t have to worry about the voltage specs.

Halo...
Halo...'s picture
Offline
Last seen: 8 months 5 days ago
Joined: 12/15/2011 - 02:39
Posts: 3239
Location: Halo island

I would go for ATTINY25V-10SSU. It’s guaranteed it be stable down to 1.8v. 20SSU only officially good to 2.7v.

Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

I got the 25V's too. I'm running them at 8 Mhz now (still faster than the 4.8 Mhz we used on the 13A's) , so the 20 Mhz capability is pretty useless - I believe 8 Mhz is the fastest you can do on the internal clock anyway.

Mike C
Mike C's picture
Online
Last seen: 9 min 22 sec ago
Joined: 01/22/2014 - 08:03
Posts: 1518
Location: Sweden

The only reason to consider the 2.8V version is if you’re going to build a bunch of drivers for 6V LEDs (MT-G2, XHP70). Then you might be able to save a little on getting some. Other than that, go for the 1.8V for peace of mind.

Halo...
Halo...'s picture
Offline
Last seen: 8 months 5 days ago
Joined: 12/15/2011 - 02:39
Posts: 3239
Location: Halo island

Really, the attiny25-20ssu will probably be fine. Other atmel chips usually work a bit beyond their official spec, it’s just not guaranteed. When problems do occur from running outside spec, one chip may be fine and another seemingly identical chip is unreliable. So I think it’s best to, at least do any initial testing with the 25v.

Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

From Richard's post #163 -- got those boards in today!! Qty 3. Looks real good. think OSHPark expressed them to fill space.

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

I did a 20mm/22mm version of my DoubleDown driver, and had space to fit Attiny85 pads.

20mm and 22mm are identical except for the outside diameter.

  • FET+1 on the top, with pads for 3 extra 7135’s on the bottom (optional of course, for CC med mode)
  • 2.1mm LED+ through-hole
  • Attiny45/85 ready
  • Separate pad for Pin 3
  • Zener ready
  • Gate pulldown resistor for FET
  • Pads for bleeder resistor for Lighted Tailcap

Oshpark link for 20mm ……………… Oshpark link for 22mm

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

Dang PD!! CoolSmile I'm maybe not miss'n wight so much anymore.

pyro1son
pyro1son's picture
Offline
Last seen: 1 week 6 days ago
Joined: 03/21/2013 - 08:18
Posts: 431
Location: UK

Dam, just realized that I’ve ordered ATTiny25 Sad
Need to order some ATTiny25V going to have to wait for them to turn up. Now the long wait begins.
Anybody have any good places to get some?

Pastebin                                      &nbs

Mike C
Mike C's picture
Online
Last seen: 9 min 22 sec ago
Joined: 01/22/2014 - 08:03
Posts: 1518
Location: Sweden

Farnell: http://uk.farnell.com/

I don’t know if they sell to private people in the UK though, I have to go through a third party company here in Sweden.

Halo...
Halo...'s picture
Offline
Last seen: 8 months 5 days ago
Joined: 12/15/2011 - 02:39
Posts: 3239
Location: Halo island

pyro1son wrote:
Dam, just realized that I’ve ordered ATTiny25 Sad
Need to order some ATTiny25V going to have to wait for them to turn up. Now the long wait begins.

Try them. Often atmel chips can run fine a bit outside of the official spec. Also you can set the clock speed to 4mhz. Slower speeds are recommended for lower voltage range use. I suspect attiny25 non-V will be no problem at 4mhz.
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 54 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 4884
Location: (469219) 2016 HO3

It sounds like I need to spend some time reading the full reference manual for 25/45/85. If it can run at 4 MHz, that would actually make it almost identical to the speed the attiny13a has been using. (if my recent measurements are correct, it appears that our common drivers actually run at like 3.4 to 4.2 MHz, not 4.8 MHz)

Of course, there’s also 6.4 MHz available. That might be a good balance, but I haven’t tried it yet.

In any case, tiny25 (non-v) goes down to 2.7 V… so if you set the LVP to trigger a little higher it should be fine. I’ve only tested one down to 2.7V (not 2.6 or lower), but it worked great right at the edge of its spec.

Tom E
Tom E's picture
Offline
Last seen: 6 hours 34 min ago
Joined: 08/19/2012 - 08:23
Posts: 9223
Location: LI NY

I only see two choices of internal clock rates: 6.4 Mhz or 8.0 Mhz in the Fuse Calculator: http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny45&P=ATtiny45&M_LOW_0x3F=0x03&M_LOW_0x80=0x00&M_HIGH_0x07=0x07&M_HIGH_0x20=0x00&B_CKDIV8=P&B_SPIEN=P&B_SUT0=P&B_CKSEL3=P&B_CKSEL2=P&B_CKSEL0=P&V_LOW=62&V_HIGH=DF&V_EXTENDED=FF

Don't think an external clock is an option for us - too many ext. parts, no driver design for that. How is the speed set to 4 Mhz? Maybe there's a divide by 2 option?

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 54 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 4884
Location: (469219) 2016 HO3

I assume it would have to be a clock divider. It looks like the 25/45/85 have clock dividers for all powers of 2 up to 256. This provides a lot of choices for speed.

Halo...
Halo...'s picture
Offline
Last seen: 8 months 5 days ago
Joined: 12/15/2011 - 02:39
Posts: 3239
Location: Halo island

I thought you could use the Clock Prescale Register CLKPR to get 4mhz.

Pages