Page 4
Semester 2: B.Sc Internet of Things
PIC 16F87X Microcontroller architecture and devices
PIC 16F87X Microcontroller Architecture and Devices
Overview of PIC 16F87X
The PIC 16F87X series is a family of microcontrollers developed by Microchip Technology. These microcontrollers are based on the enhanced mid-range architecture, which features a 14-bit instruction set. They are widely used in embedded systems due to their efficiency and ease of use.
Architecture
The architecture of the PIC 16F87X includes a 14-bit wide instruction set, a 13-bit program counter, and up to 368 bytes of RAM. It supports a 12-bit timer for various applications. The architecture has multiple register banks and a special function register (SFR) for controlling peripheral devices.
Memory Organization
PIC 16F87X microcontrollers have a unique memory architecture that includes program memory and data memory. Program memory is typically Flash memory, allowing for easy reprogramming. Data memory consists of static RAM, commonly used for data storage during program execution.
I/O Ports
The microcontroller includes multiple I/O ports that can be configured for different functions. Each port allows for digital input and output, accommodating various devices such as sensors, displays, and actuators.
Peripheral Features
The PIC 16F87X series integrates several peripheral features, including timers, an analog-to-digital converter (ADC), and serial communication interfaces like USART. These features enable robust interactions with other hardware components.
Applications
Due to its versatile architecture, the PIC 16F87X is used in a wide range of applications, including automotive systems, consumer electronics, industrial automation, and Internet of Things (IoT) devices. Its compact size and low power consumption make it suitable for mobile applications.
Peripheral features: Timers, Capture/Compare/PWM, I2C, USART, ADC
Peripheral features: Timers, Capture/Compare/PWM, I2C, USART, ADC
Timers
Timers are essential components in microcontrollers for measuring time intervals or generating delays. They can be configured in various modes such as up, down, or PWM mode. Timers are used for scheduling tasks, generating precise time delays, and managing events in real-time systems.
Capture/Compare/PWM
Capture/Compare modules are used to measure external signals or generate specific output signals. PWM (Pulse Width Modulation) is a technique used to control the amount of power delivered to devices. It converts a digital signal into an analog-like signal by varying the duty cycle, allowing control over motor speed, LED brightness, and other applications.
I2C (Inter-Integrated Circuit)
I2C is a communication protocol that allows multiple slave devices to communicate with a master device using only two wires: SDA (Serial Data Line) and SCL (Serial Clock Line). It is widely used for connecting sensors, EEPROMs, and other peripherals in embedded systems.
USART (Universal Synchronous/Asynchronous Receiver-Transmitter)
USART is a hardware communication protocol used for serial communication between devices. It can operate in synchronous or asynchronous mode, allowing for effective data transmission over short distances. USART is employed in data logging, debugging, and real-time communications.
ADC (Analog-to-Digital Converter)
ADC is a critical component that converts analog signals (continuous voltage levels) into digital data (discrete values). This conversion is necessary for microcontrollers to process real-world signals from sensors. ADC resolution impacts the accuracy of measurements, determining how finely the analog signal can be represented.
Embedded Systems: Definition and classification, CISC and RISC architecture
Embedded Systems: Definition and Classification, CISC and RISC Architecture
Definition of Embedded Systems
An embedded system is a dedicated computer system designed for specific control functions within larger systems. It is embedded as part of a device, often with real-time computing constraints.
Classification of Embedded Systems
Embedded systems can be classified based on several criteria including: 1. Based on Functionality: Standalone Embedded Systems, Real-Time Embedded Systems, Networked Embedded Systems. 2. Based on Performance: High-Performance Embedded Systems, Low-Power Embedded Systems. 3. Based on Hardware: Microcontroller-based Embedded Systems, FPGA-based Embedded Systems.
CISC Architecture
CISC stands for Complex Instruction Set Computing. It features a large set of instructions that can execute complex tasks in a single instruction. Benefits include reduced program size and easier compiler design, but it can lead to slower execution due to complex fetching and decoding.
RISC Architecture
RISC stands for Reduced Instruction Set Computing. It employs a smaller set of simple instructions that execute in a single clock cycle. The advantages include higher performance due to simplicity, ease of pipelining, and quicker execution times. Popular RISC processors include ARM and MIPS.
Real Time Operating Systems: Processes, tasks, memory and device management, scheduling in RTOS
Real Time Operating Systems: Processes, tasks, memory and device management, scheduling in RTOS
Introduction to RTOS
Real Time Operating Systems are designed to serve real-time applications that process data as it comes in, typically without buffer delays. These systems are critical in applications where timing is crucial.
Processes and Tasks in RTOS
In RTOS, processes are instances of executing programs. Multiple tasks can run concurrently and are typically lighter weight than traditional processes. The management of tasks enables effective multitasking, which is a core feature of RTOS.
Memory Management in RTOS
Memory management in RTOS is crucial for resource allocation and deallocation during task execution. It involves effective management of both RAM and non-volatile memory. Different strategies like static and dynamic memory allocation are employed.
Device Management in RTOS
Device management involves controlling and coordinating the use of hardware devices. RTOS provides device drivers that facilitate communication between the hardware and the software, enabling efficient data handling.
Scheduling in RTOS
Scheduling is critical in RTOS to ensure that high-priority tasks receive immediate attention while lower-priority tasks are handled appropriately. Various scheduling algorithms such as Rate Monotonic Scheduling and Earliest Deadline First are employed to manage task execution.
