I missed David EF's post. never mind. Anyway, yeah, the code should work. It's not exactly like ttrev3 said, but similar. The PWM match is already built into the chip, so it uses a match itnerrupt and an overflow int (and I doubt you'll find smaller ones anywhere). Just the 4th waveform generator that was missing. Anyway, yeah, it should be ready to go if you're happy with preset mode ramps, and it can get the eswitch and Vcc read too. I hadn't known about this thread. I'm not that interested in sabres but it seems like a fun test case.
It should work fine with the right firmware although it is not really setup for a flashlight and is pretty large.
All 4 of the output pins can be PWM so it is just a matter of getting firmware that takes advantage of it.
Well, it’s less than 26mm, so it’s large but not huge. There are some lights, especially 26650 lights, that can use that large of a driver. I did notice that it doesn’t have a ground ring. That in itself will make it a challenge to use in most lights. But, the parts selection and layout are what I was referring to when asking about the compatibility. If the circuit schematic is basically compatible, then a flashlight-friendly board can be made easily. That’s what I’m hoping for.
—
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
TA I think you'll find it pretty easy to customize the simplified attiny.h to whatever layout you've got. If really needed it is even possible to move the 4th pwm from the traditional cap pin to the traditional voltage pin, but I did not include that as a "user-visible" option.
.. or just get me some details and I'll set it up.
Well Bistro-HD does do 4 channel PWM and can do it with eswitch and voltage read (on Vcc or on the eswitch/voltage pin with the right hardware). It’s similar to what tterev3 says but slightly simpler(smaller code). The chips already have four PWM output compare registers, no need to keep resetting the clock. It just doesn’t have 4 waveform generators. So you use two interrupts, one for match and one for overflow. Anyway, it’s all setup already there. Just have to figure out how the UI parts should look, but if you’re happy with preset mixes as you go through modes, then that’s all set too. I had not known about this thread though.
With the almost staggering number of mode choices available in a single firmware now (by using mode groups and config options), I think preset mixes would be a fine place to start. The modes would just need to be RGBW-level modes, versus the white-lighting-level modes we use normally.
In the future, it would be great to have a dual-switch control where one switch moves you through channels and the other operates smooth ramping (and/or typical “modes”) . Then it will just be “click A-switch” to choose which channel to change, then “click-hold B-switch” to ramp brightness of that channel (or “click B-switch” to use preset “modes”), then back to “click A-switch” to select the next channel and continue. I don’t know how hard this will be to write and I don’t want to make demands on anyone’s time. It’s just a dream of mine for now.
—
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
Yeah, that's going to need hardware support. You've got to get that second switch on the reset pin. From a software perspective, it's easiest if it's normally high, and the switch pulls it down to 0.5V. I'd wire it like this:
Or you need two different pull down voltages on the main pin, but I think the above is simpler as far as software. Might even work without changing anything.
Depending on how things go, I might try to use a tiny841 and acupuncture or a bed of nails for flashing. That would provide more pins and a newer MCU. I’ll probably also try to align the LED connections directly under the holes in the heat sink, so a short wire can go directly up to each emitter and the board itself can be pressed against the heat sink.
I just need to learn a PCB layout tool first.
That’s all for later though. For now, I can get things like 90% done (and make a working saber) with the provided layout.
All of my designed come with the source files that are pretty easy to edit once you get the software. Sadly for you, I don’t think diptrace is on linux but you could most likely use a virtual machine or even wine.
I figure I’ll probably use KiCad. It’s what my Linux circuit geek friends recommended, and Oshpark supports its files directly. It appears to be a little on the complex side compared to some, but it also appears to be pretty powerful. And I’m not doing anything particularly complicated, so I don’t have to be picky.
Before that though, I have some firmware to write. So much firmware. And parts to order. And tools to try.
It is what I think flashlights should and will be moving to in the future. It offers many advantages with no cost increase or other downsides if learning a new chip anyways.
I mean 16kb and 22 i/o pins, whats not to like and thats before you really dig into the spec sheet. It also has multiple reference voltages making it much simpler to create a driver that can work with any input voltage.
Is that even supported in gcc yet? My copy ( gcc-avr 1:4.9.2+Atmel3.5.3-1 ) doesn’t seem to recognize it, unless it’s supported under a non-obvious name. It recognizes attiny841 though.
TK, if you want easy, I would recommend Eagle. It’s very intuitive to use and if you need to, you can use mattaus’ tutorial to get you started. It’s what most of us around here use, so if you get stuck on something, help is very near. We have lots of custom made library parts floating around here for Eagle as well. I tried looking at KiCad, since it’s included in Ubuntu’s repositories, but I couldn’t figure out how to do anything with it. Oshpark also supports Eagle files directly, and they have a design rules file for Eagle that you can download.
—
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
Is that even supported in gcc yet? My copy ( gcc-avr 1:4.9.2+Atmel3.5.3-1 ) doesn’t seem to recognize it, unless it’s supported under a non-obvious name. It recognizes attiny841 though.
Good question, it is the latest MCU out so if it is not supported yet you can bet it will be soon. Although it could just simply not be in there by name yet but share the settings with another chip.
As am I.
I’ve been on the fence about owning a lightsaber, because I don’t feel it’s practical (this from a guy with a shelf full of flashlights that mostly just sit there). I’ve been a Star Wars fan since ’77, so the desire has always been there.
This may turn the corner for me. With my modicum of lathe experience, I suppose if I were to own one, it should be one that I made myself. A 26mm driver board is barely over 1”, so it would fit inside a ‘saber hilt without any difficulties.
This one is light only, no sound, but I’m hoping I can make one with sound in the future. That’s a much bigger project though, and I’ll need to find a way to fund development. Hoping one of the saber companies will be interested enough to help with that.
In this light-only version though, what I’ve made is similar to an analog synthesizer, only for light instead of sound. The user can create their own unique look by, basically, turning knobs while watching the changes in real time, until it looks how they want. The colors are entirely up to the user, and the patterns are formed by modulating together whatever effects they want. This allows them to build smooth oscillations, harsh strobes, shimmering colors, unstable flickering, etc.
This is a pretty big change from the existing products out there, which typically have only a few preset colors and a single pattern which can be high, med, low, or off. Other stuff also has some other weird drawbacks, like requiring inline floating resistors to prevent the LEDs from turning into smoke… but the heat goes into the resistor instead (which has no heat sink and is often shrink-wrapped), so the resistors tend to burn out.
I’m undecided whether to make an intermediate version which also includes an accelerometer. It would be a really nice upgrade, and would fit very nicely into the analog synth approach, but it’d still be light-only. I might go directly for the full-featured version instead. Or, if things don’t work out, I might never make the second version. Hopefully things will go well.
I forgot to post this earlier. Things aren’t finalized yet, but here’s the interface so far:
It’s pretty simple as far as synth engines go, but it’s plenty for personalizing a lightsaber. Most drivers offer like 5 different shimmer presets (including “none”) using a single color, and that’s it. In contrast, this one can be configured for a wide range of different patterns (including multi-color). I tried to keep things reasonably simple though, since it only has one button.
Configuration is basically just “pick two colors and then turn knobs until it looks good”. It shows the results in real time during adjustment, so it’s fairly intuitive. There’s currently room for 12 different personality slots, though that number is kind of arbitrary. By default, it has 8 slots for somewhat traditional blades (like “Paladin Blue” and “Consular Green”) and 4 slots for special-effect blades (like “Rainbow Lightning” and “Police Flasher”).
As an example of how these things work, here’s how to configure a police flasher:
Set color 1 to bright red.
Set color 2 to medium blue.
Set the color shape to a square wave.
Set the color speed to something slow.
Pulse depth: medium-high.
Pulse shape: square.
Pulse speed: fast.
The two square waves stack so that one alternates slowly between red and blue while the other alternates rapidly between dim and bright. There’s nothing special about this though — the user can configure it for whatever patterns they like, and the police flasher is mostly just an example to help people understand how things work. For less dramatic patterns the user can do things like “slow triangle wave from light orange to dark orange, plus a medium-speed low-intensity triangle wave”. That would make it look like a gently-pulsing, breathing, orange plasma. It mostly just depends on what the user wants it to look like.
Hey TK! Have you any updates for us mere mortals? I’m still interested in seeing this new driver come available here.
Also, did you end up using KiCAD for your PCB design? I just downloaded it again recently, because Eagle is getting really weird since AutoCAD took it over. I’m still trying to figure out how to use KiCAD, but it seems a bit easier than I remember it being before. One problem I’m finding is that I don’t know how/where to get library parts for standard stuff we use like AMC7135 regulators and less ‘common’ stuff like PIC chips.
—
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
I keep getting distracted and haven’t done it yet.
The only progress since my previous update is I got a prettier host with a lighter-weight blade for better balance. But it doesn’t even have a proto1 board in it; instead I currently have a Convoy S7 crammed inside the hilt for extra weight and some light.
It spins nicely, but I really need to make a new driver and update the firmware.
This probably isn’t the best place to ask, but since David bumped what turned out to be an interesting, somewhat related thread:
Is there a list anywhere of 4-channel drivers? Here’s what I know of so far:
Mountain Electronics has one that has been around for a while.
tterev3 used to offer the really sophisticated looking meld-x, but has discontinued it.
Dr. Jones also used to have a similarly neat looking e-switch driver, but it also appears to no longer be available.
The Light Saber driver also looks awesome, but is too big for most flashlights, and not yet available?
My personal interest is RGBA, specifically an E17A quad from Clemence, to put in preferably an S2+ with a frosted lens.
I can probably live with the driver Mountain offers, which is easy because it comes assembled, ready to go, for a decent price, and the default current is a good match for the E17A. The drawbacks are the modes are fairly basic, switching mode groups requires soldering, output is only adjustable by swapping resistors, and there’s no mode that runs all 4 channels at the same time – the color E17A’s are phosphor converted, so they should be able to mix to a pretty good white, if you get the power levels right.
This probably isn’t the best place to ask, but since David bumped what turned out to be an interesting, somewhat related thread:
Is there a list anywhere of 4-channel drivers? Here’s what I know of so far:
Mountain Electronics has one that has been around for a while.
tterev3 used to offer the really sophisticated looking meld-x, but has discontinued it.
Dr. Jones also used to have a similarly neat looking e-switch driver, but it also appears to no longer be available.
The Light Saber driver also looks awesome, but is too big for most flashlights, and not yet available?
My personal interest is RGBA, specifically an E17A quad from Clemence, to put in preferably an S2+ with a frosted lens.
I can probably live with the driver Mountain offers, which is easy because it comes assembled, ready to go, for a decent price, and the default current is a good match for the E17A. The drawbacks are the modes are fairly basic, switching mode groups requires soldering, output is only adjustable by swapping resistors, and there’s no mode that runs all 4 channels at the same time – the color E17A’s are phosphor converted, so they should be able to mix to a pretty good white, if you get the power levels right.
I’m still hoping for this driver to be finished sometime. A good open source driver for RGBW is missing from BLF. This driver board can be reduced, but it would be at the expense of some of the 7135 chips being eliminated. If you don’t need a low-low, I guess all the 7135 chips could be replaced with FETs. That would make the driver quite inefficient, but it could be much smaller that way. Another idea would be to reduce the number of 7135 footprints, but stack the chips on the driver when building it. Either of these choices would require a re-design of the board, but Eagle is fairly easy to learn.
FYI, tterev3 said he quit his sales because of lack of interest. But I was able to get a couple of drivers from him a few months ago that he had left over. I don’t know if he still has any now or not. You’d have to ask him about it. I haven’t built the lights yet from the drivers I bought from him. I have the hosts, but I still need some colored LEDs.
—
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
I missed David EF's post. never mind. Anyway, yeah, the code should work. It's not exactly like ttrev3 said, but similar. The PWM match is already built into the chip, so it uses a match itnerrupt and an overflow int (and I doubt you'll find smaller ones anywhere). Just the 4th waveform generator that was missing. Anyway, yeah, it should be ready to go if you're happy with preset mode ramps, and it can get the eswitch and Vcc read too. I hadn't known about this thread. I'm not that interested in sabres but it seems like a fun test case.
Well, it’s less than 26mm, so it’s large but not huge. There are some lights, especially 26650 lights, that can use that large of a driver. I did notice that it doesn’t have a ground ring. That in itself will make it a challenge to use in most lights. But, the parts selection and layout are what I was referring to when asking about the compatibility. If the circuit schematic is basically compatible, then a flashlight-friendly board can be made easily. That’s what I’m hoping for.
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
TA I think you'll find it pretty easy to customize the simplified attiny.h to whatever layout you've got. If really needed it is even possible to move the 4th pwm from the traditional cap pin to the traditional voltage pin, but I did not include that as a "user-visible" option.
.. or just get me some details and I'll set it up.
With the almost staggering number of mode choices available in a single firmware now (by using mode groups and config options), I think preset mixes would be a fine place to start. The modes would just need to be RGBW-level modes, versus the white-lighting-level modes we use normally.
In the future, it would be great to have a dual-switch control where one switch moves you through channels and the other operates smooth ramping (and/or typical “modes”) . Then it will just be “click A-switch” to choose which channel to change, then “click-hold B-switch” to ramp brightness of that channel (or “click B-switch” to use preset “modes”), then back to “click A-switch” to select the next channel and continue. I don’t know how hard this will be to write and I don’t want to make demands on anyone’s time. It’s just a dream of mine for now.
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
Yeah, that's going to need hardware support. You've got to get that second switch on the reset pin. From a software perspective, it's easiest if it's normally high, and the switch pulls it down to 0.5V. I'd wire it like this:
GND <-----------------------R10--------------------------------R11------------- VCC
|
|
/ Switch
|
|
Reset Pin
Or you need two different pull down voltages on the main pin, but I think the above is simpler as far as software. Might even work without changing anything.
Depending on how things go, I might try to use a tiny841 and acupuncture or a bed of nails for flashing. That would provide more pins and a newer MCU. I’ll probably also try to align the LED connections directly under the holes in the heat sink, so a short wire can go directly up to each emitter and the board itself can be pressed against the heat sink.
I just need to learn a PCB layout tool first.
That’s all for later though. For now, I can get things like 90% done (and make a working saber) with the provided layout.
All of my designed come with the source files that are pretty easy to edit once you get the software. Sadly for you, I don’t think diptrace is on linux but you could most likely use a virtual machine or even wine.
Texas Avenger Driver Series
My LED Test series - XP-L2 V5 - Nichia 219C 90+ CRI - Latticebright "XM-L" - XHP35 & PWM efficiency - XHP50 - XP-L V5 - XM-L2 U2 - XP-G3 S5 - XP-L HI V2 - Oslon Square & direct comparison to Djozz tests - Nichia 319A - Nichia 219B 9080 CRI - Nichia 219C D320 - Nichia 229AT - XHP70.2 P2 - XHP50.2 J4 - Samsung LH351D
Easy comparison tool for all my LED tests
I figure I’ll probably use KiCad. It’s what my Linux circuit geek friends recommended, and Oshpark supports its files directly. It appears to be a little on the complex side compared to some, but it also appears to be pretty powerful. And I’m not doing anything particularly complicated, so I don’t have to be picky.
Before that though, I have some firmware to write. So much firmware. And parts to order. And tools to try.
If you are starting on a new MCU anyways, I HIGHLY recommend the 1617 mcu : http://www.mouser.com/ProductDetail/Microchip-Technology/ATtiny1617-MFR/?qs=sGAEpiMZZMvqv2n3s2xjsdZc02topxxIyb2htVHofo5O1dwzOibzLA%3D%3D
It is what I think flashlights should and will be moving to in the future. It offers many advantages with no cost increase or other downsides if learning a new chip anyways.
I mean 16kb and 22 i/o pins, whats not to like and thats before you really dig into the spec sheet. It also has multiple reference voltages making it much simpler to create a driver that can work with any input voltage.
Texas Avenger Driver Series
My LED Test series - XP-L2 V5 - Nichia 219C 90+ CRI - Latticebright "XM-L" - XHP35 & PWM efficiency - XHP50 - XP-L V5 - XM-L2 U2 - XP-G3 S5 - XP-L HI V2 - Oslon Square & direct comparison to Djozz tests - Nichia 319A - Nichia 219B 9080 CRI - Nichia 219C D320 - Nichia 229AT - XHP70.2 P2 - XHP50.2 J4 - Samsung LH351D
Easy comparison tool for all my LED tests
Is that even supported in gcc yet? My copy ( gcc-avr 1:4.9.2+Atmel3.5.3-1 ) doesn’t seem to recognize it, unless it’s supported under a non-obvious name. It recognizes attiny841 though.
TK, if you want easy, I would recommend Eagle. It’s very intuitive to use and if you need to, you can use mattaus’ tutorial to get you started. It’s what most of us around here use, so if you get stuck on something, help is very near. We have lots of custom made library parts floating around here for Eagle as well. I tried looking at KiCad, since it’s included in Ubuntu’s repositories, but I couldn’t figure out how to do anything with it. Oshpark also supports Eagle files directly, and they have a design rules file for Eagle that you can download.
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
Good question, it is the latest MCU out so if it is not supported yet you can bet it will be soon. Although it could just simply not be in there by name yet but share the settings with another chip.
Texas Avenger Driver Series
My LED Test series - XP-L2 V5 - Nichia 219C 90+ CRI - Latticebright "XM-L" - XHP35 & PWM efficiency - XHP50 - XP-L V5 - XM-L2 U2 - XP-G3 S5 - XP-L HI V2 - Oslon Square & direct comparison to Djozz tests - Nichia 319A - Nichia 219B 9080 CRI - Nichia 219C D320 - Nichia 229AT - XHP70.2 P2 - XHP50.2 J4 - Samsung LH351D
Easy comparison tool for all my LED tests
The latest AVR toolchain (3.6.0) was released in January, while the 1617 data-sheet initial release was in March.
Haven’t updated in a while, but I’ve got this mostly working now. I just have a few things left to do. Off the top of my head…
Really not all that much left, but some of the remaining steps are going to be time-consuming.
I’m still watching this channel!
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
So am I now!
As am I.
I’ve been on the fence about owning a lightsaber, because I don’t feel it’s practical (this from a guy with a shelf full of flashlights that mostly just sit there). I’ve been a Star Wars fan since ’77, so the desire has always been there.
This may turn the corner for me. With my modicum of lathe experience, I suppose if I were to own one, it should be one that I made myself. A 26mm driver board is barely over 1”, so it would fit inside a ‘saber hilt without any difficulties.
have light, will travel
This one is light only, no sound, but I’m hoping I can make one with sound in the future. That’s a much bigger project though, and I’ll need to find a way to fund development. Hoping one of the saber companies will be interested enough to help with that.
In this light-only version though, what I’ve made is similar to an analog synthesizer, only for light instead of sound. The user can create their own unique look by, basically, turning knobs while watching the changes in real time, until it looks how they want. The colors are entirely up to the user, and the patterns are formed by modulating together whatever effects they want. This allows them to build smooth oscillations, harsh strobes, shimmering colors, unstable flickering, etc.
This is a pretty big change from the existing products out there, which typically have only a few preset colors and a single pattern which can be high, med, low, or off. Other stuff also has some other weird drawbacks, like requiring inline floating resistors to prevent the LEDs from turning into smoke… but the heat goes into the resistor instead (which has no heat sink and is often shrink-wrapped), so the resistors tend to burn out.
I’m undecided whether to make an intermediate version which also includes an accelerometer. It would be a really nice upgrade, and would fit very nicely into the analog synth approach, but it’d still be light-only. I might go directly for the full-featured version instead. Or, if things don’t work out, I might never make the second version. Hopefully things will go well.
I forgot to post this earlier. Things aren’t finalized yet, but here’s the interface so far:
It’s pretty simple as far as synth engines go, but it’s plenty for personalizing a lightsaber. Most drivers offer like 5 different shimmer presets (including “none”) using a single color, and that’s it. In contrast, this one can be configured for a wide range of different patterns (including multi-color). I tried to keep things reasonably simple though, since it only has one button.
Configuration is basically just “pick two colors and then turn knobs until it looks good”. It shows the results in real time during adjustment, so it’s fairly intuitive. There’s currently room for 12 different personality slots, though that number is kind of arbitrary. By default, it has 8 slots for somewhat traditional blades (like “Paladin Blue” and “Consular Green”) and 4 slots for special-effect blades (like “Rainbow Lightning” and “Police Flasher”).
As an example of how these things work, here’s how to configure a police flasher:
The two square waves stack so that one alternates slowly between red and blue while the other alternates rapidly between dim and bright. There’s nothing special about this though — the user can configure it for whatever patterns they like, and the police flasher is mostly just an example to help people understand how things work. For less dramatic patterns the user can do things like “slow triangle wave from light orange to dark orange, plus a medium-speed low-intensity triangle wave”. That would make it look like a gently-pulsing, breathing, orange plasma. It mostly just depends on what the user wants it to look like.
Thanks for the update! I’m looking forward to seeing this in action when you get it done! (You ARE going to post photos AND video, right?)
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
Hey TK! Have you any updates for us mere mortals? I’m still interested in seeing this new driver come available here.
Also, did you end up using KiCAD for your PCB design? I just downloaded it again recently, because Eagle is getting really weird since AutoCAD took it over. I’m still trying to figure out how to use KiCAD, but it seems a bit easier than I remember it being before. One problem I’m finding is that I don’t know how/where to get library parts for standard stuff we use like AMC7135 regulators and less ‘common’ stuff like PIC chips.
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
I keep getting distracted and haven’t done it yet.
The only progress since my previous update is I got a prettier host with a lighter-weight blade for better balance. But it doesn’t even have a proto1 board in it; instead I currently have a Convoy S7 crammed inside the hilt for extra weight and some light.
It spins nicely, but I really need to make a new driver and update the firmware.
TK? Still working on this?
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
This probably isn’t the best place to ask, but since David bumped what turned out to be an interesting, somewhat related thread:
Is there a list anywhere of 4-channel drivers? Here’s what I know of so far:
My personal interest is RGBA, specifically an E17A quad from Clemence, to put in preferably an S2+ with a frosted lens.
I can probably live with the driver Mountain offers, which is easy because it comes assembled, ready to go, for a decent price, and the default current is a good match for the E17A. The drawbacks are the modes are fairly basic, switching mode groups requires soldering, output is only adjustable by swapping resistors, and there’s no mode that runs all 4 channels at the same time – the color E17A’s are phosphor converted, so they should be able to mix to a pretty good white, if you get the power levels right.
I’m still hoping for this driver to be finished sometime. A good open source driver for RGBW is missing from BLF. This driver board can be reduced, but it would be at the expense of some of the 7135 chips being eliminated. If you don’t need a low-low, I guess all the 7135 chips could be replaced with FETs. That would make the driver quite inefficient, but it could be much smaller that way. Another idea would be to reduce the number of 7135 footprints, but stack the chips on the driver when building it. Either of these choices would require a re-design of the board, but Eagle is fairly easy to learn.
FYI, tterev3 said he quit his sales because of lack of interest. But I was able to get a couple of drivers from him a few months ago that he had left over. I don’t know if he still has any now or not. You’d have to ask him about it. I haven’t built the lights yet from the drivers I bought from him. I have the hosts, but I still need some colored LEDs.
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
Pages