Saturday, July 2, 2011

Garmin GPSMap 396 - "System Software Missing" fix

I recently tried to upgrade the software on my Garmin GPSMap 396 aviation GPS.  Unfortunately, the webupdater program crashed halfway through the update, leaving the GPS in an unusable state.  Turning the GPS off and back on would give me a splash screen for a couple of seconds, followed by a big red screen that said, ominously, "System Software Missing" and a long beep.  In this state, the GPS wouldn't even accept a new update; the update program on my PC wouldn't recognize the GPS as even being present.  The GPS was bricked.  Uh-oh, I was supposed to go flying today!

After much Googling around, I finally found the answer: power down the unit, and while powering it back on, push and hold the "up arrow" key (i.e., the up direction on the cursor pad).  Keep holding that button down continuously while re-starting the update program on your PC.  As long as you're holding down the up-arrow key, the splash screen stays up, the USB connects, and the updater program can flash a new version of the system software.

Some other Garmin GPS models can be put into this mode by holding down the power button -- that was the most common advice I found on how to solve this problem -- but the aviation GPS lines including the 396 that I own require you to hold down up-arrow instead.

Incidentally, it turned out the reason for the initial crash was because I was trying to update over a flimsy and very long USB cable attached to a hub.  Repeated attempts to update always resulted in a crash.  When I finally attached the USB cable directly to my PC instead, the update proceeded normally.

Monday, January 4, 2010

Force your nVidia card to send digital (DVI-D) output to your Viewsonic monitors

I have two Viewsonic monitors -- a VP2030b and VP2000s -- and an nVidia Geforce 7600 graphics card.  The Geforce graphics card has dual DVI outputs so that you can drive two monitors with it. Each video output can either generate DVI-D (a digital signal) or DVI-A (an analog signal).  The digital is much sharper, but unfortunately, there's no obvious way to force the nVidia drivers into digital mode.  By default, the card tries to auto-detect, and often gets it wrong, driving my digital monitors with analog signals (and driving me crazy).  For years. I'd dread rebooting my computer, wondering if it would come back up with dual-digital or not.

I tried to solve this problem on and off for more than a year; many people seem to experience the same thing when attaching an nVidia card to a Viewsonic monitor.  Finally, I found a solution buried in this thread -- one of many discussing the problem.  All the information is there, but it's a little hard to understand, so I thought I'd blog a set of step-by-step instructions.

There's a secret registry entry that will tell your nVidia card to go into digital mode, so if you're willing to fire up regedit, here's how to fix it.  Note this only works with nVidia drivers!
  • Start regedit.  (You need administrator access under Windows 7.)
  • Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video
  • Under Video you'll see a number of sub-folders with long names like {B1E0FF3B-2B31-4B0D-8B9C-B09BBB60CB07}.  Each of those has a sub-folder called 0000.  Most of the 0000 folders will be nearly empty, but one of the 0000 folders contains hundreds of entries that have names of programs in them (e.g. _3DMark05.exe, playNow.exe, etc.).  Find that one.
  • In the 0000 folder you found in the previous step, right-click, and from the context menu, select New, then Binary Value.
  • When the new key is created, change its name to DevicesConnected
  • Right-click on the new key and click Modify...
  • A dialog box will pop up that says "0000" -- it's waiting for you to type data.
  • Type "00 00 03 00", then click OK.  According to the posters in that thread, you can actually type 4 different values depending on your monitor configuration:
    • 2x digital monitors -> "00 00 03 00" (0x30000)
    • 2x analog monitors -> "03 00 00 00" (0x3)
    • digital/analog -> "02 00 01 00" (0x10002)
    •  analog/digital -> "01 00 02 00" (0x20001)
  • Click OK, exit RegEdit and reboot.
This worked for me; my monitors now reliably go into digital mode on each reboot.  In fact -- even better -- I can now safely put my Viewsonic monitors into "autodetect input" mode.  They go into analog mode during boot, allowing me to see the BIOS boot screen, then change to digital automatically once Windows gets to the point in the boot process where it starts the video drivers.

Wednesday, December 30, 2009

Visual Studio Emacs Keybindings: Getting Indent to Work Properly

I'm a hard-core Emacs user, but sometimes I have to use Visual Studio. A friend of mine just pointed me to a brilliant blog post that describes how to set up Emacs key-bindings in Visual Studio. (Briefly: Go to Tools Options Environment Keyboard, and select Emacs from the list of key mapping schemes.)

The only problem I found with the procedure: when you hit enter to move to the next line, the cursor goes back to Column 1, and unlike in Emacs "Tab" does not automatically move you to the proper column to continue the block of code you're writing.

I found a way to fix this:

  1. Go to Tools Options Environment Keyboard
  2. In the dialog box labeled, "Show commands containing:", type "breakline". Wait a moment for the search to complete.
  3. Select Edit.EmacsBreakLineIndent.
  4. In the "Use new shortcut in:" menu, select "Text Editor". This tells Visual Studio you want the binding we're about to add to be active only while in the text editor.
  5. Click in the "Press shortcut keys" box, and hit Enter. The word "Enter" should appear.
  6. Click "Assign."
You'll get a warning that Enter is already assigned to Edit.EmacsBreakLine. You're reassigning it to EmacsBreakLineIndent. Now, when you hit enter, the cursor is automatically positioned at the correct column to continue typing a code block.

To switch back to the old behavior, follow the same procedure as above, except select Edit.EmacsBreakLine instead.

How to fix xterm on cygwin when the alt-key doesn't work

Most of my keystrokes go into xterm, and from there to my shell, tcsh. (Some people use bash, which has the same problem.) Shells typically let you use emacs-like commands to edit your command-line -- for example, Control-B to move back one letter, Alt-B to move back one word; Control-F to move forward one letter, Alt-F to move forward one word. Unfortunately, some combinations of X Window server and xterm options doesn't correctly get the alt-key all the way through to the shell.

I use Cygwin under Windows, and sometimes when I type Alt-B into my xterm window, instead of going back one word, I'll see a weird control-character, like this: รข.

There are two ways I've found to fix this: one for an xterm that's already running, and one for launching future xterms without this problem.

For xterms that are already running:
  • Left-click inside the xterm
  • Hold down the Control key, then left-click and hold the left mouse button. This will bring up a context menu.
  • Scroll down to "Meta sends escape" -- it's about halfway down
  • Release the mouse button
To get future xterms to run with this option:
  • Edit the command-line you use to run xterm to include the following argument:
-xrm "xterm*VT100.metaSendsEscape: True"

Here's an example of a complete xterm command including that argument:

xterm +tb -xrm "xterm*VT100.metaSendsEscape: True"

This tells xterm it should convert "Alt-B" into a two-keystroke sequence: Escape, then B. It gets around systems where, for some reason, the keyboard-to-shell path is not 8-bit clean.

Tuesday, December 15, 2009

A place to post random, obscure technical tips

Sometimes, I'll spend hours trying to solve some random technical problem that no one seems to have solved before. When (if!) I finally succeed, I often feel an obligation to somehow store that hard-won knowledge in the Internet. This blog serves no purpose but as a dumping ground for that kind of knowledge. My hope is that by posting technical tips in blog form, search engines will index it, and in the future, people suffering from the same problem will find it. Plus, since blogs allow comments, they'll be able to say, "Hey, it worked!". Or not.