Attiny25/45/85 FW Development Thread

Very interesting information. How does this affect the performance of the light? Meaning, what are the consequences or benefits in terms of user operation?

Being dense over here, am I to understand that the 4.7K resistor can stop a Manker Bistro driver from bumping to moon when powering a high discharge light such as a triple? Where exactly does this resistor need to go on Wights FET+1 driver to accomplish this?

No effect on performance that I can see. Keep in mind that the power feed to the LEDs and power part of the driver circuit stays mostly the same, we are just filtering the control power used by the MCU.

Overall the MCU should be more stable under extreme conditions and in addition functions like voltage detection and low voltage/high temperature step-down should be be more consistent.

Not sure - what is this in reference to? Where is the 4.7K resistor? Ohhh - do you mean 4.7 ohms? I doubt DEL has analyzed the Wight FET+1's. He's looked at and discussed Richard's MTN17DDm v1.1, and we have a possible placement for the 4.7 ohm resistor there.

Basically, the 4.7 ohm resistor should precede the D1 diode, and actually all other parts fed by BATT+, accept the LED(s) of course. The Wight FET+1 drivers don't lend themselves well to doing that, I believe - haven't looked carefully at one in a while.

The Manker Bistro driver has quite a few problems, so doesn't surprise me it has some bad behavior in differing conditions. If anyone scoped it, I bet they'd see lots of signal spikes out of tolerance of the MCU, just like what DEL was seeing, but worse.

Personnally if I had that problem with a Manker Bistro driver, 1st thing I'd try is a "C2" mod (C2 from our BLF Q8), which is a 0.1 uF cap between MCU GRND and VCC, and the FET gate to grnd resistor (40K-60K) - I've mentioned this and shown it several times, and I've done it repeatedly on Wight FET+1 drivers using a 25 or 85 MCU - Richard's 25 driver uses the FET gate to grnd resistor as well. All the 85 mods I've done apply to the 25 as well, accept with the right 25, you don't have to bend the pins of the MCU to have it fit the 13A pads.

Unfortunately Manker didn't know much of what they were doing with that driver. Initially, it didn't work consistently, so it was passed along from me that I used a 20 uF C1 at that time, so they bumped C1 from 10 to 12 uF, and then it seemed to work better. They didn't do the other tweaks though, and apparently didn't scope the signals. They seemed about the same level as me, in working with and understanding it - a bad thing...

Triples are a bit different than normal mods because of the high amps and longer LED wires - DEL has seen the effect on signals of long wires, even if they are heavy gauge.

Not dense at all Dale, we should really get into the habit of showing circuit diagrams. I will try to post something better later.

The new resistor has to be inserted between battery+ and C1. D1 is then taken from this new junction to MCU pin 8. On some existing drivers this will not be an easy retrofit, might have to cut traces and wire in some components. The Bistro driver looks like one of these, with the LED+ wire basically soldered to C1.

Note that it is a 4.7 ohm resistor, not 4.7 kohm. Whatever you have between 1 and 10 ohm will work though.

BAT+ ---+------[4.7]---------+---------------|>|----------------MCU pin 8
        |                    |               D1
        |                    = C1
      LED+                   |
                             |
                            --- GND

There really should be a C2 directly between MCU pins 8 and 4 as well, but that should get you going.

EDIT: TomE got it! :slight_smile:

DEL, thanks for the scoping. Great result with such a small component. I’ll include that resistor as well.

I undestand that the ringing is gone now, but what about that seemingly large spike that still remains. Is that of no concern?

The circuit diagram helps a lot. Yes, we need to improve there and I say that knowing that I’m shy of at least one diagram myself… :innocent:

To elaborate on C2. This is an essential component consistently neglected on most drivers, probably due to space constraints. It protects the power feed to the MCU from outside disturbances, as well as from within the MCU (e.g. output pins switching).

We can probably get away without C2, provided C1 is located after D1, as close to pins 8/4 of the MCU as possible. For the A6/X6 drivers, just adding the new R and leaving C1 in front of D1, will however give a drastic improvement already.

Yes, it is scary. Try it without the series resistor on the FET gate and it is really impressive. I was not happy at first. But this feeds straight back into the cells. Regenerative braking…kind of!

My only concern is for the little 7135. It gets that spike on its pin 1, seems to handle it OK though. The 7135 datasheet is of no use here of course.

EDIT: Other issues will be radiated EMI/RFI and audible noise. Neither should be an issue for what we are doing.

Great then. I was thinking it might draw more current but on doing a few more calculations, the FET doesn’t draw that much current at such low frequencies so it’s all fine. I hope it makes its way onto drivers. You’re awesome with the scope!

Does anyone here use diptrace?

I have a tripledown Schematic made up in it that would be easy enough to carry over to these FET + 1 drivers as well.

Once you have the Schematic in diptrace building the PCB is SOOO much easier, it tells you exactly what connects to what and where and you can add/change or remove things from the Schematic and it will directly send those changes to the PCB design as well.

I tried eagle briefly and found it clunky and very frustrating by comparison. Which was why I started from scratch on diptrace.

The other benefit is that you can very easily post Schematic’s on here for people to read.

diptrace - I've heard of it for sure. Maybe the guys here @work use it, because it sounds very familiar - I'll ask around.

So, it can do the full PCB design, and generate the files in a format OSHPark accepts? If so, it sounds so much better than Eagle...

Quick schematic:

Thick lines are the main current path. 7135 not shown.

C2 and R4 are optional, but recommended.
If C2 is not used, C1 should be moved over to its position.
R5 is the new resistor, 1 to 10 ohms.

I’ve just this week been looking for a pcb design software. I was going to try eagle but maybe I should try this? Which is best for someone just learning?

I want to layout a charging circuit in 16mm pcb. Then I will transfer the parts from a basic charging circuit from eBay. I can then use direct drive driver in some lights without sacrificing the charging circuit. Many lights now come with this feature.

Dang, I'd be very much interested so please post when you get it goin.

DipTrace should be good to go for OSHPark, if that's what you want. See their DipTrace notes here: http://docs.oshpark.com/design-tools/diptrace/

Here's the page listing all the design notes for Design Tools: http://docs.oshpark.com/submitting-orders/

I've never worked with a PCB design package before, but think'n of looking at DipTrace - gotta do some research on it to see if easier than Eagle. Like that schematic support mentioned by Texas_Ace, and it was also recommended by a super tech I work with, who does all our PCB designs at work.

DEL - that schematic looks really good!! I think we can fill in all the values at this point? Also, I'm thinking the R5 resistor will impact the voltage monitoring values I currently use, since it's before R1?

It’s great, we really need more of those for drivers. I’m wondering, do you know what the point of C1 is now? I mean what’s the advantage of having the large C1 before the diode with small C2 next to the MCU vs just putting the large capacitor next to the MCU? Is the smaller cap better at really short current bursts (eg. like the one to charge the FET gate)? Or something else way above my head? I think I need to find a good book on the subject.

R5 is so small compared to R1/R2 (even with the default R1, R2 values) that it will have practically no impact.

I would say these are good ball-park numbers:

R1 : 22 k (or 220 k for e-switch lights, like you have been using)
R2 : 4.7 k (or 47 k for e-switch lights)
R3 : 100 k
R4 : 47 ohm
R5 : 4.7 ohm

C1 : 10 uF
C2 : 0.1 uF

Re. the need for C1, we can probably get away with only one C if space really does not allow for both.
Having it before or after D1 is a trade-off, will have to compare the performance.

Ok. i will do that. Ive not done this before, but i already know the circuit. so if i can learn how to do a basic layout, it shouldnt be too hard.
I guess ill try DipTrace then since i know it will interface with oshpark

In reference to the schematic above “[schematic]”:Attiny25/45/85 FW Development Thread - #1005 by DEL .

Comparing three options, C1 + C2, C1 only and finally C1 moved to the C2 position:

This time trace 2 is the voltage at the C1/D1 node on the schematic. Zero for all traces is again the 1st div line from the bottom. Traces 1 and 2 are scaled 1 V/division. Traces 3 and 4 are 2 V/division to fit the peaks.

R5 gives a major improvement on what we had before with all three options.

Removing C1 and changing C2 to 10 uF looks pretty good at pin8 (yellow), but keep in mind trace 2 (light blue) is what is going to R1+R2 (the ADC). We can always move R1 as well, this is what is done on the nanjg 105 drivers. But then we have to fudge a number for the D1 voltage drop in firmware.

Not recommended, C1 removed and C2 only 0.1 uF, but it gives an idea of what the MCU will put up with:

Note the peaks at pin 8 (yellow trace) is at 6.6 V. Imagine where it is at when the MCU starts to freak out. Tough little chips.

I honestly can’t recommend it enough over Eagle. After using diptrace for a few minutes I uninstalled eagle as I knew I would never ever use it.

Seeing as they are both free, you can naturally try both but I highly recommend you start with Diptrace.

I will try to snap some screen shots of my work in progress SRK driver later.

It is used by a lot of deisgn firms so it would not surprise me if your coworkers use it.

It may not be the best thing out there but it is Free and is 10x easier and more capable then eagle.

Yep, it allows you to draw out the schmatic (or download one naturally) then you can transfer it to PCB design mode, draw out the PCB size and then it will try to place the components automatically. Although with these tiny boards we use it is generally best to lay it out yourself.

It can then auto-rought the traces but once again this is generally best done yourself with these tiny boards. This is quite easy though as it knows where everything should connect and will tell you if you make a mistake.

The best part is when it comes time to change things later, you simply change a component in the Schmatic, import that change into the PCB and it takes care of the rest!

There are a few learning curves but I picked it up in under an hour. Where as with eagle I never could get it to do what I wanted, how I wanted. They also have great video walk-throughs for Diptrace.

The biggest hurdle I had was drawing the exposed copper pads to soldering springs to and the like, it is not that hard to do, just took some creative thinking to get it right.

I downloaded diptrace but the first component I needed was not in the database. With these programs, do you need to import the components you need? The component I needed was the TP4056.