SAA1064

At a Ham Radio rally some time ago, I bought some of these huge 7-segment-display modules. They have character height of roughly 8 centimetres with four digits. Anyone who knows me will know I am fascinated with time and especially clocks of any variety. These were a must have for me, and I got them at a cheap price. I have no idea of their intended purpose. Best I could think of was for the prices of fuel at petrol stations - you know - on the big road-side signs. Anywho, it doesn't matter. Here's one of them:

The display panel

= Connections = Philips (NXP) SAA1064 Pinouts

The driver chip, the Philips (NXP) SAA1064, is a 4-digit LED-driver with I2C-bus interface. The datasheet for the chip is availaible on the Philips website. The image above shows the connections to the IC; it was taken from the datasheet.

I am concerned with the data pins, SDA (Serial Data Line) [23] and SCL (Serial Clock Line) [24]. These are the $$I^2C$$ bus connections. It is important to note that the $$I^2C$$ bus is an open collector bus, and so pullup resistors are required.

As I am an animal, I decided that the best course of action would be to solder directly to the SAA1064 IC. The tracks on the PCB were very thin and the board already had a few dry joints and broken components where it had been transported to and from the rallies.

My Animal Tactics

At the other end of the wires connected my Velleman K8055. I used this to interface to the computer. Not the most efficient way of going about the problem, but it worked none the less. The I2C bus is connected to the SAA1064 as detailed above and at the Velleman K8055 to outputs Q1 and Q2. I used the two DAC to provide 5V to act as the $$I^2C$$ bus pull-up voltage. The two resistors (visible below) as as the bus pull-ups. The $$I^2C$$ bus is an open-collector bus, which allows for sophisticated protocol features such as bit-stretching (none of which are implemented in my code - see further down). The clamp line prevents over-voltages from damaging the Velleman K8055 board.

Connections to Velleman K8055

= Segment Mapping = The digit byte sent to the SAA1064 represents the 7 segments of the display. The 8th bit is the decimal point. I added a green LED to my board, as the decimal point. It breaks up the display very slightly. I had to map the 7 segments out to make numbers. These can be found in the code for this project inside the variable "character_map[]". Here is how I worked it out.

= Code = The code to run this via the Velleman K8055 and $$I^2C$$ is here in C: [[Media:K8055_I2C_SAA1024.tar.gz|K8055 I2C SAA1024 Code - C]]

This code is not amazingly well written. It does implement a poor version of the $$I^2C$$ bus, write only. It could be easily extended to support reading too, but I didn't need it, so it never happened. At the moment, it will take the current system time and display it on to 4 7-segment displays. The bus runs very slow via the Velleman K8055, due to the timings involved in the board. There is nothing that can be done about this. There are some very slight optimisations that can be made in the code, but these are minimal.

= Results = Although the updating of the display takes around 2 seconds, due to the speed at which the Velleman K8055 board can be updated, the display still works perfectly. The clock scenario works well. The display only updates every minute, and it is only written to if the minute has changed.

16:10 :)

The control software running in a terminal window.

The Software running in a terminal window, 64-bit Ubuntu