I am reflecting on what works and what doesn't work, as follows:
And I thought about the DIP on the breadboard. The pulses all look fine, but there is no "load" on the PWM pin. A real flashlight has eight 7135 devices hung on that pin. I tried my first experiment. I found a 260 ohm resistor and put it on pin 6 to ground. With 5 volts this should pull 19 mA. The pins on the ATtiny13 are supposed to source or sink 20 mA. I still see a decent 5 volt pulse with this load on the pin.
Maybe it isn't about some initialization issue with the first mode like I was thinking last night. An experiment would be to replace the usual PWM sequence of 1,7,15, ... with 1, 1, 2, 4, 7, ... as follows:
PROGMEM const uint8_t pwm_values[] = { 0, 1, 1, 2, 4, 7, 15, 32 };
I know that the PWM value of "7" works. Maybe "1" is just too fast for this light. Will "1" work as the second level after a bump? Will levels 2 or 4 work? I do this experiment. What I see now is that I have to go all the way to 15 to get the light to work. I'll swear that it used to work at 7. I solder a tiny wire onto pin 6 and look at things with the scope:
level 1 (1/255) 440 ns pulse, 1.0 volts level 2 (2/255) 660 ns pulse, 1.0 volts level 4 (4/255) 1100 ns pulse, 2.0 volts level 7 (7/255) 1700 ns pulse, 4.0 volts -- LED not on level 15 (15/255) 3400 ns pulse, 5.0 volts -- LED onThe 1700 ns pulse only climbs to 4.0 volts at the end of a ramp from 1.0 volts.
The 3400 ns pulse is only at 5.0 volts for the last 1100 ns. The first 1300 are spent ramping up to 5.0 volts.
There is no ramp-down. The pulse ends abruptly.
17mm AMC7135 x 12 x 10 x 8 x 3 Driver 2 Group 8 mode 3 / 5 modes 7135 chips Flashlight Drive Board Mode Memory Anti-reverseI chose the second option with eight 7135. The first option had three 7135, but only one brightness, so they are giving you no ATtiny, just three 7135 wired on all the time. Cost for three boards was $3.10 each and $3.42 shipping.
Nothing worked. I pulled the ATtiny off and verified it -- I thought perhaps the heat of soldering might have damaged it. It seems OK, at least it responds properly to the usbASP.
Back on the board it goes again. This time I don't solder the LED wires yet. I just power it up and look at pin 6 with the oscilloscope. Nothing. Vcc on the chip looks good, as does the nominal 1 volt signal on pin 7.
Measuring pin 6 to ground gets 1.0 ohm. That is not good. I see it. A solder bridge to ground from when I removed one of the 7135. I measure 96K to ground after clearing this. Now the scope shows the runt 1 volt pulses on pin 6.
What next? Why not start pulling the remaining 7135 from the "spring side" of the board? I can pull first 2, then see if that removes a bad chip or not -- in a divide and conquer strategy.
Once I reduce the light to 2 chips, I see nice 5 volt pulses. I try adding first one, then another 7135 from the first batch of 4 I removed. Each time I add one, the pulses drop to the 1 volt runt level. And now, after trying 3 chips, I go back to the two that once gave me 5 volt pulses and I am now seeing runts.
Now with 0 chips (no 7135 on the board) I am seeing nice 5 volt pulses. I put one more back and again, runt pulses. I should have stopped and called it good when I had 2 working 7135 in place! Note that I am trying different 7135 each time. Did they all get damaged?
As a final test, with that one 7135 soldered on the board, I take a wire, touch one end to Vcc, the other to pin 6 and the LED comes on (with a constant 350 mA drive). So the 7135 is basically functional.
Tom's Light Info / [email protected]