Cyrus AM/FM Tuner Controller Replacement

I got two of these iconic Brit tuners in with the request to make one functional unit. Once the repair was completed I was left with a tuner with several broken parts, including a cracked LCD. Cyrus Audio might have had a replacement LCD but I decided to replace the LCD with a standard 2x16 line HD44780 module. Of course, the old LCD is a custom display and uses a rather obscure driver IC. Which was borked, as well as the EEPROM the Philips MAB8441 controller stores its data in. The MAB was still OK but without its I2C EEPROM functionally dead. So I decided to use a PIC16F818 instead.

The schematic is simple:

There are several connections with the Cyrus tuner: the I2C bus, now only used to set the PLL in the TSA6057 synthesizer chip, STOP signal for autoscan, STEREO signal from the LA3401 MPX chip, MUTE signal which is active while tuning, MONO signal which is currently not used and the SIGMET (Signal Meter in Cyrus parlance) which provides the signal level. The LCD is connected to ports RB[7:2] in the widely used configuration for 4-bit wide databus and finally the UP and DN buttons on the front panel. These had to be mounted separately because in the original state the tuner is controlled by remote control only. Lose it and you're toast. Unless you find a remote that sends out RC5 data with the TUNER system bits set.

Anyway. First I had to modify the front panel and install the replacement board containing the PIC:

LCD Front Panel PCB PIC board with rainbow cable Rainbow cable plugged in

The front panel PCB had already been stripped so the LCD module was inserted using a pin strip and wired to two more pin strips for connecting to the PIC board. The connection is done with a rainbow flat cable. I love these, especially if there are ten connections to be made because the color neatly follow the resistor color coding. On the main board I had removed the MAB controller and its crystal. The PIC board was eventually wired up as per schematic as the code was written. It has a ICSP connector so I could program the PIC from the now obsolete MPLAB ICD2 USB interface. The LCD module proved to load the programmer too much which was solved by inserting two resistors of 2.2k in the programming lines. The hardware was a challenge requiring quite a bit of reverse engineering because the service manual was not available at the time.

Once the hardware was sorted out I could start writing the program. I started out with the PLL chip. The TSA6057 has four configuration bytes as well as an address and sub address byte. I already wrote I2C interfaces before so I could just copy/paste the code directly into the program. This is the result (click to embiggen):

The top line of the stitched image shows I2C data (SDA) and the bottom line the clock (SCL). My speed is pretty slow at about 30 kbaud. Usually it is 100 kbaud, which means about 10 µs per bit. From left to right the I2C start condition, address byte (0xC4), subaddress (0x00) and data bytes DB0-3 (0xC9, 0x21, 0x94, 0x00) for 110700 kHz local oscillator frequency and configuration. Finally an I2C stop condition. The last two bytes only have to be set once at startup so the program only sends DB0 and DB1. The detail shows the ACK from the TSA to the PIC. Once the PIC floats the SDA line (as evidenced by the small drop in voltage) the TSA pulls it low (shown by the slightly higher LOW level of the SDA line). Finally the SCL line goes low and the PIC takes control again.

With the PLL set the LCD was next. Since I've never used an LCD this way I had to figure out the code myself based on examples on PIClist. After reading the fine manual and looking at those examples I got the LCD going. I also realized that I could have saved a port line by reusing the data lines for the LCD as scan lines for a 4-key wide keyboard. But then, since I only have two buttons, I chose not to and stick with the two buttons. Which I already had drilled the holes for anyway.

Next on the menu was the relation frequency display and PLL tuning. Since the FM band only has 206 frequencies (0.1 MHz grid) this fits in a single byte. This is the Frequency Index (FRINDX) variable. When it is changed it is decoded as PLL word (LOADPLL subroutine) and frequency (FREQDISPLAY). This code came to fruition relatively easy. I included code to write FRINDX to EEPROM to save the frequency when the tuner is turned off.

Writing the code for the buttons was a real challenge. Eventually I needed three flowcharts, the final one being this one:

Button Flowchart

There are three states: short press, long press and key held. Short press exits immediately after stepping the frequency with 0.1 MHz. Long press enters autoscan mode. This modifies the index until the STOP line goes low. When held it enters manual scan mode. STOP is ignored and after ten steps the speed increases. Right now there is still a bug in the code because when the button is released manual scan should terminate and that doesn't happen.

Then there is the STEREO indication. This was simple to implement but I found that once a scan mode is entered the display must be cleared at this position.

The final feature I made was the level indicator. The A/D converter is connected to the SIGMET line. This is the signal meter output of the LA1235 IF chip. I made a calibration chart with my signal generator and from there I made the decision table in the LevelDisplay subroutine. I also needed special characters to make the bar for the level indicator. The HD44780 supports 8 custom characters and I used them all for the indicator. There are a total of 16 bars that can be turned on. In this example there are 13:

The finishing touch was the splash screen at poweron:

With the basic functionality realized I think this project is completed. There are still a few issues like the button handler and the autoscan stop performance that is somewhat unpredictable. The cause for this is the LA1235 chip that has its MUTE output abused as a STOP signal. Well, it isn't. I would need additional hardware to create a proper STOP signal based on the AFC voltage and signal level or implement it in software by using another A/D input. Cyrus did some trickery with the signal level that I could also implement sometime. Yeah, right.

Other features that could be added is AM support. After all, the tuner has a whole AM section and only needs software to use. Another nice to have feature is presets. There is plenty of EEPROM space available to store 10 presets (needs only one character position on the display) with associated labels. Creating a preset with only two buttons will be a challenge though. Another option would be to decode the signal level to an actual dBm or dBµV value. The lookup table would still fit in a single 256 byte page in the PIC.

All in all a nice little project to get this nice little tuner going again!

Back to the projects page

Date: 5 October 2020, updated 7 October

This software is licensed under the CC-GNU GPL.