Digital Logic, Memory, and CAN Bus Communication Principles
Computer Fundamentals and Signal Processing
Defining a Computer System
A computer is a physical form for information processing. It takes data, adapts and compares it, and then generates signals for actuators.
Four Basic Functions of a Computer
- Input (Entry): This is a voltage signal sent by a sensor or switch.
- Processing: The input signal is compared with programmed instructions. Logic circuits transform the input entries into the required output order.
- Storage: Data is stored for comparison with current inputs. Input signals can also be stored for further processing.
- Output: After processing the information received from sensors and testing the program instructions, the result is output to command the different output units (actuators).
Analog Signals
An analog signal is one that varies continuously. Its characteristics, such such as a voltage signal, can take an infinite number of voltage values between a maximum and minimum, varying continuously over time.
Digital Signals
Digital signals are incremental in nature, meaning the electrical signal has only two discrete values: On and Off (or High and Low). There are no intermediate values. The maximum value is called Logical One (1), and the minimum value is called Logical Zero (0).
Signal Conversion
For a computer to receive information from an analog sensor and issue digital orders, an interface is necessary. This interface handles the conversion of signals between analog and digital formats.
Logic Circuits and Components
Decoder Circuit
A decoder circuit is used to determine the correct output based on a combination of given inputs. It typically uses a combination of logic gates. When the correct bit pattern is received by the decoder, a voltage signal is produced to activate the corresponding actuator.
Multiplexer (MUX)
The multiplexer is used to examine multiple inputs. It analyzes the priority of these signals and selects one input signal from many analog or digital input lines and forwards it into a single output line.
Bistable Circuits (RS Flip-Flops)
Bistable circuits (like RS flip-flops) are logic circuits that retain memory of previous inputs. They do not change their output state until a further input command is received.
Central Processing Unit (CPU)
The CPU is the brain of the computer. It consists of thousands of transistors placed on a small chip. It manages the flow of information both within and outside the computer. The CPU works by comparing current inputs with data stored in memory, and once the comparison is complete, the resulting signals are sent to the different actuators.
Computer Memory Systems
A computer requires two primary types of memory: temporary (volatile) and permanent (non-volatile). Within the computer memory chip, there are several blocks, each consisting of thousands of transistors. Some blocks are protected (locked) to confirm the recorded information.
Types of Memory
- ROM (Read-Only Memory): This is permanent memory and is not lost when the system is shut down.
- RAM (Random-Access Memory): This stores information read or written by the CPU and is also used for temporary instructions. If the current is cleared, the information is lost. It is typically composed of flip-flop integrated circuits on a chip.
- PROM (Programmable Read-Only Memory)
- EPROM (Erasable Programmable Read-Only Memory)
- EEPROM (Electrically Erasable Programmable Read-Only Memory)
- Nonvolatile RAM (NVRAM)
Network Communication and Protocols
Peripheral Signals
Input signals are often activated by the driver or operator, coming from the action exerted on a switch. These signals are used as inputs for the system.
Multiplexed Networks
Multiplexed networks allow various electronic units to share information from different sensors, saving on wiring and facilitating communication (dialogue) between all connected components. For this to work, a multiplexer combines all signals to travel together, and a demultiplexer separates them to communicate with the various electronic units.
Transmission System (BUS)
A pair of wires used to unite the various electronic units is called a BUS.
Transmission Protocol
A protocol is a set of rules that governs the encoding of information, speed, and other parameters. Protocols like CAN (Controller Area Network) and others (e.g., LIN, FlexRay) often use synchronous transmission, allowing data frames to be sent.
Data Frame Structure
Each data frame typically has at least seven blocks:
- Start: Indicates the beginning of the data packet.
- Destination Address: Specifies the location where the packet is addressed.
- Source Address: Specifies where the packet originated.
- Information Field: Carries the actual data.
- Error Control: Allows the system to detect whether the data has arrived correctly.
- Final: Marks the end of the frame (no information content).
CAN Protocol
The CAN Protocol facilitates serial data exchange between electronic units via the BUS. It operates in real-time and functions as a multimaster network, meaning each electronic unit can transmit data onto the network. CAN is message-oriented. Thanks to an identifier applied to the messages, priority is established. When two messages attempt to transmit simultaneously, the message with the highest priority is transmitted first.