Finding the characteristic impedance of an antenna cable

May 24, 2020

I recently stumbled on a cool video that showed how to compute the impedance of an antenna cable. Unfortunately it’s almost five minutes long, so I thought I’d summarize:

  1. Measure the capacitance of the cable when it’s open (C) in farads (F).
  2. Short one end.
  3. Measure the inductance of the cable from the non-shorted end (L) in henrys (H).
  4. Impedance (Z) = √(L/C) in ohms (Ω).

It works for both coaxial cables and ladder line. Neat trick!

Changing AllStar screen resolution

December 25, 2018

The Problem

I recently became interested in AllStarLink, and had a HamVoip image installed on a Raspberry Pi. (I was using “RPi2-3 includes 3B+ Image Version 1.5rc19”.)

The AllStarLink image booted to 1366×768, which was the screen’s default resolution. However, the screen itself was a 7 inch HDMI screen. That was hard to read.

Things that didn’t work

I decided to change the resolution by editing /boot/cmdline.txt. My first attempt was to add:


before the root= line at the beginning of the file. That resulted in a kernel panic:

Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

After a while, I realized that root= had to come first. Then I tried:

root=/dev/mmcblk0p2 rw rootwait bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=400
console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0
smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop

but my cmdline.txt values seemed to be ignored.

Finally I wised up: apparently when the Pi reads the root line it starts booting, ignoring everything after it in cmdline.txt. So, I had to pass the video size as a kernel parameter instead.

I did:

cat /proc/cmdline

and saw:

8250.nr_uarts=0 bcm2708_fb.fbwidth=1366 bcm2708_fb.fbheight=768
bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000
root=/dev/mmcblk0p2 rw rootwait console=ttyS0,115200 console=tty1 selinux=0
plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyS0,115200 elevator=noop

The Solution

(For Linux / AllStarLink newbies: in order to get to the terminal, I picked menu item 9 – open a bash shell.)

I went into /boot/cmdline.txt with a text editor:

nano /boot/cmdline.txt

and inserted the following two parameters on the existing line that begins with “root=”:

bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=400

I put these right after the rootwait parameter, so in /boot/cmdline.txt I now had:

root=/dev/mmcblk0p2 rw rootwait bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=400
console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0
smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop

(Note that root line is all one long line – not broken up with line separators!)

Once I did that and saved it, the Raspberry Pi booted up in glorious 80×25 text. Now we could read it!

Repairing a Samsung LN32A450

December 12, 2012

I own a Samsung LN32A450 TV set, which has been fairly good so far… until last weekend, when it didn’t turn on. Instead, the power LED flashed steadily at about one flash every 500 ms.

It seems that my TV set suffered from the capacitor plague. A bunch of the Samwha capacitors swelled up and were no longer to spec. I could order a replacement board (the board is BN44-00214A available from A little searching showed that others had successfully revived their power boards just by replacing the capacitors.

First, I had to open the TV set. This involved removing 16 screws (all the same size) from the back. I discoverd I had to be careful with the ones marked “S” – those four also hold the TV stand in place, so I wanted to remove them last. Also, there’s a screw on the back panel below the “EX-Link” connector, and another one on the back underneath the A/V 2 inputs.

Once I did that I could slide the back off (face down, since the support was unscrewed). The power board is the one in the middle. There are five connectors to disconnect from there: two at the upper left, one at the upper right, and two power connectors that go to the lower right. In my case they stayed in the right position once I removed them because there was tape holding them to the flat panel.

After that, I removed 6 small screws that held the power board in. I didn’t need to remove any of the standoffs – they’re just there to push the board away from the flat panel.

When I investigated the board, I could see the telltale swelling of capacitors that indicated problems. I saw problems with four capacitors:

CB852 in the middle right of the board: 2200 uF 10V
CW856 near the top left: 470 uF 25V
CW858 right below CW856: 680 uF 25V
CM868 right below CW858: 680 uF 35V

Some people reported success with using Radio Shack replacement capacitors. I was a little nervous about that – these caps are all rated to 105 degrees C and have high ripple current tolerance, and I didn’t want to swap in something I’d just have to replace later. I ended up getting replacements from Digi-Key. They have a minimum $25 order (otherwise they charge you $5 for handling). Luckily I had some other stuff to buy at the same time.

I replaced them with the following:

CB852: Panasonic EEU-FC1A222L (Digi-Key part P11189-ND)
CW856: Panasonic EEU-FM1E471 (Digi-Key part P12388-ND)
CW858: Panasonic EEU-FM1E681 (Digi-Key part P12390-ND)
CM868: Panasonic EEU-FM1V681 (Digi-Key part P12417-ND)

The replacement for CB852 was about 1 cm taller than the original part, and that made it the tallest part on the board. I was a little worried about that, but there seemed to be enough clearance that it didn’t cause a problem.

These capacitors are electrolytic and have a polarity, so I had to replace them the same way ’round that the originals were. Luckily, on my circuit board all the negative terminals were marked with a white semicircle underneath the capacitor.

After that, I plugged the cables back into the board (not forgetting the single-pin green ground cable). Then I put the 6 screws back.

Next I put the cover back on and put the 16 screws back in. I started with the base “S” screws, then the top three, then kind of haphazardly put the rest in the right places.

Then I powered up. Success! The TV came on and was as good as it was before this happened.

A few links I found useful:

Intel can’t do video

June 12, 2011

I recently upgraded my Ubuntu installation from 9.10 (with the old 8.10 video drivers that didn’t crash) to 10.04. I immediately began seeing the video crash, especially when there was a lot of activity.

It turns out I have an Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01). This is one of the many Intel video cards that have trouble.

I applied workaround F from here:

That led me to here:

After applying the Method 2 fix from there, things seem to be a little more stable. Time will tell.

Echo when playing back MythTV

October 26, 2010

I recently ran into an interesting problem with my MythTV audio. When I played back a program, it would play back with varying degrees of echo in the audio. Usually the echo would be around 100 ms behind, but if I skipped forward or back I could get it up to 3 seconds behind. This problem did not happen outside of MythTV.

First I started with alsa-mixer. There I determined that there was no level I could change to affect the echo. Changing the level always changed both the first audio and the echo.

Next I tried reinstalling the AC97 sound driver, because I saw a website that noted when the driver was corrupt you could get an echo. No dice.

Finally, I happened to be running top, and I saw this:

 4273 myth 20   0  220m  85m 3588 S   12  8.5  11:55.43
 4257 myth 20   0  245m  85m 3700 S   12  8.5  10:20.79

I had two copies of mythfrontend.real running! Both were getting the lirc keypresses and acting on them. This meant everything (including the player) was being run twice… hence an echo slightly behind the main audio.

Somehow the Gnome session state had been saved with a mythfrontend.real running, and when it was restored it would restore with that mythfrontend.real as well as start a new one. I made sure the session state wasn’t being saved (under Settings), killed all the running mythfrontend.real instances, and then logged out saving the session. Next I logged in and out but unchecked the button to save session on logout. That seems to have done the trick.

A minimal xorg.conf with modeline

March 25, 2010

Back in the Bad Old Days, the X configuration file was miles long and you had to get it all right. Nowadays, X guesses at most things pretty accurately. This means you might not have anything in your xorg.conf file. This makes changing the Monitor section trickier.

Here’s a default xorg.conf file with a modeline. (This is for a Sharp LL-172C-B monitor; your modeline will probably differ.)

Section "Device"
        Identifier      "Configured Video Device"

Section "Monitor"
        Identifier      "Configured Monitor"
        # Modeline "1280x1024"  MHz  HSize HTotal HSyncEnd HSyncDelay  VSize VSyncStart VSyncEnd VTotal -hsync +vsync
        Modeline "1280x1024"  109.00  1280 1322 1450 1700  1024 1027 1034 1066 -hsync +vsync

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"

Tuning X video with modeline

October 30, 2009

After setting my monitor up, I found it didn’t exactly match the other devices on my kvm switch. I could get around this by pressing the “Auto Adjust” button on the monitor, but that meant I’d have to adjust again when I switched to a different machine.

Usually, what I do in these cases is to use xvidtune to fine-tune things. Unfortunately, that didn’t work – it would always fail with “Unable to query monitor info” even when I disconnected the kvm switch and went directly into the monitor.

What that meant is that I’d have to hack the modeline manually. I found a good discussion of modelines here.

A modeline has the following format:

name dotclock hsize hsyncstart hsyncend htotal vsize vsyncstart vsyncend vtotal hsyncpol vsyncpol

I needed to move the image on my monitor to the right (I had a black bar on the right hand side, and the left hand side was clipped off). To move the monitor right, I needed to DECREASE hsyncstart and hsyncend by the same amount. (Then I logged out and logged back in to restart X so the new settings were being used.)

Once the screen was more or less centred, I DECREASED htotal to make the display wider. (And then logged out and logged in again….)

After that, the image was still a little further right than I wanted, so I DECREASED hsyncstart and hsyncend again to get the wider display centered again. One more restart of X and things were groovy.

My current modeline is:
Section "Monitor"
Identifier "Configured Monitor"
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
# Modeline "1280x1024_60.00" MHz HSize HTotal HSyncEnd HSyncDelay VSize VSyncStart VSyncEnd VTotal HSyncPol VSyncPol
Modeline "1280x1024_60.00" 109.00 1280 1322 1450 1700 1024 1027 1034 1066 -hsync +vsync

Now things are automatically adjusted when I switch from one box to another.

Note: This won’t work if you aren’t currently displaying something in the mode you want to use. Also, keep a copy of your original values in your xorg.conf file just in case things go awry – it’s possible to put all your controls offscreen, which can make things challenging.

Setting up the Sharp LL-172C-B Monitor on Ubuntu 9.04

October 21, 2009

Here’s the magic to get the video mode set right for the Sharp LL-172C-B monitor (1280×1024) on Ubuntu 9.04:

First, run CVT to get the modeline:

$ cvt 1280 1024

Copy the output from that into the Screen section of /etc/X11/xorg.conf

Section "Monitor"
    Identifier      "Configured Monitor"
    # 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
    Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

Restart X and you’re in business.

Update: I found I needed to tune the values a little bit. See the post here for more details.