Adventures in TinyAVR 1-Series

276 posts / 0 new
Last post
Tom E
Tom E's picture
Offline
Last seen: 24 min 55 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14685
Location: LI NY

Ohhh, maybe the tinning method will work for me. Think gchart said the stencil didn't work well for him.

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

Hmm, maybe it’s because I’m using printing grade paste but I haven’t had any issues with stencils.

gchart
gchart's picture
Offline
Last seen: 13 hours 3 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

It’s been a while since I’ve used a stencil. I haven’t used one since getting new higher-grade paste. I need to try again.

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

So is that type 4 or 5, like described here: https://fctsolder.com/solder-paste-type-3-vs-type-4-vs-type-5/

I had to google it... smile Looks like 4, or better yet 5 is better for small parts/pads.

Is higher grade the type 4 or 5? Any links, let me know. Thanks guys!!

gchart
gchart's picture
Offline
Last seen: 13 hours 3 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

thefreeman wrote:
Hmm, maybe it’s because I’m using printing grade paste but I haven’t had any issues with stencils.

Out of curiosity, what thickness of stencil are you using? I think that could play a big factor as well.

And I’d have to look Tom, but I think I got the type 5 stuff. That and my old stuff was crusty and had been re-fluxed several times.

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

Mine is T4, it’s just that the printing grade one is less fluid, I think it’s so that it releases well when lifting the stencil, though I actually never tried stencils with the dispense grade (syringe) I have too.

gchart wrote:

Out of curiosity, what thickness of stencil are you using? I think that could play a big factor as well.

And I’d have to look Tom, but I think I got the type 5 stuff. That and my old stuff was crusty and had been re-fluxed several times.

0.1mm steel.
Oh I think puting flux in paste is very bad, I tried to put flux in some of the print grade to make it more fluid, one month after it didn’t work at all.

Tom E wrote:

Is higher grade the type 4 or 5? Any links, let me know. Thanks guys!!

I use Chipquik no fridge (quite practical) https://www.chipquik.com/store/index.php?cPath=470&page=1&sort=3a&osCsid...
Pot is print and syringe dispense.

But it’s not cheap

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

Ok, if I were to order this, I think I would want for solder paste:

https://www.chipquik.com/store/product_info.php?products_id=470011

and for flux:

https://www.chipquik.com/store/product_info.php?products_id=310017

I think the tack flux is the typical type? Not too thin, watery?

And definitely the leaded paste for me.

That paste would be amazing if refrigeration is not required. Any downsides?

Oh, by "print" you mean using stencils?

Update: Just found it on Amazon US, cheap but Halogen free: https://www.amazon.com/Smooth-Leaded-Solder-Paste-Syringe/dp/B08KRR7PV4/ref=sr_1_6?dchild=1&keywords=solder+paste+t4+syringe&qid=1629334633&s=hi&sr=1-6

Regular, leaded, more $$$:

https://www.amazon.com/Solder-Paste-clean-63Sn-syringe/dp/B07B3WXYM6/ref=sr_1_15?dchild=1&keywords=solder+paste+t4+syringe&qid=1629334633&s=hi&sr=1-15

 Ooops! My bad! Those on Amazon are not the Thermally Stable ones (TS...)

 

 

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

For the flux I use SMD291, it’s not too thin I think, the one you linked is a RMA type flux and isn’t described as ”no clean”, that said it’s still RO*L*0 I.e. low activity so maybe it’s fine ?

I haven’t noticed any issue with the no fridge paste, but mine only 6 month old.

Print grade (sold in pots, see in the datasheet) is specifically for stencil, it doesn’t work well for applying the paste manually, it doesn’t stick well and kind of stays on the tip of the syringe. I’ll test stencil with the dispense grade (sold in syringes) next time.

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

This is what I've been buying, current syringe from Jan 2021: https://www.amazon.com/gp/product/B017RSZFQQ/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I keep it in the refrig, but occasionally forget and leave it out for a day. It's really not sticking too well, and stays on the syringe as you described for the print grade. Not sure if it's from the age, leaving it out, or what. Think it's worse now though then it used to be, not sure. It's probably dried out some.

Yea, that RMA291 looks good - thanks! Now just wondering if I should commit to the $$$... Wish I had the ability to design and layout my own drivers frown. You two are doing great jobs on the drivers, btw!! Very jealous smile

 

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

Well without talking about the circuit design, it didn’t take me too long to learn how to use an EDA software (I use Kicad, I think eagle and easy EDA are also popular ?) just by following tutorials. Making drivers that fit in whatever host is quite rewarding.

For the circuits, FET+7135 are very simple and there must be some shematics on the forum, the linear driver above if it works properly I’ll share the schematic (the boards shipped a few days ago).

For the paste not sticking well, pre applying a thin layer of tacky flux helps (not too much otherwise the paste spreads out)
Using a small dispense tip is also better, less area to stick to, I use red plastic ones… hmm 24G I think it is (they are color coded). For precise dispensing, using a small syringe is incomparably better than the one the paste comes in, I use 1mL ones.

Edit : thanks for the compliments Blushing

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

Yea, I know the ATtiny85 FET+1's all too well, and have OSHPark drivers of them to accommodate just about anything, many dating back to 2017 from DEL and Texas_Ace mostly. CC linear and optionally a full FET with power efficiency and no visible PWM is preferred now.

Ideally, the most desired support would be having true regulated constant output (lumens) up til a certain power level, depending on the light's design, no visible PWM. Not sure if this requires buck/boost - think so? But certainly for a single cell driving a 6V or 12V LED, then boost is all that's needed, I assume. Same for just buck needed if 2S-4S cells, 3V LED. But certainly for single cell 3V lights, buck/boost with a wide open FET channel would be the best setup?

Gchart's runtime graphs on the SP10 Pro are dang impressive! (https://budgetlightforum.com/node/66910)

 

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

I have mixed opinions about buck boost due to their lower efficiency and low input current limit. The ones from TI are limited to a peak input current of 4 or 4.5A IIRC, which means that at 3V in they can boost to maybe 2.5A, the most powerful buck boost converter with integrated switches that I know of is the newly realeased LT3120 from Analog with 9.5A average input limit which is much higher and with four 25mΩ switches, better as well. But still if you look at the efficiency graphs page 7 it still dips significantly at higher current in boost mode.
At 2.6Vin 3.3Vout, it dips to 70~75% at ~2.9A out and quite steeply, the graph page one shows 3V to 5V at ~2.9A with 80% efficiency so that’s better, might be able to do 4A at 3Vin 3.3Vout.

It’s quite expensive so I hesitated buying some when there was a few available early July, now it wont be available until mid 2022. It has a relatively larger footprint than TI buck boost converters.

I think for single LED it can make sense, for multiple LEDs I’m less convinced since with the lower Vf a linear driver or a buck in dropout are still able to push some current.

About the FET+ buck-boost topology, it has the issue (with Lume 1 drivers) to not have PWM dimming on the FET channel
One reason is the noise generated due to the 4kHz frequency, but TK new PWM code should solve that.
The second reason is that the FET and BB channel can’t be ON at the same time contrary to linear/7135+FET.
For the latter you ramp up the CC channel to its max say 3A, then the FET starts to add brightness on top of that.
With the former you ramp up the BB channel to 3A, then when the FET turns ON the BB must be OFF, but since FET is unregulated we don’t know what duty cycle gives us 3A and I it is Vin dependant so that we can’t ramp up smoothly from there.

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

I thought Zebra was known for compact buck/boost, but maybe amp limited, but thought they were one of the best efficient drivers. I don't really know the details though. I'm sure you are right.

Where I work they just bought $75K worth of parts from brokers, like twice the regular price, but will get us about one year in production. It's scary, desperate times.

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

The SC64c actually uses a 3A buck converter. The SC/H600 MKII did use a buck-boost, I don’t know about the other 3V models.

Quote:
Where I work they just bought $75K worth of parts from brokers, like twice the regular price, but will get us about one year in production. It’s scary, desperate times.

Yeah, yesterday a bought some boost regulator, a few minutes after that they were all gone from Mouser and Digikey, even the ones in order for the end of the year, that was close Shocked . I was actually wondering if with the current situation there might be scalpers.

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

Ahh, so if the SC64c uses only a buck, it would drop output/amps when the battery drains below a certain level, least on the high modes?

Forsythe P. Jones
Offline
Last seen: 6 days 8 hours ago
Joined: 08/15/2021 - 00:40
Posts: 413
Location: California

I saw somewhere a mention of a shortage of these parts, but Digikey claims to have 5000+ of them (3217) in stock right now. I suspect the commercial lights are using 32 bit parts now, and we (Anduril fans) should be looking in that direction too. They have features we will want someday, that will never fit in an AVR. Examples: USB PD charging, powerbank function, OLED screen, etc.

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

Link here: https://www.digikey.com/en/products/filter/embedded-microcontrollers/685?s=N4IgTCBcDaIIYBcEEsB2BPAzGAjAdhAF0BfIA.

All the 17's (1617, 3217, etc.) are 24 pins with extra I/O, but in the bigger 4mm x 4mm package, compared to the 1616 at 3mm x 3mm. 

Commercial lights mostly use lower grade MCU's, not more advanced. All depends exactly what you are talking about w/commercial lights. 32 bit MCU's are fairly big footprints, costly. Projects at work use them for high end controllers on fairly complex boards, having to do some complicated tasks. It's hard to describe, but a flashlight is a simple device compared to most use cases of MCU's.

By 32 bit parts, do you mean a 32 bit MCU or 32K bytes of flash? The ATTiny's, and actually all AVR's are all 8 bit processors (https://en.wikipedia.org/wiki/AVR_microcontrollers)

What I do like about the 24-pin VQFN at 4x4 is the pin spacing is larger than the 20-pin VQFN, 0.5 mm vs. 0.4 mm - should be easier to reflow.

 

SammysHP
SammysHP's picture
Offline
Last seen: 36 min 33 sec ago
Joined: 06/25/2019 - 14:35
Posts: 981
Location: Germany

I assume there is no DIP package available for the tinyAVR 1 series? Would be great for breadboard prototyping. Otherwise I’ll have to reflow it to an adapter PCB.

Forsythe P. Jones
Offline
Last seen: 6 days 8 hours ago
Joined: 08/15/2021 - 00:40
Posts: 413
Location: California

Tom, oops, I didn’t mean to imply “most” commercial lights, just that there are some fancy commercial lights with features Anduril doesn’t support and probably would be difficult with an AVR. By 32-bit I meant 32-bit MCU like ARM or RISC-V. I’m a programmer but not really a hardware guy, so I trust your wisdom about circuit board difficulty. One thing I’ve wondered in particular is how difficult it is to use WLCSP packages, which are very tiny.

Here is an example of a fancy commercial light that would be hard to implement with Anduril/AVR:

https://www.fenix-store.com/fenix-tk72r-rechargeable-led-flashlight-9000...

Add to that, it seems like most Anduril lights other than Hank’s are quite difficult to reflash, and Hank had to make special arrangements like his USB dongle. The AVR1 makes it easier but it would be a lot nicer to have a USB-rechargeable light with 2-way USB communication, so that if you wanted to change the firmware or customize the UI, you could just plug the USB cable into your computer and customize away. So that means the MCU needs a boot loader and a USB comms stack. It might also be possible to handle li ion charge control in the software instead of using a separate board for that.

Here’s the Pine64 Pinecil soldering iron, which is controlled by a 32-bit RISC-V processor: https://www.pine64.org/pinecil/

We can think of a soldering iron as a type of deep-infrared incandescent flashlight, so the control issues they face are not that much different than ours. Their MCU is a GD32VF103 which is similar (basically a clone) of the ST32F103 except VF instead of F designates RISC-V instead of ARM. They also have ARM versions. It is a very nice chip with analog i/o galore, that supposedly costs under $1. Here is a dev board for it:

https://www.seeedstudio.com/SeeedStudio-GD32-RISC-V-kit-with-LCD-p-4303.html

I agree that the package for that chip is rather large for a flashlight. I believe there is a QFN version that’s a little smaller, but something even smaller with fewer pins as needed would be nice.

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

Hhmm, I don't think a display is a stretch for Anduril on a AVR ATTiny. There was one, maybe two threads here on incorporating a display with a custom driver and think they used a PIC, but still an 8 bit MCU. Even with 16K Bytes, the build I've done for the 1616 is still like 9200 bytes, so 44% code space still available.

Here: https://budgetlightforum.com/node/51125 and https://budgetlightforum.com/node/71948

Some Background:

https://budgetlightforum.com/node/51735

https://budgetlightforum.com/node/74331

https://budgetlightforum.com/node/30613 (goes back to 2014)

I found he mentions: PIC16F1575, but not sure that was the only PIC. tterev3 was way ahead of his time here on BLF, and many of us didn't really know what to do with this tech.

I don't know, the more I read about these mods, there was little we could do but be amazed. Too difficult for most of us to do those type of mods, didn't hook up with a manufacturer or even someone who could make the parts that I know of. He did post source code at one point but think it was written in ASM, if so, difficult to work with.

I was very interested in the MELD RGB stuff at the time, but was scared off by his abilities with micro wiring - didn't think I could do it. tterev3 is super talented in many ways.

For the I/O to a OLED display, I believe the USART/SPI/I2C would have it covered.

His latest EC01 mod uses the PIC18F26K40.

 

 

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

Forsyth P. Jones wrote:
One thing I’ve wondered in particular is how difficult it is to use WLCSP packages, which are very tiny.

Their MCU is a GD32VF103
I agree that the package for that chip is rather large for a flashlight. I believe there is a QFN version that’s a little smaller, but something even smaller with fewer pins as needed would be nice.

The QFN version is apparently 6×6mm which in a multi cell light is a totally acceptable size.
WLCSP uhh…
Firstly with the basic affordable capabilities of board houses you can’t fit traces between the pads (looking at a STM32 WLCSP with 0.4mm pitch), using vias to route on the other side requires a special capability called filled via otherwise the solder will fill the via and could make poor contact to the chip’s pad.
So theses manufacturing requirements (and maybe other ones) will make the PCB significantly more expensive.

Secondly for hobby makers like us the soldering is a bit scary, I suppose it can be done with paste and precise stencilling, but I think manually placing balls would be more reliable (I’m just guessing, never done that) but time consuming.
If anything goes wrong during reflow you have to start over from the beginning, whereas QFN bridged pads can be easily fixed with a soldering iron.

Forsythe P. Jones
Offline
Last seen: 6 days 8 hours ago
Joined: 08/15/2021 - 00:40
Posts: 413
Location: California

I don’t know if this link about the avr-1 hardware is already in this thread, but I just came across it and found it pretty informative:

https://jaycarlson.net/pf/atmel-microchip-tinyavr-1-series/

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

I've come across the JayCarlson website before, probably this article. It is a pretty good article, though would be nice if it was more active with comments, and updated. Maybe Gabe can add a link to the OP.

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

The programming key linked in the first post is the older one (with UDPI in the middle).

gchart
gchart's picture
Offline
Last seen: 13 hours 3 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

thefreeman wrote:
The programming key linked in the first post is the older one (with UDPI in the middle).

Good catch. Updating the first post now…

https://oshpark.com/shared_projects/Nf5s0GMe

I need to go through and update that first post a bit. I’ll add Tom’s link later today. I also want to add another driver and info about using serial adapters and pymcuprog to flash.

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

gchart wrote:

Good catch. Updating the first post now…

https://oshpark.com/shared_projects/Nf5s0GMe

I need to go through and update that first post a bit. I’ll add Tom’s link later today. I also want to add another driver and info about using serial adapters and pymcuprog to flash.

Cool Thumbs Up

I’m making a series of linear drivers with high dynamic range, I received and tested the one mentioned above. I’m making some modifications and others sizes and I’ll make a new post for them with building info.

gchart
gchart's picture
Offline
Last seen: 13 hours 3 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

Awesome, looking forward to reading more about it!

gchart
gchart's picture
Offline
Last seen: 13 hours 3 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

Ok, I’ve added a few things to the first post.

One thing worth calling out… I’ve recently been trying to come up with a more universal and accessible flashing method. I think I’ve settled on one.

  • Uses a USB to Serial TTL adapter such as one built on the CH340 or CP2102. I’ve even built one from scratch. Note, on the CP2102 style I had to disable the LED that was connected to the RX pin (bad design!). And the one I built from scratch, I had to thicken the USB port area so it wouldn’t fall out of the port (typical PCBs are 1.6mm thick and a USB slot needs around 2.2mm).
  • Those adapters are cheap and easy to come by. If you do stuff with Arduino or other dev boards, you might already have some sitting around.
  • Use the pymcuprog utility to flash firmware. This utility is open-source, based on Python (install using pip) so it can be used on any platform, and was actually created by the folks at Microchip.

thefreeman
thefreeman's picture
Online
Last seen: 5 min 51 sec ago
Joined: 01/06/2020 - 09:56
Posts: 871
Location: France

Ah nice you made a serial programming oshpark board Thumbs Up

Regarding the SOA for the frequency, the limit for 10MHz seems to be 2.7V, so if there is diode before the MCU VCC falls a bit under that just before LVP, I guess in practice it’s not a problem, that’s how it is on the driver you made ?

Edit : if I can suggest to add holes for pins/dupont connectors to it, when flashing a driver with a different programing pad layout (or with just UDPI pad)

gchart
gchart's picture
Offline
Last seen: 13 hours 3 min ago
Joined: 03/19/2016 - 11:57
Posts: 3158
Location: Central IL

Actually, I should clarify… that’s not my board (I am not Stefan Wagner). I just downloaded his gerber and ordered the parts. Since his creation of that, there has been an update to the UPDI serial recommendations to use a diode to connect the RX and TX pins. So I used his PCB design but actually ran a 1.5K resistor + Schottky from the TX pad to the RX instead of using the existing pads meant for a 4.7K resistor. I think the original layout technically works, but isn’t as clean/reliable of a solution.

Regarding 10MHz down to 2.7V… I should do some more testing on that I guess. This is one reason why I think it’s better to use PFETs instead of diodes for reverse polarity protection. It’s not dropping voltage and therefore increases the accuracy of a voltage read against the VCC pin.

Pages