Streaming Radio Player: Timing Tweaks

Slowing the SPI clock and updating the drivers having had no noticeable effect on the OLED display corruption, I once again pondered the SH1106 controller timing specs.

The chip reset seems remarkably slow, even at maximum VCC:

SH1106 - Reset Timing Specs

SH1106 – Reset Timing Specs

I think the relevant code is in the luma.core driver’s file. On the RPi, it resides in /usr/local/lib/python2.7/dist-packages/luma/core/interface/.

As far as I can tell, the bitbang class handles all the setup and teardown around the actual data transfers, but it’s not clear (to me, anyway) how it interacts with the underlying hardware SPI machinery.

So, let’s add some sleepiness to the Reset code:

        if self._RST is not None:
            self._gpio.output(self._RST, self._gpio.LOW)  # Reset device
            self._gpio.output(self._RST, self._gpio.HIGH)  # Keep RESET pulled high

A few milliseconds, rather than a few (hundred) microseconds, won’t make any perceptible difference.

Similarly, the Chip Select and Address (Command/Data) signals require more delay than might occur between successive Python statements:

SH1106 - SPI Address and Select Timing Specs

SH1106 – SPI Address and Select Timing Specs

This should do the trick, again with excessive delay:

        if self._DC:
            self._gpio.output(self._DC, self._cmd_mode)

... snippage ...

        if self._DC:
            self._gpio.output(self._DC, self._data_mode)

... snippage ...

        if self._CE:
            gpio.output(self._CE, gpio.LOW)  # Active low

... snippage ...

        if self._CE:
            gpio.output(self._CE, gpio.HIGH)

Although it shouldn’t be necessary, I blew away the pyc files to prevent future confusion over who’s doing what with which.

Once again, this will require several weeks to see whether the situation changes for the better.



Leave a comment

Sena PS410 Serial Server: Burnin’ In

The USB serial adapters I use to capture HP54602 scope and HP8591 spectrum analyzer screenshots, as well as monitor the HP Z8501 GPS time standard, lack unique identifiers and appear as unpredictable device nodes.

After putting up with this for far too long, I dropped $15 on a Sena Technologies PS410 serial server:

Sena PS410 Serial Server - interior

Sena PS410 Serial Server – interior

It needed a new lithium coin cell, of course:

Sena PS410 Serial Server - as-received CR2032

Sena PS410 Serial Server – as-received CR2032

The PCB and chip date codes suggest a 2009 build, so “98” might mean August 2009. Whether that’s the manufacturing date or the best used by date, ya never know.

The eBay deal didn’t include the power supply, so I hacked a coaxial jack on the back:

Sena PS410 Serial Server - hacked power jack

Sena PS410 Serial Server – hacked power jack

A 14 VDC IBM laptop brick from the pile suits the “9 to 36 V” range printed on the case.

Poking the “factory reset” switch did what you’d expect and the “console” serial port on the front worked fine. I plugged in the scope, the spectrum analyzer, and the GPS receiver, whereupon the bench took on the unmistakable aroma of electronic death:

Sena PS410 Serial Server - charred ferrite chip

Sena PS410 Serial Server – charred ferrite chip

Some probing suggests FB9 used to be a ferrite bead between serial port 2’s ground pin and the frame ground.

To compress an afternoon of tinkering into one sentence, there seems to be an occasional 35 VAC difference between the spectrum analyzer and the scope, but only when one or the other is plugged into the PS410. Everything is (now!) plugged into the same branch circuit and, in fact, the same outlet via many power strips, but the difference remains. A different power supply makes no difference, either.

I managed to burn out the ferrite bead on Port 1 with only the scope and the power supply plugged in, by connecting the scope’s ground lead to the shell of Port 2. That makes no sense: there is no voltage difference between the scope’s serial ground and its probe ground.

Something Is Not Right, but I’m baffled.

I have established that the server works fine, even with the charred beads, which is a Good Thing.


Nine Years of Blogging on Hard Mode

I gave a lightning talk at HVOpen‘s 15th anniversary meeting last week on my experience with Nine Years of Tech Blogging on Hard Mode:

Top Posts 2017

Top Posts 2017

While you won’t get my patter, you should get the general idea: for reasons unknown to me, I’m the go-to guy for water heater repairs.

So much for my solid modeling and 3D printing and suchlike.


BLDC Fan RPM vs. PWM Duty Cycle

A simpleminded MOSFET circuit provides PWM drive for the BLDC blower:

BLDC Fan PWM Test Fixture - schematic

BLDC Fan PWM Test Fixture – schematic

The Tek P6302 current probe looms much larger in real life than in the schematic:

BLDC fan PWM Test Fixture

BLDC fan PWM Test Fixture

A quick dataset shows the RPM variation against PWM duty cycle:

BLDC Blower - RPM vs PWM - doodles

BLDC Blower – RPM vs PWM – doodles

Unsurprisingly, the RPM curve resembles the earlier results against a variable DC supply voltage:

BLDC Blower - RPM I P vs V

BLDC Blower – RPM I P vs V

Capturing the current waveform is stalled behind another project, but it has exactly the voltage spikes you’d expect from forcibly switching an inductive load.

Leave a comment

Chipmunk Fatality

I found this while moving the wheelbarrow off the driveway in preparation for another snowfall:

Submerged and frozen chipmunk

Submerged and frozen chipmunk

It may have sipped water from the bowl, fell in, drowned, then froze in place. Mary uses rainwater (or snowmelt) for household plants, at least during somewhat warmer weather, but the bowl obviously presents an attractive nuisance for little critters.

Chipmunks are basically rats in snappy livery, but even they don’t deserve such a fate.

1 Comment

Bottle Cap Rehabilitation

Mary acquired this bottle a long time ago and has used it forever, so it has Historic Connotations and cannot be discarded. Alas, the cardboard-and-plastic seal in the cap finally disintegrated; I replaced it with various plastic foams and sheets, none of which worked.

Finally, I found the cork sheet stash while looking for something else and cut out a disk:

Rehabilitated bottle cap

Rehabilitated bottle cap

It works perfectly, of course, because cork.

That was easy.


Leave a comment

Baofeng BL-5 Battery Pack: Recharge and Reassembly

Separately charging all four cells from the Baofeng BL-5 packs covered the Electronics Bench with wires:

Baofeng BL-5 cell charging

Baofeng BL-5 cell charging

The cell sits on a ceramic tile as a nod to fire safety, although I doubt it makes any difference.

The discharge tests showed two nearly identical pairs:

Baofeng BL-5 Cells - Separate Charge - 2018-02-24

Baofeng BL-5 Cells – Separate Charge – 2018-02-24

Surprisingly, cells A and B (upper traces) were deaders in the original packs. Cells C and D (lower traces) were more-or-less fully charged, but now have a lower terminal voltage and slightly lower capacity. I have no explanation for that, nor for the voltage undulations.

The rebuilt packs pair up A+B and C+D.

Reassembling pairs into the pack shell and resoldering all the leads produces a good pack:

Baofeng BL-5 battery rebuild

Baofeng BL-5 battery rebuild

I later added a snippet of heavy manila paper under the nickel tape bent around the edge of the pack as a third level of insulation, in the interest of having the nickel tape not produce a dead short between the isolated – terminal and the + cell case.

Memo to Self: tape the long wiggly leads from the protection PCB to the radio contacts (at the left side) before soldering the PCB to the cell terminals, because an inadvertent short will convert the 8205A battery protection IC into a Light-Emitting IC, at least for a moment, and subsequently release the Acrid Smell of Electrical Death. A handful of charge PCBs are en route halfway around the planet, from which I intend to liberate one IC for this board; with luck, I didn’t incinerate anything else.

The pack works fine in the radio, as does the APRS interface:

APRS Coverage in Poughkeepsie - 2018-03-01

APRS Coverage in Poughkeepsie – 2018-03-01

Unfortunately, two APRS iGates vanished in the last year, leaving poor coverage south of Poughkeepsie.