Breadboard Bits - Real Time Clock

My clock board, configured as a stopwatch, displaying the time since the board was powered up (3 minutes and 25 seconds).

I recently got ahold of a bunch of RTC-58321 chips from a surplus store. I expected them to be hard to use or have impossible to locate datasheets. As it turned out, nothing could be further from the truth.

The datasheet was readily available, and after a quick look at the small two-page document, I decided that I really liked this chip.

Now, it has the interesting feature that it internally stores everything in BCD, and it presents it over a simple 4-bit parallel bus. Well, in that same trip to the store, I had also picked up some very nice looking, miniature seven segment by four LED displays. These particular displays had the nice feature that, while matrixed, they were matrixed as a standard 7 segment display with four common anodes, plus some extra wires for the dots.

Well, thought I, I could make the RTC export one digit at a time, feed it through a 7447 and directly into the display. With this idea in my mind, I started building.

I matrixed the display with a simple 2-transistor multivibrator driving a 74163 counter driving a 74138 3-to-8 decoder. This part of the circuit was simple and should have worked. Alas, it did not. So I added an extra transistor buffer between the multivibrator and the '163. Slightly better, but still no dice. Finally I noticed that the 74163 was not the 74LS163A that I had ordered but a 74HCTLS163, which is a CMOS chip! I swapped it for a standard 74LS163A and the counter section sprung to life. The decoder, however, did not.

So I replaced the decoder. Same problem. So I swapped it again. And again. And again. All had the same problem. I doublechecked and triplechecked the datasheet. I was connecting it exactly as it should be connected. Finally I just set up a test jig and started popping every '138 I had available into it. Of the dozen that I had, only three passed that test (!) These particular 74LS138's were made by Fairchild in West Germany in 1983, all in the same batch, from a huge assortment lot I got surplus. It would appear that the whole batch was faulty.

Lesson the first: If your components come from an untrusted source, even if the components are normally very reliable, test them thoroughly before use.

Alas, I didn't learn my own lesson, and the chip that I was using that "passed" the test actually had two output pins shorted together. I replaced it with one of my two remaining '138s, and it worked fine after that.

The rest of the circuit fell into place quickly. I added some transistors to invert the logic levels from the 7447 to those more suitable to common cathode use (I did have some 7448 on hand, but for some reason outside my understanding, the '48 lacks the high current output transistors the '47 has). I added a 7404 hex inverter, and used 5 outputs to drive the multiplex signals. Then I dropped in the RTC itself, and a 74LS245 octal bus transciever, which I repurposed to serve as a 4-bit tristate buffer (I have way too many of these chip for my own good, so it was either this or the equally common 74LS373 transparent latch).

Doublechecked my connections, turned it on, and saw... 00:00. With no ticking. Hrm, something must be wrong, thought I, so I spend a bunch of time doublechecking my connections. Finally I spend enough time working on it that I leave the power connected for a session of live debugging, and notice the board tick over to 10:00. I had connected it like a clock, ignoring the seconds place, so it took a full minute for it to change. And I had the four display driving wires hooked up backwards. Other than that, it worked perfectly.

So I shuffled the wires into a position more becoming of a stopwatch (mm:ss) and turned it on. And it started ticking!