WorldWide Drilling Resource
Microprocessors are Really Simple by Britt Storkson Owner, P2FlowLLC Even though the word “microprocessor” conjures up images of computer nerds working their magic in some darkened room somewhere, microprocessors, when one gets down to the basic operation, are very simple products. They use electricity (electrical voltages) to make decisions. All microprocessors do two things: detect and measure voltages. It’s all they do. Silicon, the material most microprocessors are made of, has the unique property of being able to retain (remember) voltage levels. Most microprocessors are able to detect and measure two different types of voltage levels: digital and analog voltages. With digital voltages, a voltage greater than about 2.4 volts is defined as a “logic 1”. A voltage less than about 0.8 volts is defined as a “logic 0”. These voltage values are not tested or guaranteed by the manufacturer and they don’t have to be. All we’re concerned about with digital voltages is the voltage is above or below a certain point. Analog voltages are variable voltages. These are measured just like the voltage on a battery, using a voltmeter. These voltages can be compared to another “reference” voltage to determine if one voltage is greater than another, or they can be converted into a digital “word” and used as data information. Digital voltages can be compared to walking into a room and turning the light on. The light is either on or off. There is no in-between value. Analog voltages can be compared to the sun rising and setting. The sun has a variable “brightness value” depending on whether it is midday, morning, or evening. The sun is typically brighter midday, and its brightness varies de- pending on the time of day and other factors like cloud cover - just like voltages which are higher, lower, or in-between. All microprocessors work exactly the same way. Microprocessors have a CPU (central processing unit) which executes instructions stored in a memory. The instructions are arithmetic operations, such as adding or subtracting two values (numbers); logical operations, such as comparing two values to see if they are equal; or test operations to see if a certain point has voltage present (logic 1) or voltage absent (logic 0). What these instructions do and how many instructions are provided is defined by whoever makes the microprocessor. I use a Microchip brand microprocessor which makes many different microprocessor models. The model I use has 75 different instructions. Other microprocessor brands or models offer greater or fewer instructions, but they all do basically the same thing. The instructions are very simple, yet execute very quickly. We’re talking about microseconds (millionths of a second), typ- ically. What the instruction lacks in sophistication it makes up for in speed. A microprocessor costing less than $1 can execute thousands of instructions per second. Today’s microprocessors also require very little power to do all of this, making them suit- able for battery operation. Microprocessor instructions listed in the correct order make what is called a computer program. A simple program would be to make a thermostat where the output turns on when measured temperature goes below a certain point and turns off when it goes above a certain point. To do this, one measures the voltage output from the temperature sensor and converts it to a digital value. Then we use instructions to determine if the measured temperature value is above or below a value we compare it to. If we want to maintain the temperature within a certain “window”, we turn off a heater if it goes above our “high level off” value and turn it on if it goes below the “low level on” value. For this application there’s usually a “deadband” in between where the microprocessor doesn’t do anything. The microprocessor doesn’t stop working, it just waits until the right moment to respond. This is done for stability. An output switching off and on rapidly is something we don’t want. We want the heater (or anything else we control) to switch on or off in a controlled manner. Microprocessors are simple and in- expensive, yet powerful and reliable. They are used almost everywhere, in thou- sands of applications. There’s a good reason microprocessors are so popular: Because they offer so much for so little. Almost everything we do is monitored and/or controlled by a microprocessor - and it’s a good thing. Britt Britt Storkson may be contacted via e-mail to michele@ worldwidedrillingresource.com 40 JANUARY 2017 WorldWide Drilling Resource ®
RkJQdWJsaXNoZXIy NDk4Mzk=