Crescendo clicky firmware by TK

92 posts / 0 new
Last post
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Mike C wrote:
carpmon43 wrote:
if i may ask what chips are you up too?
ATtiny1634.

I’ve been meaning to add tiny841 and tiny1634 support to FSM, both to enable more hardware features and to make the supported UIs portable across a wider range of hardware. It’s sort of a cross between a UI toolkit and an OS kernel, but it currently only supports tiny25/tiny45/tiny85. So I’m trying to help enable new hardware designs by supporting new hardware.

If you’ve already gotten things working on either of both of those, is there any chance of sharing the code you created to bootstrap the chip and get PWM going? It doesn’t even have to be shared publicly; I’m mostly just looking for working examples to use as a reference.

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

Mike C wrote:
carpmon43 wrote:
if i may ask what chips are you up too?

ATtiny1634.
ToyKeeper wrote:
When multiple projects share the same code though, including a shared file is generally easier than keeping multiple in-line copies in sync.
I certainly agree that with complex projects it makes sense, but for flashlight firmware I would just use copy and paste if I had multiple firmware files. I don’t have multiple files myself, I have them all in one and decide which one to compile with #defines. Makes backup real easy… a single file… One file to rule them all.

quite few more pins in that doody.

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

am i right in thinking the attiney 13/13A’s can be ‘directly replaced’ with the attiney 25/45/85 chips? the 13A has a working voltage from 1.8-5.5v and the 25/45/85 a working voltage of 2.7-5.5v ?

could fit bigger programs onto standard 13A sized drivers then

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

In most cases, yes, the attiny13a can be directly replaced with attiny25v. However, tiny13 can tank a lot of electrical noise and operate pretty far out of spec, while the tiny25 cannot. So in some cases, tiny13 might work while a tiny25 would end up rebooting a lot due to voltage spikes. It depends on how well the driver insulates the MCU from the LED power.

Tiny45 and tiny85 are slightly bigger, and don’t easily fit onto the same layouts. However, they typically still fit after bending the legs underneath.

Crescendo is primarily meant for FET+1 or FET+N+1 drivers with a tiny25, though it can also work on 13, 45, and 85, or with just one power channel.

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

ToyKeeper wrote:
In most cases, yes, the attiny13a can be directly replaced with attiny25v. However, tiny13 can tank a lot of electrical noise and operate pretty far out of spec, while the tiny25 cannot. So in some cases, tiny13 might work while a tiny25 would end up rebooting a lot due to voltage spikes. It depends on how well the driver insulates the MCU from the LED power.

Tiny45 and tiny85 are slightly bigger, and don’t easily fit onto the same layouts. However, they typically still fit after bending the legs underneath.

Crescendo is primarily meant for FET+1 or FET+N+1 drivers with a tiny25, though it can also work on 13, 45, and 85, or with just one power channel.

hmmm, i’m waiting for new iron to arrive, and hmmm i may just swap the chip. (still on the C8).

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 1 day 3 hours ago
Joined: 09/15/2017 - 07:53
Posts: 258
Location: behind you

ToyKeeper

I’m a little confused about the diagram. Is it possible for Crescendo to be set up for instant turbo or a turbo default? This would be great for a tactical light set up.

Mike C
Mike C's picture
Offline
Last seen: 1 day 4 hours ago
Joined: 01/22/2014 - 08:03
Posts: 2317
Location: Sweden

ToyKeeper wrote:
is there any chance of sharing the code you created to bootstrap the chip and get PWM going?

Bootstrap is a term I don’t quite understand, but I can share my start-up sequence and PWM code for 1634 with you. I’ll see if I can find my old 841 code somewhere too.
carpmon43 wrote:
Mike C wrote:
ATtiny1634.
quite few more pins in that doody.

Yep. I’ve actually designed a driver that uses all of those pins. I just haven’t got around to building it yet (one of those projects standing in line). It’s a slightly more advanced version of these: http://budgetlightforum.com/node/63771

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Deputy Dog wrote:
I’m a little confused about the diagram. Is it possible for Crescendo to be set up for instant turbo or a turbo default? This would be great for a tactical light set up.

I wouldn’t really recommend Crescendo for tactical use. It does have a shortcut to turbo, but it’s probably not fast enough for tactical purposes. The shortcut is to turn it on three times quickly. So, on a reverse clicky, it would be click-tap-tap. On a forward clicky, it would be tap-tap-click, but Crescendo really doesn’t work well on a forward clicky so I’d probably use something else.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Mike C wrote:
ToyKeeper wrote:
is there any chance of sharing the code you created to bootstrap the chip and get PWM going?
Bootstrap is a term I don’t quite understand, but I can share my start-up sequence and PWM code for 1634 with you. I’ll see if I can find my old 841 code somewhere too.

Oh, sorry, bootstrap is a weird English term.

In the 1780s, in the story of Baron Munchausen, there is a scene where he pulls himself out of a swamp by grabbing his own hair and pulling up. The point is to show that Baron Munchausen can do impossible things.

Then in 1834 in the US, there was a cultural conflict between the right-leaning aristocracy and the left-leaning labor unions of the working class. A labor union magazine (the “Working Man’s Advocate”) published a lot of articles making fun of the aristocracy’s policies and beliefs. In one article, it used a metaphor to illustrate how ridiculous their beliefs were, and how they were asking people to do the impossible. The metaphor said that they expected a poor working man to lift himself over a fence by pulling up on the straps of his boots.

The idea continued to be used in this manner for a while, showing up in the 1860s as “lift himself by his own bootstraps”. It still referred to impossible tasks.

However, by the early 1900s, people were starting to promote similar policies again, and some of those people didn’t recognize that the phrase was meant to ridicule those policies. They thought it was a good description of what they thought was a good idea, and they started using the phrase unironically to describe their own policies. By 1916 or so, it had entered common use with a meaning of bettering one’s self through extreme effort with no outside help. This led to the roaring 1920s and the great depression of the 1930s, and then the idea was less popular for a while. But in modern times there has been another resurgence of those ideas and the phrase has become popular again, mostly without realizing that the term was originally created to make fun of exactly that type of idea.

Anyway, moving ahead to the 1950s, thanks to the efforts of snarky computer scientists and their affinity for bad jokes, it gained a third meaning — the startup processes on a computing device which occur between powering on and reaching a steady operational state. And it was shortened to “bootstrapping” or just “booting”. Hence why we now have terminology talking about booting (or rebooting) a computer.

TL;DR: Yes, what I’m looking for is mostly the startup sequence and PWM code. Maybe something about reading voltage and/or temperature too. Basically just accessing the hardware features, not the higher-level application logic.

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

dohh, i thought it was a circuit that returns the over voltage difference to ground lol, spose its a loose term for a lot of things… unless i confused it with a ‘clamp’ .

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

hurray, 100 watt iron arrived, one touch soldering with the star in situe, installed Gcharts ramping UI 2nd attempt and it works. (NANJG layout on the red convoy C8 board).
running temperatures are spot on, and the ramp down works on turbo/max ramp, also the battery check is as close as.

draws 1.7 amps with the battery at 3.7v at the battery end on turbo/max ramp, thats that sorted.

thank you everybody, i actually got help on here, nice one. Thumbs Up

edit: and just confirmed the LVP works too. (battery at 3.11v after a few minutes rest. light switched off).

Mike C
Mike C's picture
Offline
Last seen: 1 day 4 hours ago
Joined: 01/22/2014 - 08:03
Posts: 2317
Location: Sweden

ToyKeeper wrote:
Hence why we now have terminology talking about booting (or rebooting) a computer.

That was an entertaining read, thanks for taking the time Smile

ToyKeeper wrote:
what I’m looking for is mostly the startup sequence and PWM code. Maybe something about reading voltage and/or temperature too. Basically just accessing the hardware features, not the higher-level application logic.

I’ll put something together. I found some of my old 841 code too, it might be of use.
Deputy Dog
Deputy Dog's picture
Offline
Last seen: 1 day 3 hours ago
Joined: 09/15/2017 - 07:53
Posts: 258
Location: behind you

ToyKeeper

Quote:
On a forward clicky, it would be tap-tap-click, but Crescendo really doesn’t work well on a forward clicky so I’d probably use something else

What else is there? I can use either switch (though forward would be best) it’s just that the default needs to start at turbo.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Deputy Dog wrote:
What else is there?

I hear the Olight Warrior X is pretty good for tactical purposes. There are lots of others to choose from in that general category though. I’m probably not the best person to give tactical recommendations, since I don’t really know much about it.

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

can we have a defined explanation of ‘tactical flash’ light’?

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
carpmon43 wrote:
can we have a defined explanation of ‘tactical flash’ light’?

This might help:
http://budgetlightforum.com/node/56967

EasyB
Offline
Last seen: 1 month 2 weeks ago
Joined: 03/09/2016 - 15:24
Posts: 1679
Location: Ohio
Deputy Dog wrote:
ToyKeeper
Quote:
On a forward clicky, it would be tap-tap-click, but Crescendo really doesn’t work well on a forward clicky so I’d probably use something else

What else is there? I can use either switch (though forward would be best) it’s just that the default needs to start at turbo.

I think Bistro FW can be made to always start in turbo.

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 1 day 3 hours ago
Joined: 09/15/2017 - 07:53
Posts: 258
Location: behind you
ToyKeeper wrote:
Deputy Dog wrote:
What else is there?

I hear the Olight Warrior X is pretty good for tactical purposes. There are lots of others to choose from in that general category though. I’m probably not the best person to give tactical recommendations, since I don’t really know much about it.

You know I’m talking about tactical with “ramping”. I already have several tactical lights.

EasyB
Offline
Last seen: 1 month 2 weeks ago
Joined: 03/09/2016 - 15:24
Posts: 1679
Location: Ohio

Crescendo could be modified to start in turbo. You could just reverse the ramp table so it starts with 100% FET, and turn off memory. I think this would start in turbo then automatically ramp down? I’ve always used memory so I’m not certain how it behaves with no memory. Is there an additional simple modification to make it just turn on in turbo and stay there?

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Deputy Dog wrote:
I’m talking about tactical with “ramping”.

For that, I’d recommend Anduril with the START_AT_MEMORIZED_LEVEL option turned on, maybe also with the boot code modified a little to do turbo by default instead of memory. This way, the tail clicky switch would work as a tactical momentary button, while a side e-switch provides access to ramping and all the other general-purpose stuff.

Or Crescendo could be modified to start at the top instead of the bottom, but it’ll still be prone to doing odd things when bumped. Even with modifications, I don’t think I’d recommend it for tactical purposes.

carpmon43
Offline
Last seen: 3 months 2 weeks ago
Joined: 01/20/2019 - 18:40
Posts: 115
Location: uk

ahh yes tactical… but strobes gunna be a dead give away, can you imagine it, out side the cartell, everyone’s in position, shh….shhhhh? whats that noise? i mirrion candle power strobe mode..WITH RAMPING!!..

hmm.. inddeadly..

Deputy Dog
Deputy Dog's picture
Offline
Last seen: 1 day 3 hours ago
Joined: 09/15/2017 - 07:53
Posts: 258
Location: behind you
ToyKeeper wrote:
Deputy Dog wrote:
I’m talking about tactical with “ramping”.

For that, I’d recommend Anduril with the START_AT_MEMORIZED_LEVEL option turned on, maybe also with the boot code modified a little to do turbo by default instead of memory. This way, the tail clicky switch would work as a tactical momentary button, while a side e-switch provides access to ramping and all the other general-purpose stuff.

Or Crescendo could be modified to start at the top instead of the bottom, but it’ll still be prone to doing odd things when bumped. Even with modifications, I don’t think I’d recommend it for tactical purposes.

Thanks! I didn’t even see all these options on Mountain Electronics site before this thread.

Maiden666
Offline
Last seen: 2 months 3 days ago
Joined: 10/18/2014 - 18:15
Posts: 186
Location: Spain

What kind of fuse I have to use with the Crescendo25?. Moreover, it would be possible to use these same fuses with the Attiny25 and 85?

Thanks.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Maiden666 wrote:
What kind of fuse I have to use with the Crescendo25?. Moreover, it would be possible to use these same fuses with the Attiny25 and 85?

Some firmware projects have recommended fuse values inside the source file. However, for all of mine, check the bin/flash-tiny*-fuses.sh scripts in the code repository to see the most up-to-date recommended fuse values for each MCU.

Okay, I just updated a bunch of source files to remove any outdated fuse info from the .c file and replace it with a pointer to the flashing scripts. Those scripts are much more actively maintained, and more likely to be correct.

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

Mark Piezó wrote:
I want to buy this driver:
https://www.aliexpress.com/store/product/17mm-Driver-for-SST40-4-modes-0...

Can use it with Crescendo? Who can explain me, friends? Je suis newbie in these things…. :)))))))))))

No, it uses some sort of 10-leg chip as the controller. I don’t know what it is, except that it’s not any of the chips Crescendo supports.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Mark Piezó wrote:
Where can I find recommended fuses … ?

In the bin/flash-*-fuses.sh scripts in my firmware repository, it has recommended fuse values for each type of controller chip and usually a link to a calculator which shows what those values mean.

In most cases though, the fuses don’t need to be flashed. Sending a .hex file by itself is typically fine, and less risky.

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

Almost there. But it’s not under ToyKeeper/ , it’s under bin/ . Smile

BTW, to compile the code for an arbitrary driver, you’ll probably need to edit the source a little bit to choose relevant settings. And the crescendo.c file also points to those same flashing scripts for info about the fuse values.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Mark Piezó wrote:
I’m romantic but stupid like all French

I hope people aren’t defined by their national stereotypes… because if they are, I must be a horrible person. Crying

It’s far better to be a hopeless romantic than to be an arrogant jerk. Blushing

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 hours 39 min ago
Joined: 01/12/2013 - 14:40
Posts: 9734
Location: (469219) 2016 HO3
Mark Piezó wrote:
ToyKeeper wrote:
national stereotypes … I must be a horrible person. Crying
Why are you talking so about yourself? What is so terrible you did in life? Are you a serial killer? Evil Big Smile Wink

It’s just my national stereotype. But fortunately, people are not defined by the country they live in. Smile

Jlight
Offline
Last seen: 2 months 2 weeks ago
Joined: 06/01/2019 - 12:57
Posts: 1

ToyKeeper, I just wanted to say a big THANK YOU! for all of your hard work creating these awesome flashlight interfaces for all of us flashlight fanatics to use—your work is very much appreciated!

Pages