Understanding Car ECU and Electronic Computers

It’s time to take a harder look at the demands of real engines and how the logic of engine management systems work to satisfy them. Let’s see how a sample engine management computer operates. A digital microprocessor is essentially an array of microscopic switches and circuits and digital storage locations that have the ability to do a few simple things, such as turn on a
voltage to one circuit or memory location if a voltage is present in one (and only one) of two other circuits or memory locations (a capability that allows amplification, rather than just relay-type
switching). From this type of extremely basic decision-making ability comes all functionality of modern computers: from the simplest arithmetic to complex algorithms that actually simulate
human thought. In the same sense that electrons, protons, and neutrons are combined to make atoms—and atoms combined to make molecules—the basic electronic switching abilities of
a digital computer can be combined to perform more complex functions. Arithmetic and logical operations can be combined into a series of steps to solve a problem, like setting the pulse
width of a fuel-injection action. Microcomputers use quartz crystals that resonate at a particular frequency to coordinate internal operations. Microcomputers with very fast crystals and circuitry can perform millions or even billions of instructions per second. Using amplification circuitry, a digital microcomputer has the capability to activate or deactivate external circuits. For example, to turn on  an external device like a fuel injector, a microprocessor might perform a calculation, the result of which is that the number “1” is loaded into a special memory location called a register
in place of the previous value of “0.” This type of register is accessible not only to the microprocessor but to the center lead of a power transistor, which acts like a switch to allow (or not
allow) a larger current to flow between the transistor’s other two leads, which can be used (perhaps through additional amplification stages of the “driver” circuit) to ground an output wire leading to a coil in a fuel injector whose other end is connected to battery voltage when the ignition is on.

Electronic Control Unit – A Simple Introduction (2022) - AUTOTECHDRIVE

Thus, the microprocessor sets a bit in a register that changes the conductivity of a transistor that grounds and energizes an electromagnetic coil that pulls open a needle valve that allows fuel to spray into an engine. Working in the opposite direction, a device outside the computer can input data to the microprocessor as follows: A circuit outside the computer presents a signal from a sensor or other device (such as a nitrous arming switch). Input circuitry converts this to a low power signal that sets one or more bits in a register that represents a binary number, which is accessible to the microprocessor and can be used as the operand in a logical or arithmetic calculation that could, in turn, initiate various actions, depending on the state of the initial input signal. Random-access memory (RAM) is vital to the operation of a digital computer. Memory once consisted of a grid of tiny magnetic cores comprised of tiny ferrous rings surrounding the intersections of sets of three fine wires. Using the bidirectional principles of magnetic inductance, these cores could be written to or read with electrical current in the same way that an audio recorder writes or reads electrical signals representing music on a magnetic tape. These days, memory exists in semiconductors—silicon chips containing millions or even billions of circuits representing individual data bits that can be set either on or off, electrically speaking. Depending on whether RAM is static or dynamic, each data bit is stored in a cluster of transistors or in a chargeable capacitor associated with a pair of transistors. Random access memory (RAM) can be written to and read from extremely quickly, but the data is volatile, meaning it is soon lost when the memory is not powered, meaning it is not suitable for storing code and permanent (or semi-permanent) data while the
computer is turned off. Computers use RAM as a high-speed scratchpad to store data used by or generated by a computer program. When the computer is up and running, RAM may be used to store some or all of the programming instructions that direct the arithmetic logic unit of the computer to manipulate various kinds of data, though the basic machine instructions without which
a microprocessor cannot do anything at all (which may be all there is on simple embedded controllers) may reside exclusively on a read-only memory (ROM) chip that essentially cannot
be changed. ROM-based instructions, collectively, are often referred to as firmware—the term describing a special class of software that is embedded deeply in hardware and therefore
relatively fixed due to the difficulty or impossibility of making changes without replacing hardware. A simple program might fetch several data values, perform arithmetic on them, turn on
signals of certain durations, turn off the signal, and repeat this cycle again and again. This is the basic functioning of a fuel injection pulse-width calculation. Programmable read-only memory (PROM) retains its data when a microcomputer’s power supply is turned off. PROM can only be read by the microprocessor, not written to (though PROM, unlike ROM chips, can be removed and
“reprogrammed” by a special PROM-burner device using ultraviolet light; still, this can be inconvenient if a PROM chip is soldered to the circuit board rather than plugged into a socket). PROM may contain numbers that represent commands or instructions to the microcomputer, as well as numbers that are simply data. PROM is ideal for storing data that rarely or never changes, such as configuration information (that is, number of cylinders on a purpose-built OEM ECU installed exclusively to manage one type of V-8 engine), or the OEM fuel and timing curves for an engine. The ECU’s microcomputer would typically transfer such data into RAM at power-up time for faster access. The advantage of electrically erasable PROM (EEPROM) is it can be both read from and written to by the microprocessor itself. Byte-addressable EEPROM is relatively slow in access speed and in the past was not practical for storing large amounts of data.

Modern engine management computers store all calibration data in flash memory, a special class of EEPROM that must be addressed in relatively large blocks. Flash memory is ideal
for storing data values that a computer user or program must configure, such as the number of cylinders on an aftermarket programmable engine management computer that is capable of
operating engines with 1 to 12 cylinders. The arithmetic-logic unit (ALU) of a computer performs arithmetic and logical operations and generates the condition codes (status bits) that indicate whether the operation was successful. The ALU performs its operations using its own special high-speed memory called registers. Typically, the ALU loads an instruction that tells it which data to store in its registers, what simple operation to perform on the registers (such as arithmetic shift left, or logical OR, or whatever), and where to store the result of the operation—plus a data bit to indicate the status (success) of the operation. The ALU is a subset of the central processing unit (CPU). The CPU controls the operation of the microcomputer and is usually located in a microprocessor consisting of circuitry and memory located on a single microchip. 

Custom Ecu Software Remapping – Ultimate Performance

The input/output (I/O) system controls the movement of data between the computer and devices external to the computer with which it must communicate. An engine management computer receives data from sensors via the I/O system that give it information about the engine and its environment. The  computer also controls actuators such as fuel injectors that enable it to make things happen in the world via the I/O system. An EMS microcomputer must read data from engine sensors, perform internal processing on this data, and then send data via the I/O system to an injector driver circuit that will activate a solenoid-type injector (actuator) for a precise amount of time. Analog-to-digital circuitry onboard the microprocessor converts input analog voltages to digital numbers that are meaningful to the computer and useful in computations. Some input data from some external devices is already in digital two state binary format. Outbound data from a digital computer may be converted to an analog voltage and amplified enough to actuate a physical device such as an injector or an idle air control motor. Some automotive computers have direct-digital output channels for controlling peripherals like digital boost controllers. The input and output channels, RAM, ROM, A-D circuitry, and the CPU are connected using a data/address bus
that enforces a strict protocol defining when a device on the bus may move data to another device so that the bus can be shared by all. Microcomputers managing the engine of all 2008 and
newer road-going vehicles and some race cars interface through the I/O system to controller area network (CAN) bus to external diagnostic devices and special-purpose embedded controllers
that handle tasks like airbag deployment. A typical EMS microcomputer contains data and operating instructions that enable the computer to cycle endlessly through a programmatic loop that calculates raw fuel delivery and spark advance for the current engine rpm and loading over and over as long as the engine is running. The computer will modify these with additional enrichments or “enleanments” for cold or hot cranking, after-start operation, warm-up operation, acceleration, and so on. Software routines additionally regulate closed-loop idle and cruise air/fuel calibration. ECUs designed to control ignition events also compute speed and load-based spark advance and knock sensor-controlled ignition retard. An ECU may also contain programming for wastegate control, control of emissions devices such as EGR, and activation of nitrous oxide injection and fuel enrichment.

OCSALY