Q: What is this?
A: A specially patched version of the firmware for the Kenwood TS-850SDX
   HF amateur radio transceiver.

Q: What does this modified firmware do?
A: It allows the Kenwood TS-850 and DSP-100 to produce HiFi audio in AM
   mode as well as USB/LSB without needing any special manual intervention
   or external computer assist software.

Q: Why do you need it?
A: There is a glitch in the gate array logic in the DSP-100 unit
   that prevents the radio from generating any output when you try to
   transmit with both the HPF and LPF TX filters set to "off." You can
   transmit in LSB or USB just fine, but not AM.

Q: What version of the firmware is this based on?
A: It's based on the last firmware version Kenwood released for the
   TS-850S/AT, version JEZB (1992).

Q: Will this firmware do anything else for me?
A: I don't know. This version is from a radio with a 50 million serial
   number. My radio has a 31 million serial number, and it has an older
   version. Kenwood hasn't described what the differences are in any
   service bulletins, as far as I know.

Q: Will this firmware work in any TS-850S/AT?
A: Yes.

Q: Will it do anything if I don't have the DSP-100 unit?
A: No.

Q: Will it work in the TS-450S/TS-690S?
A: No.

Q: Why didn't Kenwood fix the gate array?
A: HiFi audio wasn't really an advertised feature of the radio, so
   it probably was deemed not worth the effort to correct it, especially
   since producing new gate array chips is a non-trivial process.

Q: How do I put the DSP-100 into HiFi mode in the first place?
A: You need to use the following two special procedures:

        Allow setting of analog filters in TX and well as RX
        ----------------------------------------------------
        1) Start with the radio off
        2) Press and hold the SCAN key and the right M.CH key
           while turning the radio on
        3) Use the small encoder knob to select menu option 1
        4) Press the UP arrow key to change the setting from "off" to "on"
        5) Press the CLR key to exit the menu

        Set DIP switches on the DSP-100 for wide bandwidth
        --------------------------------------------------
        1) Locate the block of DIP switches on the rear panel of
           the DSP-100 unit
        2) Set switches 6 and 7 to off to turn off the low cut filter
        3) Set switch 1 to off to turn off the high cut filter

   Once these procedures are complete, you can configure the radio for
   Hi-Fi audio as follows:

	1) Key the transmitter in the desired mode (LSB, USB, AM)
	2) Keep pressing the 8.83Mhz IF filter select key until the
	   "bypass" setting is reached (all filter lights off)

   You will now have 6Kc of TX audio frequency response.

Q: How do I enable AM HiFi mode?
A: An extra power-on option has been added to allow the user to toggle the
   AM HiFi workaround on and off as needed. The procedure is as follows:

        1) Start with the radio off
        2) Press and hold the AM/FM key while turning the radio on

   If the AM HiFi feature is disabled, this procedure will turn it on. If
   it's already on, repeating the procedure will turn it back off.

Q: Why did you make the AM HiFi feature switchable?
   The workaround to get AM to work involves programming the radio to send
   commands to the DSP unit to switch it from AM to SSB and then back to AM
   again. When the DSP-100 is set for HiFi mode, this process works fairly
   seamlessly: it just prods the radio into transmitting. However, if the
   DSP unit is set for Mid-Fi mode (DIP switch 1 on), toggling the mode
   setting like this has an unwanted side effect: the output power will
   momentarily spike when the radio enters SSB mode. The power meter will
   show the output spike to max for a split second and the ALC indication
   will briefly jump up as well. This presents two problems:

   1) After the ALC spikes and we switch back to AM again, the ALC takes
      a while to unclench. During this period, the AM carrier is reduced
      and it takes a few seconds for it to return to the desired level.

   2) The short spike in output puts undue stress on the transmitter and
      may also put stress on linear amplifier if one is in use.

   Ideally, the workaround should only be enabled when the DSP unit is set
   for HiFi mode, but there is no way to sense the state of the DIP switches
   on the DSP-100 from inside the TS-850's computer, and the DSP-100 doesn't
   inform the radio of the current filter settings. (Since the DSP-100 is
   an external unit, that information is handled inside it. The radio has
   no control over it.) By contrast, the DSP unit in the TS-950SDX is more
   tightly integrated with the main computer; it is in fact the main computer
   in the TS-950SDX that controls the filter settings.

   As a compromise, I made the AM HiFi workaround switchable instead. Since
   the user must manually set DIP switches on the DSP-100 to enable HiFi
   mode in the first place, I decided it wasn't that much of an extra
   burden on the user to require that the AM workaround be manually enabled
   too. When operating in Mid-Fi mode, the workaround should be left off.
   This preserves the original behavior and avoids the unwanted output
   spike when transmitting in AM mode.

Q: Does this firmware patch change any other behavior?
A: No. All it does is allow the LPF "off" selection to work in AM as
   expected.

Q: Does this fix a firmware bug?
A: No. The problem with HiFi AM mode is not due to a bug in the firmware:
   it's due to a glitch in the DSP gate array. This firmware patch just
   works around the gate array glitch.

Q: Did you reverse-engineer the entire firmware?
A: No, only the pieces directly related to sending the DSP command
   word. The rest of the firmware is still a mystery to me.

Q: How does the patch work?
A: See the TECHINFO.txt file for technical details on the firmware
   operation and the patch.

Q: How did you figure this out?
A: With a combination of documentation and analysis. The NEC uPD781x
   user's manual and the Kenwood TS-850 service manual were invaluable
   tools in the process, in conjunction with logic analyzer traces
   obtained by monitoring the serial communication lines between the
   main CPU and the DSP, and the unidasm.exe disassembler utility from
   the MAME software.

Q: What's MAME?
A: MAME is an arcade video game machine emulator, that simulates a whole
   host of processor architectures used in arcade video games. Apparently
   the same NEC uPD7810 processor used in the Kenwood TS-850 was used
   in some arcade machines. Luckily, the MAME developers created a
   disassembler tool to help debug and improve ther CPU simulator code.
   You can find out more about it at: http://mamedev.org

Q: How to I run the disassembler tool?
A: The syntax is as follows:

   C:\> unidasm code.bin -arch uPD7810 -basepc 0000h > code.txt

   This disassembles the binary image file "code.bin" and puts the
   result in "code.txt" in text form. Note that not all 64KB of data
   within the file is firmware code: some of is just table data.

Q: How do I install the firmware in my radio?
A: See the INSTALL.txt file for details

Q: What do I need to create a new firmware chip?
A: A 27c256 32KB EPROM with a 150ns access time rating (or faster), and
   an EPROM programmer. 27c256 parts can be purchased in UV-erasable as
   well as one-time programmale form, and typically cost only a few dollars.
   Cheap programmers that handle the 27c256 chip can be had for under
   $100. If you buy UV-erasable parts, you may optionally wish to buy a
   UV-eraser light so that the chips can be erased and re-used.

Q: Will you be selling firmware chips?
A: I'm sorry, but no. I already have a day job which keeps me very
   busy. Also, the EPROM programmer that I have access to is at work,
   and there may be a conflict of interest involved if I use my employer's
   equipment to make money on the side.
