here is the LD-29 MCU pinout (eg how to put your ATtiny13A in there...)

First of all: sorry Cereal_killer, I have no immediate plans for more photos. I’m really off of taking pictures right now. That’s why I’ve only been using my phone and only posting shots I deemed necessary. Also I don’t have a stock LD-29 available to put it next to.

That said, there’s really nothing you need to know that you can’t glean from what I wrote and the pictures I took.

I have no idea what the state of the PIC controller is.

My new one is from FT. I’m sure you’ll get the same thing, the listing on FT actually says that it’s the updated version.

I have not taken an in-depth look into the matter, but my current assumption is that the new version is just a simple refactor to make better use of space with the savings from going SO8 to SOT23-6 on that N-Channel FET.

May I ask what motivated your switch from Atmel to Microchip?

Hey man, can you post / email me the FW you have that gets the driver to run high only? I tried this (both as-is and after removing the STAR2_PIN=PB0 and references to it).

Also what way does the adapter go on? with the pin1 dot up and in the factory orientation and the 13A pin1 goes aligns with that?

Hey Cereal_killer, let me review the facts this weekend and make sure I don’t tell you a lie ;-). I haven’t worked on this in a little bit and I’m getting fuzzy myself. I have yet to install any of these PCBs (I have v6 and v7 in hand though). I just had the thing hard-wired, even worse than dead-bug style.

For now I’ll tell you what I think I know:

  • Orient the adapter PCB so that the BLF marking is against the LD-29 PCB. Orient the dot mark for Pin1 with Pin1 on the LD-29.
  • The code I linked to in the post you quoted is the last thing I messed with. IIRC I foolishly used the offtime firmware? I dunno. Definitely a bad place to start, ontime should have been used for this stage of the project - offtime is the next stage. Dumb mistake on my part, I’ll re-do it when I get back to it (this weekend?)

Somewhere in this thread I/we discuss how to turn the driver on. There appears to be both an enable pin and a PWM pin. Just pull the enable pin high or low, whatever I said earlier, and then pull the PWM pin high… that’s 100% duty cycle, a state the stock firmware never allows AFAIK. Sorry for the brevity and lack of details, I’m pretty limited on the computer front right now.

Frankly I don’t recall if the pin configuration for that firmware matches the pin configuration for the v7 adapters. I will check into this.

I have measured the PWM frequency on LOW using the new LD-29 I recently posted pictures of. I measured the period to be 76us, which should be approximately 13kHz. This isn’t visible in the output signal, but we want to be in that general range w/ the output from our ATtiny.

My scope is not in good shape, so this is questionable, but it appears that the buck section is operating at around 444kHz (XM-L2 on the output, 8v on the input, medium mode).

Align the dot with the factory orientation.

Adapter pinout on top / ATtiny side:

  1. ( 4 ) - unknown function
  2. ( 6 ) - possible offtime cap
  3. ( 3 ) - enable pin for buck circuit
  4. ( 8 ) - GND
  5. ( 5 ) - PWM out
  6. (NC) - not connected
  7. ( 7 ) - voltage divider for monitoring battery voltage
  8. ( 1 ) - Vcc
    NC (2) - unknown function

I installed an adapter board on my old-version FastTech LD-29 today. I hooked up some airwires to the adapter and successfully enabled and turned on the buck circuit, as I would without the adapter board (Of course I had to use pin8 to pull 5 & 3 high). After confirming that that worked I moved on to installing an ATtiny13A flashed with nlite.hex

All our current firmwares do PWM on pin 6, not pin 5. Also, NLITE doesn’t know to pull Pin3 high. So in order to use NLITE we must install an airwire from Pin8 to Pin3. We must also jumper Pin6 over to Pin5.

0.8A 1.3A - 3.65A-
EDIT: 0.8A - 0.25A - 1.3A - 3.65A ….apparently the star for moon mode is pulled high. No big deal, but we’ll probably need to disable any “star” functionality in firmware used on this driver.

EDIT: Apparently I forgot that NLITE features LVP. No big deal, with such a high voltage on Pin7 I doubt it will kick in. We’ll deal with LVP in upcoming firmware changes.


I will be doing this tonight man, thanks for the details.

I’ve never ran Nlite before, in the stock FW moon should be on (so the pin being grounded turns it off) or vise-versa?

Should stock on-time STAR work also?

I’m still happy to be working on this project for the good of the conunity but it sort’a feels like backwards progress for me having just received my PICkit last Friday it’s strange to be removing a PIC MCU in favor of the ATTiny lol.

Heheh, well after a closer look, the normal Star2 is PB0, or pin5. Pin5 is where we put the PWM, so that’s interesting and all ;-). For NLITE you’d normally pull Star2/PB0/Pin5 low in order to enable moon. We happen to be shorting it to PB1 which is probably low while the code initializes (before PWM starts).

I’d probably remove any extraneous inputs, such as star inputs, from the code. At least a couple of pins are pulled high by the driver for unknown reasons, plus we are shorting Pin5 and Pin6. You can compile the stock code and use it, but expect unexpected results in terms of star config.

After realizing what a pain it was to have PWM on PB0 instead of PB1 I took another look at hooking up PB1 to Pin5 of the LD-29’s landing pads. Turns out it does fit, I think, so while I’ve posted in the STAR thread for details on how to change the code, I’ll almost certainly release a v08 to allow firmwares which are closer to stock to run.

Well man [I believe] I’ve followed these instructions exactly as posted, I’ve compiled and flashed this but i get absolutly nothing, any ideas?
note I only have a new version of LD-29

Hm, not sure why its putting my writing inside your quote, strange.

What version of adapter are you using? Pin4 has no GND however grounding it with tweezers doesnt help…

Ok I know you’ve said you cant be bothered to take / post a few pic’s of your new version driver but can you PLEASE? I didnt test my driver when it came and i’ve got the adapter removed back off it and none of the PIC MCU pad’s are GND! I also notice a empty pad coming from pin8, it sits right next to it and appears to have a diode marking however the other pad of the set goes pin 4 of the to the small 6-pin component marked 8205S right below the MCU, not GND.

I’d really like to get this thing working, I have a project for it but I have so many other project’s on my plate (including all my oersonal projects as well as the 1AA boost driver I’m doing for TFF and a new AVR programmer) that I can do the stuff you figure out but I cant devote any time to actually dive in myself.

edit: good news is driver works with the PIC MCU (had to try a few different ones, I have multiple pulled 12F683’s from different drivers lol), now I’ll just wait to see what you think.
I dont need a pic anymore but could you please post a complete list of each step required to get it running all in one post?

thx

edit2: what resistors are you using to get 5A? I’ve tried every combo of resistors I have and the only thing I can do is decrease power, I wasnt able to get it any over 3A. I’ve tried from adding a second .025 all the way up to 36ohm, I also tried no resistor, just a jumper…

Let’s not get into that. I really do not appreciate any pressure from you to do unnecessary things. I’ve posted pics and markings. All you’ve gotta do is look at them.

Step one for you is to confirm that your driver works as expected without the PIC in place. As I mentioned earlier, the stock firmware never allows 100% duty cycle on the PWM/blanking/toff/whatever input for the buck circuit, so you should see 3.5-4A without doing any resistor mods. So you’ll need to do what I described in the OP:

Once you’ve done that you can move on to trying to install an ATtiny13A. For that, simply follow the explicit details I posted in #56. I haven’t done any work on the LD-29 that I haven’t posted in this thread other than the brief discussion over in the STAR firmware thread about moving PWM outputs, so the status is exactly what you see in #56. I used the v07 adapter boards. Note that after installing the adapter board and before installing the MCU I did test the driver by pulling the Enable and PWM pins high - I wasn’t really 100% sure that the adapter board would reflow the way I expected, but it seems that it did.

Not having GND is OK, don’t worry about it. I’m not sure if shorting MCU GND to BAT- is OK though, so make sure your ATtiny still works. There’s a lot of stuff going on on an LD-29, I haven’t made a circuit diagram and I have no clue how most of it actually works ;-).

The firmware you keep flashing doesn’t work - I mentioned that when I posted it.

Hey guys,

Sorry I couldn’t log in for the last 3 months.
wight, Thanks for your hard work!

I had a little time playing with my ld-29 today.
They are really seems to be a little different from the old ones.

I removed the PIC from the driver, wired it to the LED, and as expected - it didn’t work.

Then I jumpered pin1-pin3 and pin1-pin5 - still didn’t work for me.
I tried playing a little more with the jumpers, and managed to get it work on MAX with jumpers : pin1-pin2 and pin1-pin5.

  • Why could It happen? [on the OP it is still written that pin3 is the pwm]

The strange thing is that it works at about ~4A on the LED on max, which is too high for XM-L’s .

* Is there any way reducing the amp without pwm (without adding an MCU ) ?
EDIT: I could manage to lower the output to exactly 3.0A with a resistor of 0.031058ohm. now it is okay.

Another interesting question, 3 months ago I ordered “PIC to ATTINY v06”

  • will it work with an Attiny? or should I order the v07?

THANKS!! :wink:

Hi again HiTiT, it’s been a while since I did anything with this (all the latest info is in this thread of course). I’ll have to refresh my memory. I’ll remove the PIC from the new-version LD-29 I have ASAP and verify your findings. IIRC when I examined them they seemed very similar. I am surprised by what you experienced.

Where did you place that resistor?

Thanks again for your help!
yep, it is strange, but works, I also managed to put a reed switch and made it work as a momentary switch with a magnet.
I made a jumper between pin1-pin5, and put the reed switch on pin1-pin2, otherwise it didn’t work correctly.

I put everything into my OLD diving light Trustfire TR-J2, and it seems to work great in there - but with no modes - as there is no MCU…

I de-soldered R025 which goes into LED - [ if i’m not mistaken] and soldered a new one there.
I want the light to work @3.3A on LED so I ordered some new precise [1%] resistors to play with.

by the way, I forgot how buck drivers work, if I get 3.0A on LED, how many Amp should I see on tailcap? :slight_smile:

Sorry HiTiT, I probably meant to reply but did not. Glad things seem to be going well.

You will not be able to accurately estimate output current by monitoring only tailcap current. That said, the way I do it is:

  • I assume 80% driver efficiency.
  • To estimate output current:
    A. I multiply input current by input voltage.
    B. I multiply that by the efficiency (0.80).
    C. I divide that by the estimated output voltage, generally derived from a Vf chart such as those generated by Match or djozz. Typically an XM-L2 will be around 3.4-4.2v or something, depending on drive current. Look up djozz’s “crash testing” threads for more info.
  • To estimate input current:
    A. I multiply output current by output voltage (usually I’d use a measured current or I’d estimate the current based on the current sensing resistor).
    B. I divide that by the efficiency (0.80). That means that our working number will increase of course!
    C. I divide that by input voltage.

If I have better efficiency figures for the driver of course I use those instead! Anywhere I can replace estimates, extrapolations, etc with accurate measured values I do.

just for the record
Fasttech are now shipping a new model of ld-29:
Did’t test it yet.

It is still using a PIC MCU, so I hope that wight’s adapter will work.
I am trying to write a firmware on the attiny that will be able to read a Hall effect sensor on it’s analog pin and output the light whenever a magnet is being close to it.

^

Did wight ever fix that Attiny13a/PIC adapter board?