Attiny25/45/85 FW Development Thread

Thank RMM. Need to find where JohnnyC posted that. I think MikeC is working with much bigger chips, but maybe the his code could save some time.

It's in his github repository and was on his site before he started that. He shared that code with me last August, but it sounds like you've already made it that far.

As far as i know it shouldnt matter what package it uses as the architechture is the same. And the main advantage i see is the aurdino ide seems much more integrated and user friendly then winavr. Also alot of the low level programing is taken care of for you, the only time you would need to write registers is to set the fast pwm. You can have all the code down below with a few variables up at the top of the code that the user modifies to get the desried modes and features and just click upload. At any point someone can step in and tell me im wrong because i dont have very much time in winavr and im not well versed in programing.

True, but I do care about the package because I would lke to use the 45 (or 25 or 85) on existing 13A boards we have on OSHPark. Besides new board orders, I got a little stock on the wight designed OSHPark boards, as well as RMM OSHPark boards. I don't have the time or expertise to Eagle CAD new board layouts, maybe someone else could, that would be great, but dunno. It's a chicken and egg thing -- no sense in doin board designs because no working firmware, no motivation to develop firmware without any board designs...

^ I agree. My understanding is that if the FW is written for the 25, it will work on the other 2. The nice thing about the 25 is it comes in a 8S1 package which is the same package used for the Attiny13a SSU.

The 45 and 85 come in 8S2 which is the same as the Attiny13a SU. I purchased some SU's once and they fit all my boards fine without bending the legs. So I would think those would be fine for our purposes too.

That is why I'm confused about what size I got. The 10SU I purchased should be in the 8S2 package, but mine appear to the the 8X TSSOP package (See picture in OP). I will measure them tonight and report back.

Diode663,

Thanks for that info. Sounds pretty interesting. If you ever do that, please create a thread on it. It seems like the 25 and 45 should work too as they are pretty much identical except for amount of memory.

The 25/45/85 all run the same software and have the same features with the main difference being the 2KB/4KB/8KB software limitations. 2KB is actually a huge upgrade from 1KB in terms of potential functionality. The 25 comes in the same small footprint SOIC 8 as our current 13a, but the 45/85 aren't that much bigger and the legs can be folded or cut to make it fit on the same pads.

Also, be aware that there is a 25 and a 25V. The regular 25 will die and turn off before you ever hit a 2.8V LVP warning.

The memory part is great, but I'm really wanting to exploit the internal temperature sensor.

I think Tom E has some non "V"'s on the way. His are the 20Mhz variety. I image they would be fine in a buck situation.

K, got my 45's. Think they will have problems. I ordered ATtiny45-20SHR, which in the 25/45/85 datasheet, is 20 MHz, and 2.7-5.5 volts, which will have the problem Richard described - dying before hitting LVP. These are in the 8S2 package. Didn't size them up yet, but hopefully I can use these for development/testing.

It looks like all the 20 Mhz rated parts are all 2.7v min, while the 10 Mhz parts are 1.8v min.

I will probably get the dumb question of the year award for this, but I gotta learn sometime. 2.7v doesn't sound like a half bad cut-off point. Some cells should only go down to 3v, others 2.5v. Of course, they bounce back up some after the load is removed. I tend to replace cells when the get down into the mid to high 3's because they seem boring at that point. Won't your MCU's have automatic LVP and not need LVP coding?

I’m not sure what it’d do if the MCU shuts off due to voltage. It could “fail open”, so to speak, with the power channel fully connected. Maybe. I’d prefer letting it shut itself (and the light) down properly.

I would love to see the 2.7v cutoff tested. To be safe an LVP could be programmed for 2.8-2.9V but having a hard cutoff at 2.7 would be good in my opinion. It’d be yet another way to protect us.

This isn’t LVP, it’s the voltage range where the chip is expected to behave properly. Some individual attiny25 chips may work just fine outside of the range but it is not guaranteed. The attiny25 and others have a Brown-out Detector that would be better to try as a backup LVP. Brown-out Detection can conveniently be set to 2.7v. Fuses 0x62 0xdd will set Brown-out Detection to 2.7v

Is there any real point in running either chip past 10 MHz? The chip uses more power at higher MHz.

As far as I can tell, there’s no point running faster than ~5 MHz, since that’s fast enough to make imperceptible 19kHz PWM. It’s not like it’s processing a lot of data.

For the "V" chips, I believe the choices are 6.4 and 8Mhz unless you use an external oscillator. I opted for 8 just because it is the default and doesn't seem that much higher than 6.4. I will flash for the lower speed next time. I chose 1.8v brown out because that is what TK used for BLF-A6.

I tried to add dual PWM Modes (fast/phase) and Alternative PWM output (like for +7135) to Tom E's version of Star Mom. I have build errors that need to be fixed. So no progress on LVP testing yet.

I just measured my chip at about .21" square not counting the legs. So the chip pictured in the OP is the S82 package.

It’s too bad you have to go up to the Attiny 24 to get more than 2 PWM outputs. I’d like to play with RGBW leds.

You can do RGBW on a tiny13, but at least two of the channels will be on/off only so if you want PWM you’ll have to do it manually. It’s generally not worthwhile except for low-power indicator lights, like for showing battery state through a translucent button.

I want PWM on red green and blue, I’d like to play with color mixing. I might buy a DIP package tiny 24 and build a test driver on perf board.

Oh boy, I ordered the 20 MHz probably because of my need-for-speed mentality I've had in this biz since 1980. I thought the speed was free, apparently not, I didn't fully research the consequences. At this point, there's no reason to play with the risk of that 2.7v cutoff with the 10 MHz chips. The 45's I received are the 8S2 package, and the legs do need to be bent or clipped to fit on a wight 17 FET+1 driver (https://budgetlightforum.com/t/-/31102) - it's way too darn close, but the wight 22 FET+1 driver (https://budgetlightforum.com/t/-/31559) is perfect for these packages with the extra set of extended pads, so it appears. I'll use the 22 mm board for development then.

I'll check around for 25's in the S8S1 package at 10 or 8 Mhz max - this seems to be the best option for using on existing 13A board designs.

This seems like the best in-stock option (ATtiny25V-10SSU):

http://www.mouser.com/ProductDetail/Atmel/ATTINY25V-10SSU/?qs=sGAEpiMZZMvqv2n3s2xjsY4e7hoSVIBakrXdKP3UXak%3d


So I realized that I had just received an attiny85-20SUR from Mouser the other day. I bent the legs and soldered it to a 105C to do some tests using TKs Cypreus2 firmware.

With the following fuses (2.7 Brownout Detection) I had the these results.
-U lfuse:w:0x62:m -U hfuse:w:0xdd:m -U efuse:w:0xff:m

3.11 works
3.07 erratic
3.05 more erratic
3.04 off
3.03 off
3.02 off

Then I flashed these fuses to disable brownout detection and got these results.
-U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

3.06 works
2.98 works
2.83 LVP

So on my test board the 2.7V brownout detection actually started kicking in just over 3V. With it disabled the programmed LVP correctly shutdown the light at 2.8V. Next I’ll disable the LVP in the firmware to see how low the attiny85 will go.

EDIT: I should note that the voltages were tested after disconnecting the battery so there may have been some sag involved. That said, if even the very low moonlight level wouldn’t light up there couldn’t have been that much sag.
EDIT2: While replicating my results I realized that I had wrongly attributed the LVP shutdown to the attiny85 when it was the attiny13a.