All posts by Brian Kelly

Binary to 7 Dual segment Display

Following on from the previous project, I have been asked to look at updating this project to drive two 7 seven segment displays instead of one seven segment display. So, instead of taking av4 bit binary input (0000 to 1111) and driving a single 7 Segment LED display with values from 0 to 9 and A to F; the plan is now to read 8 bit of binary data (00000000 to 11111111) and output corresponding hex value (00 to FF).

This is now makes this project and ideal tool that can be used on the retro computer build. As one of these circuits could be used to read the data bus while two could be used to read the address bus.

It does mean that we need to change the way the existing project is wired. The PIC controller only has 16 inputs/output pins. If we are to read the 8 bit binary data this leaves only 8 pins for driving the output and reading the control lines. As the 7 segment LED displays need 7 lines (8 if we include the decimal point) we need to look at an alternative way to drive the LED displays.

If we use a serial to parallel shift register we could drive 8 lines from just a clock and data line, by using a third pin we can enable/disable the shift register. This will let us drive all seven segments plus the decimal point. This solves the first issue of driving more lines from less pins on the PIC micro controller.

The next issue, is how do we drive two 7 segment displays. This can be achieved by multiplexing the display. By this I mean we light up one display with the segments required, then we switch on the other display and light up the segments on that display. By switching on the segments on the two LED alternating, we can give the appearance that both displays are on at the same time.

In the above circuit we can see we added a busy line to the circuit to let external circuits know when the decoder is busy updating the display.

The external circuit only needs to place the 8 bit data on the data bus, bring the enable pin low and then bring the write line low. The resistors on port A provide pull up logic, to ensure the data lines are not floating and are in a known state. The PIC micro controller has internal weak pull up resistors, so the resistor network RN1 may not be required, we will only know when we start testing.

Lets look at how this is going to work…

As this circuit will be used to drive LED displays which tend to be consume power, we don’t need to worry too much about power consumption, but lets not just ignore it, we still want to be as efficient as possible. With this in mind, the PIC micro controller will be using its internal oscillator of 4MHz. We could use an external 20MHz crystal / resonator, to allow for faster speeds. As we want to keep the costs down, there is no need to add parts that are not required. As the LED displays are used to display the result to us humans, we don’t need a fast refresh rate for the HEX display. So if the refresh rate is set to 100Hz it should provide a good display results. When the display is not getting updated the PIC should power down into standby more.

First we need to read the input and the control lines, when both the WR (Write) and EN (Enable) go LOW, the micro controller will set the BUSY pin active (LOW) and then read the 8 bit input. When the controller had saved the value to displayed, it will then set the BUSY pin inactive (HIGH).

A timer interrupt will activate every 10ms, the BUSY pin will go active (LOW) to indicate to any external circuit that the controller is refreshing the displays. Once the controller has finished refreshing the display it will the BUSY pin as inactive (HIGH).

When the PIC has the 8 bit data word, it will be broken into two 4 bit nibbles. Each 4 bit nibble will then be converted to a hex value. As the conversion for each nibble is the same, we can simplify the process by converting the first 4 bits from the right to our HEX value, then we shift right the word by 4 bits and cover the first 4 bits from the right to our HEX value. This means we can keep the routine from the previous project for converting our input to HEX.

Once we have the HEX output we can send it one bit at a time into the serial to parallel shift register. The 74HC164 IC the devices that we are using in this circuit, as it is low cost and simple to use. The A & B inputs will be tied together to ensure that we are sending the same data to the into the shift register.

The active low clear pin will be used to reset the IC while the CLK pin will be used to clock data into the shift register. Once we have clocked the data in, we then switch on the relevant 7 Segment LED display, to show the result.

7 Segment Display Lookup Table with BCD Data

The above table shows what segments of the LED display should be switch on to display the various values from 0 to F.

Electronic Repair, we need to change.

When thinking about electronics, what do you think about? Is it your laptop, your mobile phone, your fitness tracker or a home appliance? What happens when it breaks, what do you do? Do you bring it to a shop that can repair it? Can you find a shop that is willing to repair your device, or do you get told, it’s not designed to be repaired?

Have you had any of these questions?What are your options? Well, there was a time when on almost every street, there were repair shops where you could bring your faulty item in for repair. While, yes it could be expensive to get the item repaired, it could be repaired. The same is true today, but as a society we have become lazy and impatient. We want our stuff fixed instantly and we want it cheap! Oh yes, we cannot be without our beloved gadgets or appliances; we feel broken or incomplete. When we look into this further we have to ask the question, why? Why have we become so dependent on these devices? What is the social reasoning behind this?

One reason behind this is a technical addiction; yes the gadget may get us online for our social fix or endorphin rush when looking at the latest YouTube video, but at what cost?

I’m not going to discuss the pros and cons of being online, that’s a topic for others far more smarter than me to discuss. If our lives are going to be so dependent on being online, what are we going to do to ensure we’re able to get our fix, or make one gadget talk to another gadget? More importantly what are we going to do when it breaks? How important is it to us, really? If it’s that important, have we considered a backup plan? What to do when our primary gadget is no longer working?

If it’s that important that we have a backup, who will repair our beloved gadget? Can it be repaired and at what costs?

Personally I believe all items can be repaired to some level. This depends on the manufacture of the product, some vendors make it easy, some not so easy. While others will deliberately go out of their way to ensure the item cannot be repaired.

If you look at your car or your washing machine, both of these can be considered as gadgets and both can be repaired. Why is this so? The vendors understand that these gadgets will need to be maintained to keep operating. They make parts available for services centers to repair these gadgets. They also provide training to humans with a specific skill set, so they can perform these repairs.

Back in the early days of radio and TV it was very common for a family to purchase a kit form of one of these appliances, take it home, assemble it and get hundreds or sometimes thousands of hours of use before it needed a small repair; after which it would keep going until the next service or repair. This was very common up until the age of consumerism, where we were told we needed the latest gadget and needed it now and our previous gadget was obsolete. Or was it?

Yes, technology does evolve and move on. We have seen the disappearance of analogue TV, and very few new radio stations start broadcasting anymore. We now see digital TV, digital Radio, Internet Streaming of these services. These devices although more complicated than their earlier brethren can be repaired.

While repairing a vintage radio circa 1960’s, I discovered that the vendor had provided all the repair information inside a door on the radio. Why did they do this? It was because they knew, try as they may, some part would eventually fail and they wanted to give the customer the choice to perform the repair themselves. Yes, we were given a choice, repair it or take it to a shop who would repair it for us. As consumers we understood the value of these repairs and we had an idea how long it should take.

What about computers, I hear you say? Well recently I repaired a vintage BBC B Micro circa 1980’s, and again the vendor was able to provide the repair manual to allow these repairs to take place. This was common for most computers made in the ‘80s and ‘90s. There are still some computers that are repaired today for specialized industries.

In the 1990s, with the advancement in computers, they became modular, so you could swap out faulty components for working ones. Your faulty components could be sold/donated to companies who would perform these repairs. If you look at the more modern video card of today, which can cost thousands of euro, these are considered repairable by some companies.

Nowadays when our mobile phone breaks, we are told that it is not repairable. If you take five minutes and search on YouTube, I’m sure you will find someone who has performed a repair for the same fault that you identified with your gadget. So what’s wrong here?

As a society we have lost the skills to repair what we own. Some of these skills make take time to develop, but the more you do it, the better you become.

All I can say is to start small and work upwards, don’t try to repair your sister’s iPhone as your first repair attempt, unless you feel comfortable.

Let’s get back to being able to perform some basic repairs, instead of throwing that laptop or mobile phone in the bin. There may be someone out there who is prepared to put their time into repaiting that gadget for a charity. If you don’t want it, do the right thing and find it a new home. Let’s also think about the environment, just because your laptop doesn’t play high definition movies, it might be just right for someone learning about computers, who isn’t interested in multi-media.

If you can keep the gadget in circulation its not going into landfill; I’ve seen many laptops being thrown out with their batteries, containing lead and lithium going into landfill. What happens after, is that semi-state authorities are spending tens of thousands trying to remove these harmful materials from the waste. Where are they getting the money from? Us, we are the ones paying for this through our taxes; but if we all take a little bit of responsibility and think about what we are disposing, separate the harmful from the safe materials and the recyclable from the non-recyclable materials, we will be doing our little bit to help ourselves, our children and the environment.

And what of time and money? Your time and your money…ask yourself, are you one who is willing to spend cash on letting someone else perform the repair, and if so, how much is their time worth to them; if they spend four hours repairing your device are you willing to cover that cost? Do you value the service that this person is doing, or do you just want it cheap and don’t care about the cost? Ask yourself the same question if the situation was reversed. How would you feel?

Being a person who performs select repairs, I am choosy with my clients, as I have been on the receiving side of customers who would not pay for repairs, although I had spent many hours and purchased parts for their repair. It’s very disheartening as a technician, who takes pride in their work, not to be respected. It’s one reason why so many repair shops just close up and move on to other type of work. Yes, I do accept there are some cowboys out there, but in my experience they are only in the low percentages. It’s the consumers who have to step up and take responsibility for their actions, and value the work.

One way that consumers can take responsibility is to perform some basic repairs themselves. This, I have found, gives them a better understanding of what can go wrong with their gadget. This helps in two ways: firstly, when they take it to the shop, they will quickly identify the bullshit or when they are told mistruths about the repair; secondly, they will gain Insight into the effort required to repair their gadget.

One piece of advice I can give consumers when handing in their gadget for repair, is to be truthful with the technician. Tell them everything that happened, no matter how small, as the smallest piece of information may be all that is needed to change the repair time from six hours to one hour.

Rant over, hopefully this has given you some food for thought. It’s not everyone who wants to repair, but at least try to replace a plug on the next gadget you buy. Take the old plug off and keep it for next one (if not molded).

HX-20 Battery Refit

After searching through my part bins, I was able to find a contact that I fitted into the connector for the battery pack, to replace the contact that was corroded. I fitted some spacers between each of the cell, then wrapped the battery pack in some tape to seal it.

Once the pack was assembled, it was fitted back into the HX-20. While reassembling the computer, I spotted a dry joint on the DC jack. So once again I disassembled the computer to remove the main PCB.

Once the PCB was out, I removed the DC jack, cleaned the contact for the DC jack, cleaned the pads on the PCB, reassembled the computer and tested it. The computer beeped when it was powered on, but I got no text on the LCD. So scratching my head, I disassembled the computer and checked the connectors. They all looked good. Then I remembered that the computer may need to be reset, as the battery had been out of the laptop for a few days.

So while the LCD was not showing anything when powered on, I remembered that you need to press “CTRL & @” to initialise the computer. After entering in a dummy date time of “01010101101” and pressing “Enter”, the computer reset and the LCD became active.

Yeah, the battery has been replaced and the computer is working again. 👍