Microcontroller
What is PIC?
refers to family of microcontroller (small computer) → designed to control specific
devices or systems.
commonly used in embedded systems, used in a variety of applications, including
automotive system, consumer electronic, medical devices
know for low consumption, ease of use
available in a range of sizes and capabilities, with different memory sizes, clock
speed
PIC’s application
why need? ⇒
Control system → used to control motors, switches, sensors, LED, or the
example close to us is traffic light
Collection of data → collect data & process data from a variety of sensors
such as temperature, pressure, humidity
Audio → generate and process audio signals, used in application such as
instruments, sound effects or voice recognition
Security → used in encryption, authentication or access control
Components in PIC
1. Central Processing Unit (CPU): This is the main component of the PIC
microcontroller, which performs arithmetic and logic operations, executes
instructions, and manages data storage and retrieval.
2. Memory: This includes both Random Access Memory (RAM) and Read-Only
Memory (ROM). RAM is used for temporary storage of data during program
execution, while ROM contains program code and non-volatile data.
Microcontroller 1
3. Input/Output (I/O) Ports: These are used to interface with external devices, such as
sensors, actuators, and other microcontrollers. The number and type of I/O ports
vary depending on the specific PIC microcontroller model.
4. Timers/Counters: These are used to measure time intervals and perform counting
operations, and can be used for a variety of timing and control functions.
5. Analog-to-Digital Converter (ADC): This component is used to convert analog
signals from sensors into digital values that can be processed by the
microcontroller.
6. Serial Communication Interfaces: These are used to communicate with other
devices, such as other microcontrollers, computers, or communication networks.
Common serial communication interfaces include Universal Asynchronous
Receiver-Transmitter (UART), Serial Peripheral Interface (SPI), and Inter-Integrated
Circuit (I2C).
7. Oscillator: This component provides the clock signal used by the microcontroller to
synchronize its operations.
Compare with microprocessor
A microcontroller, such as a PIC, is a type of integrated circuit that contains several
components on a single chip, including a microprocessor. In contrast, a microprocessor
is a single-chip CPU that does not typically include other components such as memory,
I/O ports, or timers
Key difference
1. Integration: Microcontrollers are highly integrated systems that include a
microprocessor, memory, and various peripheral interfaces on a single chip,
whereas microprocessors are standalone CPUs that typically require additional
chips for memory and I/O interfaces.
2. Cost: Microcontrollers are typically less expensive than microprocessors because
they include multiple components on a single chip, reducing the overall component
count and cost of a system.
3. Power Consumption: Microcontrollers are designed to operate with very low power
consumption, making them ideal for battery-powered applications, whereas
Microcontroller 2
microprocessors may consume more power and require additional power
management components.
4. Real-Time Capabilities: Microcontrollers are often designed for real-time
applications, meaning they can quickly respond to input events or external stimuli,
whereas microprocessors may require additional hardware or software to achieve
real-time performance.
5. Programming: Microcontrollers typically use low-level programming languages,
such as assembly language or C, which are optimized for embedded systems, while
microprocessors are often programmed using higher-level languages such as C or
C++
Instruction cycle
Problem
draw schematic
program
Microcontroller 3