September 18, 2024

Biscotti firmware -- look at PWM with an oscilloscope

I am using my Rigol DS1054Z scope to see just what is going on.

Look at "convoy" (NANJG) firmware waveforms

I happen to have a "head" from a standard Convoy S2+ sitting here handy. I solder a tiny (wire-wrap) wire to the control leg (Vdd) of one of the 7135 chips. The scope will look at this signal. I connect power and ground to a handy 5 volt supply and we are in business.

The PWM frequency is 4.52 kHz.

For the low setting, The pulse width is 14 microseconds, with a 221.0 microsecond period.

For the medium setting, the pulse width is 93 microseconds, with a 222.0 microsecond period.

For the maximum setting, we are on all of the time.

This gives percentages of 6.3, 41.9, and 100.0 -- which compare pretty well to the 5-40-100 that is claimed.

Why a frequency of 4.5 kHz you ask. Well, if the run the CPU at the factory 1.2 Mhz, then count to 256 when they do PWM, we get: 1200/256 = 4.6875. The precise difference may be an issue of tolerances in the RC oscillator that sets the CPU clock.

Look at Biscotti firmware waveforms

0.1 -- Moonlight = 9.02 kHz (110.8 us period).  pulse is 435 ns.
1.0 -- 9.01 kHz (111.0 us period).  Pulse is 3.0 us (2.8 - 3.2)
10. -- 18.0 kHz (55.4 us period).  Pulse is 7.0 us (7.0 - 7.2)
35. -- 18.5 kHz (54.0 us period).  Pulse is 22.8 us
100 -- 19.4 kHz (51.6 us period).  Pulse is 25.6 us
This gives percentages: 0.4, 2.7, 12.6, 42.2, 49.6.

This hardly looks like the expected 0.1, 1, 10, 35, 100 for group 2!!
In particular getting only a 50 percent maximum brightness is surprising.

Group 8 has 0.1, 1, 10, 50 -- but there are only 4 different levels, and my light definitely gives me 5.

This is certainly a surprise. I will say that I have never been disappointed in this light. I ordered it directly from Convoy (Simon) via AliExpress back in 2019. It has only three of the 7135 installed, so it would give just over 1 amp if we asked it for 100 percent. The max brightness driving it with 50 percent would be about 0.5 amps.
This light never gets hot even at max brightness, and now I know why!

I ordered it with only three 7135 because I wanted to optimize the light for maximum battery life, not maximum brightness. This has worked out well.

My next task is to burn the actual Biscotti code into a chip and look at the waveforms. This firmware was supplied in the light ordered from China and who can say just what it truly is. We will know more once I have waveforms from actual Biscotti code.

Consider my light with eight 7135 (a 2.8 amp max) and the standard 5-40-100 levels. 5 percent would be 140 mA and 40 percent would be 1.12 amps. I should compare the light output from it to this so called Biscotti. Indeed, at full brightness (0.5 amp) it is not quite as bright as the Convoy at 40 percent (1.1 amp)

This leads to a digression on bright LED flashlights. I have noticed many times that the differences at low levels are much more apparent than brightness differences at high levels. I have also observed that the maximum brightness setting on most lights is overly bright and fundamentally useless. For any kind of work close at hand the bright setting is simply blinding, and even for purposes such as hiking on trails at night, low or medium settings are fine, even preferrable. The maximum setting just abuses and wastes the battery and needlessly heats up the light.

In fact it was use for hiking at night that got me itching for my "Biscotti" light with the moonlight setting. I was hiking with my Convoy, and found that its 5 percent setting was more than I wanted or needed. I would have been happier with the 0.1 or 1 percent offered by the Biscotti.


Feedback? Questions? Drop me a line!

Tom's Light Info / [email protected]