Attiny25/45/85 FW Development Thread

1901 posts / 0 new
Last post
ToyKeeper
ToyKeeper's picture
Online
Last seen: 8 min 9 sec ago
Joined: 01/12/2013 - 14:40
Posts: 5483
Location: (469219) 2016 HO3

If I’m reading the product manual correctly, I think that is correct.

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Just fyi, I'm working on an enhanced e-switch based firmware version that has user selected mode sets only for the 25/45/85 - made a lot of progress on it over the weekend. Right now you can choose 1 of 8 mode sets, mode memory ON/OFF, and lo->hi or hi->lo, so it's probably equivalent to 32 modes of 'guppydrv' style modes. May add more options - the design lends itself to be extendable. Right now it's designed only for FET+1 drivers, and is getting close to 2K of code unfortunately. I was hoping to stay under 2K for the 25.

 In testing/debugging, I once again ran into the problem of not being able to download firmware to either a 25 or 45. I'm thinking it's the clip - kind of beat up w lots of use, but also may have to do with the solder job on the CPU pins. I'll try to find a best deal, quick shipment - I know the Pomono I use now I got from DigiKey.

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

^ Lots of options/improvements there.  Hoping Strobe is still immediately accessable from any mode.  I think many folks, like me and my wife, that use strobe want it rapidly available.  We live in the woods and strobe is quite handy for chasing off most unwanted critters.  I would think it could be handy for helping disorient a potential attacker in a city environment.  I really like the BLF-A6 FW, but the lack of immediate access to strobe from any mode is a deal breaker for me.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Yes, I'm keeping strobe as it was - direct access via a 'hold' -- I like this as well. I'd like to add options though to choose it or not (maybe beacon), but also extend the hiddens with more than just strobe - this isn't implemented yet. What I have now is to access config settings, 'hold' for a little longer, past the strobe hold time, then light goes off, you get a couple blinks, then you can do 1-8 clicks to choose your mode, then it times out, then 2 blinks, then you can click your next option (lo->hi, hi->lo), then 2 blinks again for the mode memory option -- one click toggles the current setting.

Really you can go two ways: 1-click toggles, or 1-click OFF, 2-clicks ON. Not sure yet which way. Decided to go with the 1-click toggle method for now.

ohaya
Offline
Last seen: 1 month 3 days ago
Joined: 03/16/2013 - 19:01
Posts: 5335
Location: US

I’m getting ready for an order from Digikey and wanted to get some MCU > ATTINY13A to try.

Is the ATTINY25-SSU the right one to get?

Or something else?

Thanks for this thread!
Jim

EDIT: Sorry, I meant ATTINY25V-SSU?

Also, ATTINY45V-10SU is ok?

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

If you want it to fit the Attiny13a SSU footprint, then ideally you want the ATTINY25V-SSU.  The "V" version can operate more reliably to a lower voltage, but you would probably be ok with the non-V model.

I personally get "V" versions in the SU package as they generally cost less and I just bend the pins in.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

ohaya wrote:
I'm getting ready for an order from Digikey and wanted to get some MCU > ATTINY13A to try. Is the ATTINY25-SSU the right one to get? Or something else? Thanks for this thread! Jim

I got the 25V-10SSU, as generally recommended above. It supports a min lower voltage, more like the 13A. The 45V's and 85V's are the other choices - more memory, but wider footprint - not directly fitting most existing 13A drivers, but can be made to fit by squeezing or trimming the pins.

For me, the way it's looking will be the 45V or 85V to get the full UI capabilites I'm looking to do. This of course will restrict my driver board selection, or not, depending...

ohaya
Offline
Last seen: 1 month 3 days ago
Joined: 03/16/2013 - 19:01
Posts: 5335
Location: US
Tom E wrote:

ohaya wrote:
I’m getting ready for an order from Digikey and wanted to get some MCU > ATTINY13A to try. Is the ATTINY25-SSU the right one to get? Or something else? Thanks for this thread! Jim

I got the 25V-10SSU, as generally recommended above. It supports a min lower voltage, more like the 13A. The 45V’s and 85V’s are the other choices – more memory, but wider footprint – not directly fitting most existing 13A drivers, but can be made to fit by squeezing or trimming the pins.

For me, the way it’s looking will be the 45V or 85V to get the full UI capabilites I’m looking to do. This of course will restrict my driver board selection, or not, depending…

Sorry, I edited my post above. For the ATTINY45:

Quote:
Also, ATTINY45V-10SU is ok?
ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

^ That is what I'm using.  I just push the pins in.  They actually attach much better that way to programmer clips.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

ohaya
Offline
Last seen: 1 month 3 days ago
Joined: 03/16/2013 - 19:01
Posts: 5335
Location: US
ImA4Wheelr wrote:

^ That is what I’m using.  I just push the pins in.  They actually attach much better that way to programmer clips.

I’m assuming you mean the ATTINY45? I ordered a couple. Can you provide a pic of that (push the pins in)?

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

^ Yes, the 45.  Here is one with the pins pushed about 1/2 way from stock position to all the way against the chip.

Here is one with the pins pushed all the way up against the chip.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Dang, that does look better for the SOIC clip! Might have to try one this eve - maybe this will solve the problems I'm having.

It looks like it's gonna walk away Smile

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

Yeah, it not only makes the chip taller, it increased the first curve of the pin which makes for a better "grab".

Just make sure you push on that inside arch near the end of the pin.  Not on the actual end of the pin.  In my first pic above, I pushed on the ends of the pins.  That causes uneven leg lengths and the need for adjustments to get the pins to rest on the board evenly.  You really only want to bend the pins once and then reflow to the board.  After bending the pins, I wouldn't connect a programming clip until the chip is reflowed.  The legs are much stronger soldered to the board.  I may be being too cautious, but I don't like losing MCU's.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

ToyKeeper
ToyKeeper's picture
Online
Last seen: 8 min 9 sec ago
Joined: 01/12/2013 - 14:40
Posts: 5483
Location: (469219) 2016 HO3

ImA4Wheelr wrote:
After bending the pins, I wouldn’t connect a programming clip until the chip is reflowed.  The legs are much stronger soldered to the board.  I may be being too cautious, but I don’t like losing MCU’s.

If that bothers you, imagine upgrading the hardware of a fleet of big rack-mounted cellular servers, each with 8 cells and 2592 pins per cell (20736 pins per server), requiring quite a bit of force to remove and insert each cell. Bent pins happened rather a lot. It’s fun trying to fix a single bent pin in the middle of a 48×54 grid deep inside a dark narrow cell slot. Especially when the cell guidance rails have poor tolerances due to being early prototypes, so where they land is somewhat random.

I’m glad I don’t work in a “big iron” data center any more.

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

^ That sounds crazy.  That project would push me over the edge for sure.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

texaspyro
Offline
Last seen: 10 months 3 weeks ago
Joined: 04/29/2011 - 12:43
Posts: 4593

BTW, Atmel was just bought out by Dailog Semiconductor (Dia who? Never heard of them… ):

http://www.theregister.co.uk/2015/09/21/dialog_semiconductor_to_acquire_...

Halo...
Halo...'s picture
Offline
Last seen: 11 months 8 hours ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island
Fritz t. Cat
Fritz t. Cat's picture
Offline
Last seen: 3 weeks 1 day ago
Joined: 05/07/2013 - 00:33
Posts: 2534
Location: Si Valley

RMM wrote:

I can hear the 19KHz PWM in most lights in the middle modes, but that’s because what I’m hearing isn’t 19KHz anymore—it’s the springs and MLCCs resonating at a lower frequency.  MLCCs are especially bad (piezoelectric effect).


I wonder how lower frequencies are generated. Simple mechanisms like non-linearity only generate higher harmonics, overtones. Maybe the controller doesn’t keep the 19 KHz constant?

Flashlight designers should look at lighthouses and pottery.
这些谁设计的手电筒应该看灯塔,以及在陶器。

Fritz t. Cat
Fritz t. Cat's picture
Offline
Last seen: 3 weeks 1 day ago
Joined: 05/07/2013 - 00:33
Posts: 2534
Location: Si Valley
dchomak wrote:
led4power wrote:

Things (MLCCs,springs,glass…)can’t “vibrate” at frequency different than source(driver in this case). So if current\voltage frequency is 19kHz,all other components are forced to vibrate at that frequency (+harmonics if source generates signal different than pure sine). Resonant frequency is frequency at which vibration reaches its maximum,but it doesn’t influence system frequency forced by external source(driver).

There is a thing called the heterodyne effect
https://en.wikipedia.org/wiki/Heterodyne

This could explain all of this


There has to be another frequency for that, maybe a loop in the code?

Flashlight designers should look at lighthouses and pottery.
这些谁设计的手电筒应该看灯塔,以及在陶器。

Halo...
Halo...'s picture
Offline
Last seen: 11 months 8 hours ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

Tom E wrote:

For me, the way it’s looking will be the 45V or 85V to get the full UI capabilites I’m looking to do.

Skip the 45v and go straight to the 85v. It’s cheaper than the 45v on mouser and digikey, in single quantities and every other quantity level.
Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Thanks, will do. Need to order a Pomano 5250 clip also. Just broke mine in trying to get it to work. At least pretty sure I know wut the problem is now - too much solder on the legs, could be the over-used clip also. Think when the solder paste creeps up on the top of the legs, can't get a good grasp. I have a 25 based driver built up for a AS31 light sitting on the stock stripped driver with the switch and was able to get my old clip (black no name) working on it, so can hopefully get some testing done.

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

I got in my new Pomona 5250 clip now. I still can't reprogram a mounted 25V. I took an 85V, bent in the legs. I can "air" reprogram it over and over again. So I mounted it on a A22DD+1 board, continuity checked all the pins. Looks like a real nice setup for developing with - should be easy to get good contact on the clip. So, clipped it on - the test AVRDUDE command works every time - sees the ID as an 85. But when I program it, it downloads, and fails the verification of the program on the first byte every time - every time over and over. It sure looks like a good clip-on. With the bent legs, looks easier to get a good contact on all the pins. I tried several things - cleaning the pins, shimming it around - I don't know what else to do or try at this point -- out of ideas. Is there something on the driver board circuit maybe interfering with the 85?

This is the error:

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x4a != 0x00
avrdude: verification error; content mismatch

Any help or suggestions are extremely welcome... FrownFrownFrown

Update: Just tried the "-V" option to turn off verification, but didn't help. It proceeded in programming the fuses but failed on each. The driver, also, doesn't seem to work at all.

Update: Also tried another stock 85V in "air" programming it -- works every time over and over again.

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

^

You know much more about this stuff than me, but I have to say that it does sound like something in the circuit design is interfering.  Which board are you using and does it just have the typical components connected?

Edit: opps, the A22DD+

EDIT2: That is wight's 22mm board, right?  I take it you don't have the OTC cap installed.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Right, no OTC cap. I'm using brownout detection for the power switch. I'm so close............

ImA4Wheelr
ImA4Wheelr's picture
Offline
Last seen: 1 day 22 hours ago
Joined: 02/03/2013 - 14:51
Posts: 7330
Location: SC

I think I have that driver with the 45V.  I can try to flash it tonight and see what happens.  Can you post or email me the exact FW you are trying to flash and the fuses?

I also have this one that is modded.

". . . You realize that wasn't really a loss for me in Africa — it was a gain that I didn't appreciate."

- George Foreman 2017

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Ahhh - the firmware is my under test/debug/pre-cursor/not-quite-there version, if you know what I mean...

I'm looking around, and found someone else: vex_zg, who seems to have had similar experiences, here: http://budgetlightforum.com/node/37545.

So, he set 8 Mhz and turned off the /8 clock option... Hhmm - I'll try anything. He has very similar experiences though - the MCU seems bricked then comes back to life! Exactly what I saw. I'm also pm'ing RMM, TK, and Mike C and asking them to check in. I know Mike has done 85 work, and RMM and TK I think started.

Halo...
Halo...'s picture
Offline
Last seen: 11 months 8 hours ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

Are you programming at 5v?
Slower avrdude programming speed? Like -B 4. Higher is slower, max is 64.

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Halo... wrote:
Are you programming at 5v?

Yes.

ImA4Wheelr - what is that hugh part on that driver pic? Mine is the same driver, yes. Dunno, vex_zg pm'ed me, saying might be something on the driver PCB, but weird because it was basically all working. I've been using this same driver. I should really just try another one built up though, maybe different design too.

Halo...
Halo...'s picture
Offline
Last seen: 11 months 8 hours ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

Tom E wrote:
So, he set 8 Mhz and turned off the /8 clock option… Hhmm – I’ll try anything.

The default avrdude programming SCK speed is suppose to be suitable for target MCUs running at 4 MHz clock and above. What did clock did you have the attiny85 set to?

Try avrdude -p t85 -B 4 -c usbasp

I’ve heard most chinese firmware will automatically adjust SCK though.

Tom E
Tom E's picture
Offline
Last seen: 1 week 6 days ago
Joined: 08/19/2012 - 08:23
Posts: 9796
Location: LI NY

Just did try "-B 4"- no difference. My fuses right now are:

  -Ulfuse:w:0xe2:m -Uhfuse:w:0xde:m -Uefuse:w:0xff:m

I'm using 8 Mhz, tried with and without /8 clock option, and I have brownout enabled for 1.8v.

 

Just tried "-B 40" and no difference.

I'm gonna remove this 85V and install one I "air" programmed. Betta the new one will work on the board, maybe can't re-program it though, and the old one will probably air program... This is ugly if this is how it's gonna be...

Minutes later....

I pulled the old one off, traced MCU pins on the board all over the place - looks real good, nothing grnd'ed that shouldn't be. Yes - new one worked on the board, w/bugs of course. Old one can now be programmed in "air". New one on the board can't be reprogrammed - once I tried (of course) to program it, the program is trashed, once again. Back in the mess I started with.

Madness I Tell You!! Sheer Madness!  Yell

Pages