[WIP] 15mm PAM2803 w/ ATtiny13A rough layout / possibility

@all: I used the stock Nanjg-105d firmware from FT to avoid a late night flashing session. FWIW the relevant RDSON figures are those in the VGS range of LED Vf to PAM2803 overvoltage protection.

@RBD: It appeared to be the full amount of current, but I did not put a meter on it. It was past my bedtime.

@HQ: Thanks for rechecking HQ - that jives with my own checking. Even if you only reminded me twice, I probably appreciated it both times. Since I was running the Nanjg ontime firmware I did not install an OTC.

I will now try shorting the output cap, maybe the pulldown is not fast enough.

First off, I appreciate the time you both are investing in this and I hope you two don’t mind my input but please consider me a voice of ignorant curiosity and anything I learn is shared with others. If at any time you wish me to bugger off just let me know and I’ll do so.
With regard to theRdson I just assumed that the Vf is around 3V with an LED current ~1A so that would be the voltage available at the gate and that the ratings at 4.5V and 10V were not as critical as the expected Rdson value at 3V. This might be completely wrong if the boost voltage is spiking but that’s a bit above me. I don’t have a preferred fet but as HQ asked about other possibilities I chimed in along with my reasoning.
Until there are preprogrammed ic’s available for this all I can do is mess around with transplanted ones but I still enjoy the puzzle and the process.
As far as driver space goes, what can I say? I cheat and if I need more room I make it but I can certainly understand the requirement to keep it one sided if possible.
Thanks again guys.

Based on my fidding over the past hour the driver pretty clearly works. I just can’t remember / don’t know how to change a firmware over to properly support this hardware configuration (PWM on Pin 5). I have been able to do this in the past. It should be pretty straightforward stuff, but getting everything setup correctly is just way beyond my patience right now. (It requires knowledge of setting up the AVR’s registers which I have lost.)

I should have fixed the pin5/pin6 discrepancy on the PCB some time ago so I would not have to worry about this.

In the meantime I can turn the light on or off depending on what firmware I flash. :-((

Follow up: Just to be 100% sure that the driver was working normally I flashed STAR (ontime) on there and then bridged pin 5/6 again. Modes worked fine. At this moment I have very limited desire to figure out the right register settings to get output on Pin 5. I’ll simply correct the PCB to use Pin 6. The next steps are really testing how necessary the pulldown resistors are!

You’re certainly not bothering me.

OK, this is the last test before I call it quits for the evening; the results are good I think.

I have removed both pulldown resistors and the circuit seems to operate just fine. I had 3 modes beforehand and I still have 3 modes now. At the moment it looks like we can get away without having them, although using the OTC may change things. OSH Park ~

To get PWM=1 lower it may be necessary to drop PWM frequency.

That’s good news wight.

+1 I’m excited that there is significant progress being made RE: programmable boost drivers!

No, me neither. I’m truly unsure where I got you on the wrong foot but I did not mean to if I did.

@wight

congrats, good to hear you got it working

Firmware Pin6 to Pin5: With Star Ontime it’s not that straightforward anymore ever since it uses dual-channel and fast/phase.
It’s easier with DrJones Minidrv, just in case you don’t want to wait…
DDRB=1; // (2) // PB0 (pin5) instead of PB1 (pin6) as output
TCCR0A=0b10000001; // (0b00100001) // PhasePWM for PB0 (pin5)
OCR0A=modes[mode]; // (OCR0B) // use output compare register of PB0 (pin5)

Mode change: Did you try 1xAA or 2xAA or both? 2xAA was the critical part, losing the PAM2803 w/o the 2 resistors.

PWM=1
I just tried 3 frequencies and it’s the same as with linear driver, the higher the frequency the lower the output on low levels.
4.7 kHz (fuse 65) : 25mA
18 kHz (fuse 75) : 15mA
37.5 kHz (fuse 7a) : 9mA
This is with fresh cells of course. No difference between 1AA and 2AA.
Is 37.5 kHz (9.6MHz cpu, FastPWM) the upper limit or can a higher PWM-frequency be reached?

came across this driver at KD:


http://www.kaidomain.com/product/details.S009810
13.5mm 5-Mode Circuit Board for AA/AAA Battery ( 5pcs a pair)

Looks like a boost driver with Attiny-like MCU. Has anyone ever bought one, is this interesting in any way, or is this project way past looking at drivers already in existence?

HaHa! I don’t think that driver has anything on what’s being built here:

Still interesting though, for small, low output lights.

Wait a minute! Are they serious? 1AAA 3W LED Voltage-step up 10mm circuit board (19 modes 3 groups)

Can you really get 800mA from a single AAA cell?

Sounds like it functions but still a wip so probably some unknowns for discovery in field testing and obvious questions like a bleeder resistor for LTC (maybe in 2cell lights bypassing boost IC).

Hmm. The pictures are low quality, but I see on top:

  • inductor
  • SOIC8 IC (same physical size as common ATtiny or PIC MCUs)
  • SOT23-3 (identified on PCB as Q2?)
    and on the bottom:
  • SOT23-3 (at top)
  • Capacitor (identified as C1, top right)
  • Diode (D2 on left)
  • Capacitor (C2 on left)
  • Diode (D1? on right)
  • SOT23-3 (Q1? at the bototm)

Transistors are often packaged in SOT23-3, but that seems like a lot of transistors. Sometimes “Modes chips” (simple purpose-built PWM flashlight driver controllers) are packaged in that form factor as well. MCUs, MOSFETs, boost controllers, and many other things can be packaged in SOIC8. We can assume that this on is not a MOSFET since all the pins aren’t together on the PCB traces.

This is at least vaguely interesting for now, but not enough for me to order some.

Meh. It’s different and using 100% made up [eg imaginary] specifications. Who knows what it is.

To get 800mA output the driver should need >2A input. This is quite possible with LSD NiMH AAA, but not with Lithium primary AAAs.

Thanks a lot HQ. I remembered some of that when trying to get STAR ontime working the last time, but clearly not enough! I even tried Minidrv since I knew you’d been using it for testing and it’s so straightforward. I was missing something or making a mistake. Who knows where, I didn’t save the code. Doesn’t matter, it’s working now (STAR ontime).

I went ahead and tested about 20-30 mode switches on 2xAA. They were resting at >1.2v each. Nothing bad seemed to happen. :slight_smile:

  • Sorry I got confused about the PWM freq stuff. Maybe we should try PWM=0/255. That’s “a thing” with either fast or phase correct, but I forget which. If necessary a new firmware could be written with soft-PWM to go lower.
  • Offhand the datasheet seems clear about the PWM calculation. w/ a prescaler of 1 FastPWM = clk/256. That said I am very rusty at the moment and this might be a better question to ask in a firmware thread.
  • IIRC increasing the PWM freq can significantly affects the response curve for the thing receiving the PWM. In other words we get “mode compression” where the modes shift towards high or low.

Disclaimer: I didn’t compare “Phase Correct PWM” with “Fast PWM”. Just looking at Fast PWM, 0/255 = ~8mA input current while 1/255 = ~16mA input current. On the output side that seemed to be ~1mA vs ~2mA. All of this was measured using a free HF DMM set on the 10A scale, so very rough measurements. I’d say that it’s still probably not low enough to really be a ‘low’ moonlight… but I didn’t try it in a flashlight or in the dark.

I think this is the same driver HKJ has tested here
It’s only 1xAA.

800mA with 1.5V perhaps, but not with a single AA/AAA. Extrapolate the light blue line (current in) to 1.5V and you would need about 3.5A input current without voltage sag to get an output current of 800mA…
With a bench power supply it might work.

As far as I remember I checked all of HKJs driver tests when looking for a good boost driver. The drivers based on the PAM2803 (nanjg110 and our Fasttech-driver, HKJ tested both) had a better efficiency than this one and were only topped by the LD30 which is much more complex. But I did this long before this thread started when I hadn’t hoped to get a driver with good modes.

If you want to compare drivers you can find a remarkably long list of tested drivers on HKJs website
www.lygte-info.dk/info/indexLedDrivers%20UK.html

Very good. As I said I was very reluctant to burn my scarce PAM2803 (a real nuisance that they can’t be sourced in small numbers), but that would give me enough hope to try a built without the resistors.
I’m yet unsure whether I will remove them from my design as long as nobody can tell us for sure what they are for in the FT-driver, but it would certainly free some space. The 15mm driver is very tighly packed, small pads, and just so to avoid clearence errors. Not really easy to build…

.

That’s a good one, I had completely forgotten about this 255-not-truly-on / 0-not-truly-off issue. And I had only tested FastPWM modes with 3 frequencies, not PhasePWM. No reason behind it, was the quickest way to programm. Will try other values.

Just for the record: my results (25/15/9mA) are LED current, not input current. Measured with a shunt between driver and LED. Darn bright.

Calculations are fine, I had made a table for comfychair ages ago, will include it below.
37.5kHz would be possible only with FastPWM/divider1/9.6MHz and that might be the highest frequency. Soft PWM is above me.

PhaseCorrect FastPWM
kHz CPU freq divider fuse CPU freq divider fuse
1.2 kHz 4.8 MHz :8 0x65
2.4 kHz 9.6 MHz :8 0x6a 4.8 MHz :8 0x65
4.7 kHz - - - 9.6 MHz :8 0x6a
9.4 kHz 4.8 MHz :1 0x75 - - -
19 kHz 9.6 MHz :1 0x7a 4.8 MHz :1 0x75

CPU frequency is set by the fuse (Low Fuse bit 0 and 1) and “#define F_CPU” should be set accordingly.
PWM is set by TCCR0A (where 0x23 is FastPWM and 0x21 is PhaseCorrectPWM)
The divider is set by the fuse (Low Fuse, bit 4) and can be :1 or :8

This way you can reach 19 kHz with Phase correct PWM and Fast PWM.

In addition you have the prescaler (TCCR0B) which is not the divider. You can combine divider and prescaler and set them differently.

  • Ah, that’s right. I remember referencing your table in the other thread. :smiley:
  • I’d rather avoid getting into soft PWM because (a) that’s firmware stuff I’d rather avoid and (b) I’m pretty confident that it will increase power usage by the ATtiny a lot.
  • Caution made plenty of sense in that case. I’ll be sure to post here if I burn one, but it seems fine so far. Looks like PAM2803 has gotten cheap on AliExpress: $0.20 USD /ea in QTY=10 seems good to me!
  • In fact, with cheap PAM2803 available in reasonable quantities the door is open to fully scratch-built drivers. Too bad that “good” inductors cost as much as the whole FT driver. I wonder how much advantage there is to using one which is properly specced. I assume that the one on the FT driver saturates or acts badly a lot of the time.
  • TK points out over here that LVP can still be useful for a AA boost driver. Using “low” modes extensively can easily pull batteries way, way down without the user noticing.
  • I think that these drivers may end up being reflow only. Proper hand-soldering pads for the inductor will eat a lot of space.

OK, pursuant some of those things… v22 switches to the Coilcraft XLF4020 footprint (here is the Eagle part I created for it - note that the tDocu markings are the full maximum 4.3x4.3mm the datasheet allows for). This is by no means a final layout; it is just food for thought. RSENSE has been reduced to 0603. R1 is under the MCU, R2 is to the right of the MCU. They should be spaced properly for the clip. The XLF4020 footprint should accept the inductor from the FT donor board. Looks like I forgot to hook up the OTC.

As can be seen, there is plenty of room for LED- but not enough room for LED. Looks like progress to me though. Ah! I should just move C (OUT) to the left. LED can be located between C (OUT) and the diode. Hmmm :slight_smile:

EDIT: I forgot to mention (a) doesn’t pass DRC but it’s close (b) apparently I’ve been using a 0.75mm keepout for this project for a while.