recently the flash memory (electrically erasable programmable read-only memory; EEPROM)
has become the norm. The amount of RAM (described in bytes, kilobytes, megabytes, or
gigabytes) determines the speed of operation, the amount of data that can be processed
and the complexity of the programs that can be implemented.
Digital input and output (I/O) ports
connect the microcontroller with external devices using
digital signals only. The high and low voltage in the signal correspond to on and off states.
Each digital port can be configured as an input port or an output port. The input port is used
to read in the status of the external device and the output port is used to send a control
instruction to an external device. Most microcontrollers operate over 0 to +5V with limited
current because the voltage signal is not used directly, only the binary status. If the voltage
and current are to be used to directly drive a device, a relay or voltage digital analog
convertor is required between the port and device. Usually digital I/O ports communicate or
“talk” with external devices through standard communication protocols, such as
serial
communication protocols
. For example, a microcontroller can use digital I/O pins to form
serial communication ports to talk to a general-purpose computer, external memory, or
another microcontroller. Common protocols for serial communication are UART (universal
asynchronous receiver-transmitter), USB (universal serial bus), I C (inter-integrated circuit),
and SPI (serial peripheral interface).
Analog input and output (analog I/O)
ports can be
connected directly to the microcontroller. Many sensors (e.g., temperature, pressure, strain,
rotation) output analog signals and many actuators require an analog signal. The analog
ports integrate either an
analog to digital (A/D) converter
or
digital to analog (D/A)
converter
.
The CPU, memory, and I/O ports are connected through electrical signal conductors known
as
buses
. They serve as the central nervous system of the computer allowing data,
addresses, and control signals to be shared among all system components. Each component
has its own bus controller. There are three types of buses: the data bus, the address bus,
and the control bus. The data bus transfers data to and from the data registers of various
system components. The address bus carries the address of a system component that a CPU
would like to communicate with or a specific data location in memory that a CPU would like
to access. The control bus transmits the operational signal between the CPU and system
components such as the read and write signals, system clock signal, and system interrupts.
Finally,
clock/counter/timer
signals are used in a microcontroller to synchronize operations
among components. A clock signal is typically a pulse sequence with a known constant
frequency generated by a quartz crystal oscillator. For example, a CPU clock is a high
frequency pulse signal used to time and coordinate various activities in the CPU. A system
clock can be used to synchronize many system operations such as the input and output data
transfer, sampling, or A/D and D/A processes.
Dostları ilə paylaş: