18 FEBRUARY 2024 WorldWide Drilling Resource® Computer Order vs. Chaos by Britt Storkson Owner, P2FlowLLC In the world of computers, order must be maintained. This means all of the bits the program references must be correct. If even one bit is the incorrect status or value (meaning it is a 1 when it should be a 0 or vice versa) or is in the wrong location, it can cause the entire system to crash or “lock up” and not respond to any inputs except a master clear reset which we will get to later. We’ve discussed this before, but let’s review what a bit in computer terms is. A bit is the smallest unit of information a computer has to deal with. Each bit is either a “1” or a “0”. If you take a voltmeter and measure the voltage (with respect/reference to ground) of a bit if it measures 3.3 volts (in a 3.3-volt system), then it’s recognized as a “logic 1”. If the bit measures 0 volts, it is recognized as a “logic 0.” All of these bits are organized into “bytes” or “words.” A byte is always 8 bits. A word is anything more than 8 bits in length. When the bit, byte, or word is “written,” it remembers this information indefinitely. This is why it’s called computer memory. Each bit, byte, or word is numbered from 0 to whatever the limit of the memory is. The location of a memory unit is called an “address,” or, where it resides. Its address is numbered just like one would number the lines on a sheet of notebook paper. When the power is turned on to a computer microprocessor (which is the “brain” of the system), it goes to a predetermined point in the program memory. This is called “fetching the reset vector.” This is critically important because if the program does not start at the right place, nothing else will be right either. An instruction at that address will tell the program where to start executing instructions and, if everything is correct, it works flawlessly. What causes a computer to “not compute,” lock up, or otherwise malfunction? Quite a few things can do that, but most of the time it is caused by software errors. This means the microprocessor is given the wrong instruction or the correct instruction is in the wrong location. Both are critically important. Also, the computer may not go to this wrong instruction for some time - even months or years. This is why a computer can function just fine for a long period of time, only to inexplicitly malfunction or lock up. That’s where the master clear reset on the microprocessor comes into play. All microprocessors have a dedicated master clear pin which forces the program to start over at the reset vector location. Often, but not always, this corrects the problem because there is what is called an initialization routine at the start of the program which stores the correct values in the correct locations so the program execution can start properly. Maintaining stability - or order - is critical for proper computer operation. One way to lend stability and robustness to a computer system is to repeat the same operation multiple times. If all of the tests are “true” - meaning returning the same result every time - then one can be confident everything is correct. This is often used when interfacing with external switches. Mechanical, metal contact switches bounce when they make contact and the microprocessor can pick up each of these bounces resulting in erratic responses. The solution is to test the switch multiple times. If all of the tests prove true, we can be confident the switch press is valid and not the result of static electricity or other unintended stimulus. This multiple testing routine also provides a time delay before responding, which is often desirable. At places where I have worked, I don’t know how many times a computer system locked up causing significant disruption because something we depended on to do our tasks didn’t work anymore. Then typically - after a lot of frustration and a considerable amount of time wasted - the device was “fixed.” When we asked what happened to fix it, we were told “it just needed to be reset.” I’ve never used the master clear reset pin on the microprocessors used to make our computer controls. Why don’t I use that feature? Because one can write software to test for problem conditions and have the microprocessor (and not the user) perform the fix. I don’t have to wait for someone to press a button to trigger a reset because the software takes care of the problem virtually every time. Britt Britt Storkson may be contacted via e-mail to michele@worldwidedrillingresource.com
RkJQdWJsaXNoZXIy NDk4Mzk=