Attiny25/45/85 FW Development Thread

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.

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.

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.

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: Guided Tour - DipTrace

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.

Nice via layout TA :wink: