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

For most folks? Not a good idea. For a very determined individual? Maybe. My biggest concern would be delaminating the PCB. The pad on the left is easily doable - that’s basically just a normal exposed pad like any other component. If the layout doesn’t change any I think that there is space to expose copper for the right-hand pad as well.

Determined he is, clever he is not. I think Yoda needed a good flashlight. Thanks Alex, I’ll try it.

LVP included, very well.
The OTC does not block the SOIC-clip?
I had worked with a similar inductor-part before, but even if reflowing: you can’t see whether the solder is done. The inductor is all copper and ferrite and eats a lot of heat. That’s why I used these halfmoon pads which are just so much to the edge that you can see the solder paste and the reflow result.

Just for the record the PCB Layout Guidelines from the PAM2803 datasheet:
“The input capacitor and output capacitor should be placed respectively as close as possible to the input pin and output pin of the IC; the inductor and schottky diode should be placed as close as possible to the switch pin by using wide and short traces for the main current path; the current sense resistor should be placed as close as possible between the ground pin and feedback pin.”

When I stare at my 15mm board the design is really not prone for adapting to the LVP. scratch head

Any idea at which voltage the LVP should cut off in low mode?

I’m busy til sunday, but can’t wait to crash-test some drivers.

  • Good point. The OTC probably does block the clip. I forgot that my “guide” measurements are for a closed clip, I need to allow for room to put the clip in place. This OTC is in the same place as earlier versions… but I haven’t yet populated the OTC on the v18 I built. Oops!
  • The layout guidelines just say “as close as possible” - I think my parts are pretty close together since they are all under 15mm. :wink: On a more serious note, they cover 5 components in their placement guidelines. As far as Cinput and the inductor, they are more than close enough. The Schottky diode is a little farther away but <6mm. The sense resistor is about 3mm away from it’s closest possible placement. Coutput is by far and away the worst offender here at maybe 8mm away from it’s best possible placement. I’ve [apparently] already gotten away with that on the existing v18 design and I continue to not be too worried about it. Take a look at some of these boost IC evaluation boards. They certainly vary, but some of the placements are actually quite far apart. … all that said, I do plan to thicken traces and improve the layout where possible, unless I just come up with a whole new layout.
  • RE: “the design is really not prone for adapting to the LVP” - (a) Your current board has many more components than my previous board! (b) To adapt my own board I first added the LVP resistors to the schematic and started poking around. It did not look good. Next I just ran the command “ripup;” which rips up all traces. At that point I scooted/rotated things around until they looked better, laid down a few traces, then shuffled some more. Using the schematic really helps IMO.
  • Good cutoff’s would probably be 1v and 2v based on TK’s thoughts and HKJ’s measurements. [WIP] 10mm DD+single-7135 driver: double sided 10440 torture for Dual-PWM - #128 by ToyKeeper

While fast PWM 0/255 does generally work, it has also been rather unstable on every device I’ve tried. As one example, I was getting 3 lm on a full cell, 0.1 lm at about 3.9V, and barely enough to see the LED at 3.6V. Nothing at all below that.

Phase-correct PWM at 1/255 is much more stable at different voltages.

Then again, I haven’t tried anything remotely like this boost driver. It might behave very differently.

At a guess… If it has only a FET and no constant-current channel, moon mode probably isn’t feasible. OTOH, you might be able to add a separate moon mode with a simple resistor from a MCU pin to the LED. The MCU should be able to power the LED directly. No PWM necessary, and I think the MCU can even go to sleep with an output pin high. So, it might be pretty efficient.

Just an idea. You know, for when you find extra room on the already-cramped board. :slight_smile:

TK, I’d say that this is pretty different from the FET/linear drivers you are accustomed to. Like 7135 driver the base circuit here (from the PAM2803 datasheet) attempts to provide constant current. Unlike the 7135 this circuit has the ability to pull more power from the battery as input voltage drops. With only 1xAA ouput current is not actually constant AFAIK, but I speculate that results will be better than DD & linear drivers. I could be 100% wrong about this next bit, but I suspect that having a low-duty-cycle PWM (like PWM=0/255 FastPWM) will probably allow the PAM2803 to perform a good bit better than the datasheet shows. (Better in this case meaning more able to drive the 0/255 at a consistent level.)

RE: driving the LED from an MCU pin w/ resistor. That’s an interesting idea for this situation. When the normal output PWM channel on the MCU is turned completely off the PAM2803 will boost to almost exactly 5v and stay there. I’m assuming that this should give much more consistent output than any DD or linear driver attempting this approach. Choosing a load resistor is a simple matter of using any online LED calculator, they all expect a constant input voltage and that’s what we’d have here (5v).

Earlier today I realized that I had an important question for you RE: this driver. What’s the state of offtime without the cap? I know it’s workable, but what are the details?

Offtime without the cap generally works fine as long as you don’t care about having more than “short” and “long” and don’t need to tweak the threshold between the two.

The attiny’s SRAM basically has either decayed, or it hasn’t. At least, when looking at a single byte. In my experiments, this happens at anywhere from 0.3s to 4.0s, depending on how long the rest of the circuit takes to settle. On a nanjg driver it’s about 0.5s. On a FET+1 it’s generally about the same. But if there is an OTC, and that OTC is charged, the SRAM decay doesn’t happen until after the OTC has discharged most of the way.

In general, most of the SRAM bits decay to a “1” state. So, set a byte to 0, read that byte on boot, and if it’s still 0 you know the light hasn’t been off for very long.

IIRC, something like two thirds or three fourths of the bits decay to a “1” state. So it’s possible that the selected byte could just happen to decay to all zeroes, but it’s very unlikely. The chance is something like 1 in 20,000.

Using this trick to store values between boots is somewhat more risky if there is no OTC or other power source to sustain the data for a few seconds. The long/short detection byte might be all zeroes, but the data byte(s) may have had a bit decay. The time window for this is pretty short though, and risk can be reduced by using more than one detection byte… Still, any genuinely important data should be stored somewhere more stable. Or use a different method to measure time, and only trust the decay-prone data when the time is safely under the limit.

That’s probably more detail than necessary, but hopefully it gives you more of an idea what to expect. The attiny can hold values in SRAM until it runs out of power from other components, and this is around half a second on most BLF drivers.

So the 2803 has both a switch pin and Vin, can pwm be applied to the switch obviating the need for the fet?

@all - measuring input current on my HF DMM it seems really nonlinear vs PWM. Could be PWM confusing the DMM though.

Heh, I’ve had the same genius idea myself several times. Eventually I have to snap myself out of it - the unfortunate and in-hindsight-obvious answer is no. The MCU won’t run if the PAM2803 shuts down, it is bootstrapped on the PAM2803’s output.

I suppose it actually isn’t obvious if you haven’t read the OP in a while or aren’t familiar with the term bootstrap or it’s use in this context… OK, so here we go. The MCU (ATtiny) won’t run on low voltages like 0.9v, but the PAM2803 will. We currently have the Enable/Shutdown pin on the PAM2803 tied to Vinput, so it turns on as soon as battery voltage is applied. The PAM2803 uses a sense resistor to do CC (constant current) output, so once it turns on it will drive the LED at the current set by the sense resistor. (On 0.9v input it won’t do a good job, but it will try). Generally speaking this means that we’ll get something like 3-4v output from the boost circuit (to match LED Vf at the set current). The MCU is attached to the same output as the LED, so the MCU doesn’t start until after the PAM2803 starts boosting. The LED is hooked up through a transistor and once the MCU is up and running it can PWM that transistor. During any time period where the LED is not hooked up the sense voltage drops to 0v. The PAM2803 will attempt to increase the sense voltage (eg the sensed output current) by increasing output voltage. We depend on the PAM2803’s overvoltage protection here: the PAM2803 has OVP set at approximately 5v. The peaks are within the MCU’s regular maximum of 5.5v. If we were turning the whole PAM2803 off here it would be like blipping the clicky switch.

Other stuff:

  • The “Switch” pin isn’t what you think it is. Switch is a pin which the PAM2803 will momentarily connect to GND as part of the boost circuit’s operation. “Shut Down” / SHDN is the pin which would turn the chip off (and we can’t use for the above reason).
  • I had something else…

EEPROM isn’t strictly required in order to make a useful driver. I suspect it can still use the memory decay trick for short-term memory and offtime measurement, meaning it could run a multi-mode interface. I have several firmwares which work without eeprom, and even one example code base for use on an attiny10 processor.

I think I understand but allow me to display yet more of my lack of understanding. There is a cap on mcu Vin and another off time cap. I assume with the boost ic off and no fet to cut current to the LED that voltage remaining on the Vin cap would drop through the LED very quickly. Would a diode between led+ and mcu Vin prevent that drain and allow the mcu to stay awake between pwm pulses? This is where you get to stomp on me. I would consider it a catharsis for past sins. >:-/

I had wondered that too. I can think of at least two sitautions where it wouldn’t work though, even if it’s fine for normal PWM.

It probably wouldn’t help at initial boot time (boost still needs to come up first), and it wouldn’t allow for longer blinky modes like a beacon.

Adding diodes like that gets tricky. We push high voltage through the Schottky diode and into the output cap. Currently in my layout that cap is all the smoothing we have for either the PAM2803 or the ATtiny (or the LED).

I’d show my schematic to help, but it wouldn’t help: my schematic has a terrible layout and the PAM2803 is represented by a QX5241 because I was too lazy to make a new part. It’s hard to follow IMO.

I’m pretty confident that the PAM2803’s Pin5 (Vout) requires a cap. The MCU definitely requires a cap. The LED could maybe get by without one. So at a minimum we move from 1 cap to 2 caps and 2 diodes while dropping the transistor we use for PWM. We might (probably) still need a bulk capacitor on the output to keep it decently smooth, I dunno.

…And all that depends on the MCU running on that capacitor. EDIT: plus TK’s points are correct as well.

I was wondering about that too. Do you think it might be feasible to smooth out the LED power to turn FET PWM into something more like a constant current? Would that require a ridiculously huge capacitor? Am I trying to give a bicycle to a fish?

I think TK’s comment on initial boot makes sense(also the only part I understood, oof!) since with shtdn tied to pwm the boost ic wouldn’t be able to turn on to waken the mcu in the first place. Logic trap.

bicycle/fish. To smooth out PWM you’d use a big RC circuit, but as you said the cap would be ridiculous.

IF we had the space, and we don’t, we could attempt to bias the FB pin using an op-amp and a small voltage source based on an RC circuit which was fed with PWM from the MCU. EDIT: this is something I’d like to play with in 17mm though.

Good enough, heh. :slight_smile:

Keep these explanations up wight and you may have me understanding whats going on. :slight_smile:

Bumping a good thread. Anything new?

Hi RBD
Thanks for asking.
I’m still on this project and will be prodding further when I wrapped up HQ10D, UniversalBreakoutBoard and BLF SRK FET V3.
Just as time permits.
Short status here:
HQB15 works fine
After what the scope guys brought up I will keep the 2 resistors in the design
Cell gets drained very quickly without LVP although the led is off.
I strongly doubt our usual Lvp will work in 1aa config (no voltage for mcu to regulate anything.
I even have doubts that lvp by cutting pwm to the fet will work at all, as the boost circuit is not cut (i want to test that).
I’m about to make the 17mm version based on the SS24 diode, hoping to make it easier for others to try this if they want to.
CU

Is there any type of component which would be open by default, but which could be closed to block current when it receives a signal? (then would stay closed until power is disconnected and reconnected)

If so, something like that could be used for LVP. Put it before the boost circuit and it could maybe cut the power on command. I don’t know if something like that exists though.