Attiny25/45/85 FW Development Thread

1911 posts / 0 new
Last post
fixed it
Offline
Last seen: 4 months 4 weeks ago
Joined: 12/08/2015 - 14:27
Posts: 396
Location: Canada

DEL, it’s an interesting find. If I’m not mistaken, it should also help with inrush current which was discussed a while back somewhere (either here or the Q8 thread). If the lower values are enough, I’d lean on that side as the MCU is already running below its supposed required voltage on near empty cells and this will only add to the voltage drop of the diode.

DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada
fixed it wrote:
DEL, it’s an interesting find. If I’m not mistaken, it should also help with inrush current which was discussed a while back somewhere (either here or the Q8 thread). If the lower values are enough, I’d lean on that side as the MCU is already running below its supposed required voltage on near empty cells and this will only add to the voltage drop of the diode.

It is a compromise. The larger the resistor, the smoother the voltage at pin 8, but the larger the voltage drop as you mention.

But we are talking mAs for the MCU. Average MCU current is around 5 mA. 5 mA x 4.7 ohm = 24 mV, or about 10% of the drop over D1.

LightRider
LightRider's picture
Offline
Last seen: 2 years 1 month ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

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

DB Custom
DB Custom's picture
Offline
Last seen: 2 days 10 hours ago
Joined: 01/13/2013 - 22:28
Posts: 20623
Location: Heart of Texas

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?

DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada
LightRider wrote:
Very interesting information. How does this affect the performance of the light? Meaning, what are the consequences or benefits in terms of user operation?

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.

Tom E
Tom E's picture
Offline
Last seen: 19 min 17 sec ago
Joined: 08/19/2012 - 08:23
Posts: 12881
Location: LI NY

DB Custom wrote:
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?

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... smile

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.

 

DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada

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! Smile

HarleyQuin
HarleyQuin's picture
Offline
Last seen: 1 year 6 months ago
Joined: 03/29/2013 - 04:47
Posts: 580

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

Oshpark Boards:
HQ ProgKey: Universal Driver Programming Key . Boost: HQ 15mm/17mm programmable boost driver with ATtiny13A
46mm Triple-Channel: BLF SRK FET v3 . 17mm Linear: HQ10D / HQ4D / HQ4S . Contact Boards: 22/24/26mm

DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada

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.

DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada
HarleyQuin wrote:
I undestand that the ringing is gone now, but what about that seemingly large spike that still remains. Is that of no concern?

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.

fixed it
Offline
Last seen: 4 months 4 weeks ago
Joined: 12/08/2015 - 14:27
Posts: 396
Location: Canada

DEL wrote:
But we are talking mAs for the MCU. Average MCU current is around 5 mA. 5 mA x 4.7 ohm = 24 mV, or about 10% of the drop over D1.
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!
Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas

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.

Tom E
Tom E's picture
Offline
Last seen: 19 min 17 sec ago
Joined: 08/19/2012 - 08:23
Posts: 12881
Location: LI NY

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...

DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada

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.

LightRider
LightRider's picture
Offline
Last seen: 2 years 1 month ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

Texas_Ace wrote:
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.

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.

Tom E
Tom E's picture
Offline
Last seen: 19 min 17 sec ago
Joined: 08/19/2012 - 08:23
Posts: 12881
Location: LI NY

LightRider wrote:
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?

 

fixed it
Offline
Last seen: 4 months 4 weeks ago
Joined: 12/08/2015 - 14:27
Posts: 396
Location: Canada

DEL wrote:
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.


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.
DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada
Tom E wrote:

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?

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.

LightRider
LightRider's picture
Offline
Last seen: 2 years 1 month ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

Tom E wrote:

LightRider wrote:
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?


 


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
DEL
DEL's picture
Offline
Last seen: 2 years 3 months ago
Joined: 06/28/2015 - 08:35
Posts: 559
Location: Canada

In reference to the schematic above [schematic] .

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.

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas

LightRider wrote:
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.

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.

Tom E wrote:

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…

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.

LightRider
LightRider's picture
Offline
Last seen: 2 years 1 month ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

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.

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas
LightRider wrote:
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.

You can generally find components online but there is another program that is part of the diptrace “suite” that allows you to build a new component from the data sheet easily.

Although honestly for what we do, all that really matters is that it is the right type of component so the schematic shows the right symbol (although this is not even a must as long as you are only making the layout for yourself).

The one thing that must match is the package of the component, in your case SOP-8. As long as you find a component with an SOP-8 package it will work fine. There are a few ways to search the database as well, some work better then others for finding specific parts and you can also search by package as well.

On a common package like that you can pick a random component in that package, we don’t generally care about the exacts of the components, that is more for mainstream production. As long as the package is correct and you properly connect the pins it will work.

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas

Here is a picture of a badly laid out tripledown schematic done in diptrace as a test:

Here it is imported into the PCB design I was also using as a test, rough but you get the idea.

LightRider
LightRider's picture
Offline
Last seen: 2 years 1 month ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA

Ok. I may not be searching correctly as there are many components I cannot find. Such as the attiny. I’ll keep working with it some more. I really don’t know enough to be asking the appropriate questions.

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas
LightRider wrote:
Ok. I may not be searching correctly as there are many components I cannot find. Such as the attiny. I’ll keep working with it some more. I really don’t know enough to be asking the appropriate questions.

Check out the video tour: http://diptrace.com/support/video-guided-tour/

There are lots of videos on youtube as well.

For the Attiny you can find that easily. Simply click on the filter button and then select all libraries in the top menu and enter Attiny in the name search box. Should list a whole bunch of versions of the attiny.

You can narrow the search by adding more filters but to start with just search everything till you get the hang of it.

DB Custom
DB Custom's picture
Offline
Last seen: 2 days 10 hours ago
Joined: 01/13/2013 - 22:28
Posts: 20623
Location: Heart of Texas

Nice via layout TA Wink

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas
DB Custom wrote:
Nice via layout TA Wink

LOL thanks, yeah I was just tossing them on at first but getting them evenly spaced was proving interesting so I figured why try? You see the results of that.

Texas_Ace
Texas_Ace's picture
Offline
Last seen: 2 days 12 hours ago
Joined: 03/24/2016 - 07:44
Posts: 8681
Location: Everything is brighter in Texas

Would these changes to the Q8 e-switch driver also improve with clicky drivers?

Starting to work on a 22mm tripledown driver and since I have a bit of extra space figure I might as well toss in the new parts if they would help.

The schematic I was using is above, it is just copied from reverse-engineering PD68’s design into diptrace (obviously there are too many 7135’s to fit on the board and I am sure other mistakes since it was an early experiment but you get the idea)

Tom E
Tom E's picture
Offline
Last seen: 19 min 17 sec ago
Joined: 08/19/2012 - 08:23
Posts: 12881
Location: LI NY

Texas_Ace wrote:
Would these changes to the Q8 e-switch driver also improve with clicky drivers?

Well, yes - for all 25/45/85's, might even be a benefit for 13A's. Not sure yet if DEL settled on final values of the caps and resistors though.

Only difference might be in the FET area - we are testing only with the SIR800DP, which I think all mods would equally apply to the SIR404DP (higher performance). For the other FET's, not sure, but can't hurt.

 

For us typical none EE's, it's hard to understand and justify at first. I've built 25 and 85 drivers where things seem to work ok, then seems like same exact build again, and it doesn't work - sometimes the resistor of FET gate to grnd fixes it, sometimes boosting C1 helps, sometimes I need to add a C2 (0.1 uF cap) to fix it. Then again, I'm not doing any of the testing DEL has done of worse case scenarios - high amps, low PWM values, etc., temperature checking of parts, plus the wear+tear part lifetime issues we can't easily test at all.

When the circuit results in spikes that are out of tolerance of part specs in the design, I guess it comes down to rolling the dice -- can you get an acceptable failure rate in mass production? WIll you get a decent life time of usage? Will you be creating a lot of unexpected heat? Will suddenly a new batch from the manufacturer be more sensitive to these out of tolerance voltage spikes than previous batches?

We run across bad drivers on occasion, and assume it's one of the parts, but could be the parts are 100% good, just that one part is more sensitive to bad spikes, or the particular traces or reflow on a board is making the bad spike even worse.

Pages