This document contains assembly code for a PIC16F887 microcontroller to emulate a heart rate monitor and smart power socket. It includes code for different states like ready, datalog, and end. It uses timers, ADC, interrupts and other PIC16F887 features. Subroutines are used for debouncing buttons, delays and blinking LEDs. The code shows how assembly programming allows direct hardware access for embedded applications.
Basics and applications of programmable logic controller (plc)Ali Altahir
PLC is a multipurpose clock-driven memory-based electronic device which is also known as a specialized industrial computer which deals with different level of complexity and control system.
The document provides an overview of Real Games' ITS PLC product line for industrial automation training. It describes the ITS PLC concept of using 3D simulations of industrial systems controlled by PLCs. It then outlines the ITS PLC product line, including features of the Professional Edition for hardware PLC training, the ATG Edition for GRAFCET programming software, and the MHJ Edition for Siemens PLC training. Educational materials and the diverse customer base that uses ITS PLC for bridging industry needs and education are also summarized.
This document provides an overview of embedded systems and interfacing with the ATmega8 microcontroller. It discusses the characteristics of embedded systems and gives examples such as appliances, medical devices, vehicles, and more. It also covers the 8051 and AVR microcontrollers, focusing on the ATmega8's architecture, programming, and interfacing with various components like LEDs, LCDs, seven segment displays, motors, and sensors. The goal is to provide knowledge about embedded systems and practical experience interfacing the ATmega8 microcontroller.
Programmable logic controllers (PLCs) are digital electronic devices that use a programmable memory to store instructions and implement functions like logic, sequencing, timing, and arithmetic to control machines and processes. PLCs were developed to simplify control automation by replacing relay logic systems. A PLC consists of a processor, memory, input/output modules, and a power supply. It reads input signals, executes a stored program to control outputs, and then repeats in a scan cycle. Common programming methods for PLCs include ladder logic, statement list, and function block diagrams. PLCs are widely used in industry for their flexibility, reliability, and ability to operate in harsh environments.
this is a complete summer training report on embedded sys_AVR. It aslo includes a project and its coding and other topics which are learnt in training.
The document discusses different types of programming languages used in programmable logic controllers (PLCs), including ladder logic, Boolean logic, and Grafcet. It provides details on each language and describes common instruction sets used, such as timers, counters, arithmetic, and data manipulation. The document also covers IEC 61131-3 standard languages like ladder diagrams, function block diagrams, instruction lists, structured text, and sequential function charts. Finally, it discusses PLC architecture and different I/O bus network standards and configurations.
This is a small project on Siemens PLC Step 7 models. The project required lot of lateral thinking and logical decision making in order to develop programs for the traffic light management for the entire chandigarh city. The project is known as Total Traffic Security & Management (TTSM)
Basics and applications of programmable logic controller (plc)Ali Altahir
PLC is a multipurpose clock-driven memory-based electronic device which is also known as a specialized industrial computer which deals with different level of complexity and control system.
The document provides an overview of Real Games' ITS PLC product line for industrial automation training. It describes the ITS PLC concept of using 3D simulations of industrial systems controlled by PLCs. It then outlines the ITS PLC product line, including features of the Professional Edition for hardware PLC training, the ATG Edition for GRAFCET programming software, and the MHJ Edition for Siemens PLC training. Educational materials and the diverse customer base that uses ITS PLC for bridging industry needs and education are also summarized.
This document provides an overview of embedded systems and interfacing with the ATmega8 microcontroller. It discusses the characteristics of embedded systems and gives examples such as appliances, medical devices, vehicles, and more. It also covers the 8051 and AVR microcontrollers, focusing on the ATmega8's architecture, programming, and interfacing with various components like LEDs, LCDs, seven segment displays, motors, and sensors. The goal is to provide knowledge about embedded systems and practical experience interfacing the ATmega8 microcontroller.
Programmable logic controllers (PLCs) are digital electronic devices that use a programmable memory to store instructions and implement functions like logic, sequencing, timing, and arithmetic to control machines and processes. PLCs were developed to simplify control automation by replacing relay logic systems. A PLC consists of a processor, memory, input/output modules, and a power supply. It reads input signals, executes a stored program to control outputs, and then repeats in a scan cycle. Common programming methods for PLCs include ladder logic, statement list, and function block diagrams. PLCs are widely used in industry for their flexibility, reliability, and ability to operate in harsh environments.
this is a complete summer training report on embedded sys_AVR. It aslo includes a project and its coding and other topics which are learnt in training.
The document discusses different types of programming languages used in programmable logic controllers (PLCs), including ladder logic, Boolean logic, and Grafcet. It provides details on each language and describes common instruction sets used, such as timers, counters, arithmetic, and data manipulation. The document also covers IEC 61131-3 standard languages like ladder diagrams, function block diagrams, instruction lists, structured text, and sequential function charts. Finally, it discusses PLC architecture and different I/O bus network standards and configurations.
This is a small project on Siemens PLC Step 7 models. The project required lot of lateral thinking and logical decision making in order to develop programs for the traffic light management for the entire chandigarh city. The project is known as Total Traffic Security & Management (TTSM)
Project Report On Micro-controller Embedded SystemRkrishna Mishra
The document provides an overview of embedded systems and the 8051 microcontroller architecture. It discusses how embedded systems perform predefined tasks to control devices and can be optimized for size and cost. The 8051 is then introduced as a popular 8-bit microcontroller used in embedded systems. Its features include 4KB program memory, 128B data memory, 32 general purpose registers, timers, and I/O ports. Application areas of the 8051 like energy management, automobiles, and medical devices are outlined. Finally, the document describes the 8051 architecture in detail, including the pinout, programming model, and accumulator register.
Programmable Logic Controllers (PLCs) were developed to control industrial machinery in a programmable and reliable way. A PLC has a processor that executes stored instructions to control inputs and outputs based on ladder logic programming. It includes a power supply, memory to store the user program, and I/O modules to interface with field devices. PLCs offer advantages over hardwired control systems like easier programming, flexibility, and communication capabilities. They are used widely in industrial applications for tasks like sequencing, timing, counting, and analog control.
The document provides an overview of programmable logic controllers (PLCs), including their definition, history, components, functions, programming, and applications. Key points covered include:
- PLCs are digital electronic devices that use a programmable memory to implement control functions like logic and sequencing to control machines and processes.
- They were developed in the 1960s to replace hardwired control panels and provide easier modification of control programs.
- The basic components of a PLC system are the central processing unit, input/output modules, power supply, and programming software.
- PLCs continuously cycle through scanning inputs, running the user-created program, and updating outputs. The program is stored in memory
The document provides information about programmable logic controllers (PLCs). It defines a PLC as a digital computer used to automate electromechanical processes. The document then discusses the key advantages of PLCs like being cost-effective, flexible, and able to operate reliably for years. It also describes the basic architecture of a PLC including input and output modules, a central processing unit, and a programming device. Examples of ladder logic programming are also included to illustrate how PLCs can be programmed to control processes like starting motors in forward and reverse directions.
Programmable Logic Controllers Paper (PLC) SM54Subhash Mahla
This document discusses programmable logic controllers (PLCs). It begins by defining a PLC as a digitally operating electronic apparatus that uses programmable memory to implement logic, sequencing, timing and other functions to control machines and processes. The document then describes the basic components of a PLC, including I/O modules, a processor, power supply, memory unit and network interface. It explains how PLCs are programmed using programming units connected to computers and the transfer of programs to PLC memory using EEPROM chips.
An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints. Embedded systems are present in many devices such as household appliances, vehicles, medical equipment, smartphones, and more. They typically use microcontrollers or microprocessors to monitor and control embedded hardware components. Key components of embedded systems include a CPU, memory, I/O ports, and timers/counters. Microcontrollers integrate most of these components onto a single chip, while microprocessors require external components. Embedded systems use various addressing modes and have inputs like interrupts and timers that allow them to interact with the external environment. Common applications areas of embedded systems include consumer electronics, industrial automation, automotive systems,
An embedded system is a special purpose computer system that performs predefined tasks. It consists of hardware and software components. The document discusses the various hardware components of an embedded system like CPU, memory, sensors, ADC, DAC, actuators etc. It also explains microprocessor and microcontroller based embedded systems with examples like 8085, 8051 etc. Their architecture, pin diagrams and functionalities are described.
Practical Programmable Logic Controllers (PLCs) for Automation and Process Co...Living Online
This workshop is designed to benefit you with practical up-to-date information on the application of PLCs for the automation and process control of plants and factories. It is suitable for people who have little or no exposure to PLCs, but expect to become involved in some or all aspects of PLC installation. It aims to give practical advice from experts in the field, to assist you to correctly plan, program and install a PLC with a shorter learning curve and more confidence. The inventible question is which PLC is being used. We present this course focusing on the generic PLC and use the open programming IEC 61131-3 standard.
For specific examples we use the Allen Bradley range, but are not selling Allen Bradley or for that matter any other PLC! While the workshop is ideal for electricians, technicians and engineers who are new to PLCs, much of the workshop and additional material in the extensive manual will be of value to those who already have some basic skills, but need a wider perspective for larger and more challenging tasks ahead. The accompanying manual includes contributions from a number of experts and will become a valuable reference in your work. The information contained in this workshop advances from the basics to challenge even the most experienced engineer in the industry today.
WHO SHOULD ATTEND?
Consulting engineers
Design engineers
DCS personnel
Electrical engineers
Engineering managers
Instrumentation and control engineers
Instrumentation technicians
Process control engineers
Process control operators
Shift electricians
Trades staff working with or near PLCs
MORE INFORMATION: http://www.idc-online.com/content/practical-programmable-logic-controllers-plcs-automation-and-process-control-39
This document discusses jump instructions in PLC ladder logic. Jump instructions allow a PLC program to break its normal sequential execution and move to another part of the program. The key points covered are:
- Jump instructions work with label instructions to redirect program flow. The jump instruction moves execution to the rung with a matching label number.
- Jumps can move execution forward or backward within a program. Multiple jumps can target the same label. Jumps can also be nested within other jumps.
- Advantages of jumps include allowing a PLC to run multiple programs, jumping sections during faults to reduce downtime, and improving scan time performance.
- An example is provided demonstrating a parking lot control system
Microcontroller (8051) by K. Vijay KumarVijay Kumar
The document provides an overview of microprocessors and microcontrollers. It discusses why they are needed in modern devices and some key components like the CPU, memory, I/O ports, and timers. The document then compares microprocessors and microcontrollers, noting that microcontrollers have these components integrated onto a single chip, making them well-suited for applications where cost, power and space are priorities. It also provides details on the 8051 microcontroller, including its memory architecture, I/O ports, and special function registers.
This document provides an overview of a seminar on programmable logic controllers (PLCs). The objectives are to describe PLC components, interpret specifications, apply troubleshooting techniques, convert relay logic to PLC languages, and operate and program PLCs. The contents include the history of PLCs, relay logic, PLC architecture such as CPU and I/O systems, programming concepts, applications, and troubleshooting. PLCs were developed to replace relay-based control systems and are now widely used in industrial automation.
The document provides an introduction to programmable logic controllers (PLCs). It discusses the main components of a PLC system including discrete and analog input/output modules. Discrete modules connect simple on/off field devices while analog modules interface with devices that have continuous values like temperature, pressure etc. The document also describes the typical parts of a PLC like the central processing unit, power supply, and programming device. It explains the benefits of PLCs like ease of programming and flexibility compared to traditional relay-based control systems. Finally, the document discusses PLC programming languages and provides examples of common applications.
This document provides an introduction to programmable logic control (PLC) and Siemens SIMATIC S7 PLCs. It outlines the module objectives, assessment criteria, and topics to be covered including basic PLC components, programming methods, and Siemens STEP 7 software functions. The key topics covered are the basic principles of PLCs and control systems, PLC components and architecture, input/output modules, programming representations like LAD and FBD, and program execution methods.
This document provides a user's guide for the Electrical Control workshop of the Automation Studio simulation software. It includes instructions for building basic electrical control circuits, defines the properties of electrical components, and provides examples of circuits and their simulations. Components can be added from the Electrical Control library and linked together. Circuits can be simulated step-by-step or continuously, and components can be manually activated during simulation. Color changes show the status of components during operation.
This document is a project report submitted by students of Central Polytechnic College for their diploma in electronics and communication engineering. It details the development of a computer vision system to assist visually impaired people. The system uses a camera to detect and identify objects and people, and an audio playback IC to audibly describe the detections to the user. It has a PIC microcontroller at its core, and includes other components like an LCD, power supply, and serial communication chips. The report includes sections on the system design with block diagrams, detailed descriptions of each hardware component, and the software used to program the microcontroller. The aim of the project is to help blind or visually impaired people navigate and identify objects independently without assistance.
Learn PLC Programming Free - A Beginners GuideACC Automation
PLC Beginner’s Guide to PLC Programming
There are many different PLC manufacturers with different hardware and software. All of the programmable logic controllers have similar basic features. Here is how I would approach learning about basic PLCs.
This document outlines a training course on programmable logic controllers (PLCs) using the Siemens S7-1200 PLC and TIA Portal software. The course consists of 9 modules that cover topics such as PLC hardware components, programming basics, function blocks, timers and counters, math operations, diagnostics, closed-loop control, networking, and human-machine interfaces. The introduction module describes the major PLC components, relay ladder logic, and provides an overview of the S7-1200 PLC and TIA Portal software. The course objectives are to teach students how to program and configure the S7-1200 PLC to automate various industrial processes and systems.
Summer training project report on embedded system at BSNL ALTTC Ghaziabad. Submitted by RAM AVTAR (ECE Department of IMSEC) of 2016 Batch. Submitted in IMS Engineering College, Gaziabad
The document describes the design of a CPU with an 8-bit instruction set. It includes the design of the instruction set architecture, microarchitecture, and implementation in VHDL. The CPU was tested using assembly programs loaded into program memory to perform operations like decrement, increment, shift left, and logic complement. The design and testing demonstrate the basic functioning of the CPU.
The document compares options for embedded computing hardware components for an IoT smart power socket product. It evaluates the ATmega328P microcontroller with CC3100 WiFi module, Electric Imp imp002 board, and ESP8266 WiFi SoC. The ATmega328P/CC3100 combination is recommended due to flexibility, support for customization, and reliability needed to control home appliances remotely. Prototyping is needed to address design challenges like EMI from relay switching within the small form factor.
Project Report On Micro-controller Embedded SystemRkrishna Mishra
The document provides an overview of embedded systems and the 8051 microcontroller architecture. It discusses how embedded systems perform predefined tasks to control devices and can be optimized for size and cost. The 8051 is then introduced as a popular 8-bit microcontroller used in embedded systems. Its features include 4KB program memory, 128B data memory, 32 general purpose registers, timers, and I/O ports. Application areas of the 8051 like energy management, automobiles, and medical devices are outlined. Finally, the document describes the 8051 architecture in detail, including the pinout, programming model, and accumulator register.
Programmable Logic Controllers (PLCs) were developed to control industrial machinery in a programmable and reliable way. A PLC has a processor that executes stored instructions to control inputs and outputs based on ladder logic programming. It includes a power supply, memory to store the user program, and I/O modules to interface with field devices. PLCs offer advantages over hardwired control systems like easier programming, flexibility, and communication capabilities. They are used widely in industrial applications for tasks like sequencing, timing, counting, and analog control.
The document provides an overview of programmable logic controllers (PLCs), including their definition, history, components, functions, programming, and applications. Key points covered include:
- PLCs are digital electronic devices that use a programmable memory to implement control functions like logic and sequencing to control machines and processes.
- They were developed in the 1960s to replace hardwired control panels and provide easier modification of control programs.
- The basic components of a PLC system are the central processing unit, input/output modules, power supply, and programming software.
- PLCs continuously cycle through scanning inputs, running the user-created program, and updating outputs. The program is stored in memory
The document provides information about programmable logic controllers (PLCs). It defines a PLC as a digital computer used to automate electromechanical processes. The document then discusses the key advantages of PLCs like being cost-effective, flexible, and able to operate reliably for years. It also describes the basic architecture of a PLC including input and output modules, a central processing unit, and a programming device. Examples of ladder logic programming are also included to illustrate how PLCs can be programmed to control processes like starting motors in forward and reverse directions.
Programmable Logic Controllers Paper (PLC) SM54Subhash Mahla
This document discusses programmable logic controllers (PLCs). It begins by defining a PLC as a digitally operating electronic apparatus that uses programmable memory to implement logic, sequencing, timing and other functions to control machines and processes. The document then describes the basic components of a PLC, including I/O modules, a processor, power supply, memory unit and network interface. It explains how PLCs are programmed using programming units connected to computers and the transfer of programs to PLC memory using EEPROM chips.
An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints. Embedded systems are present in many devices such as household appliances, vehicles, medical equipment, smartphones, and more. They typically use microcontrollers or microprocessors to monitor and control embedded hardware components. Key components of embedded systems include a CPU, memory, I/O ports, and timers/counters. Microcontrollers integrate most of these components onto a single chip, while microprocessors require external components. Embedded systems use various addressing modes and have inputs like interrupts and timers that allow them to interact with the external environment. Common applications areas of embedded systems include consumer electronics, industrial automation, automotive systems,
An embedded system is a special purpose computer system that performs predefined tasks. It consists of hardware and software components. The document discusses the various hardware components of an embedded system like CPU, memory, sensors, ADC, DAC, actuators etc. It also explains microprocessor and microcontroller based embedded systems with examples like 8085, 8051 etc. Their architecture, pin diagrams and functionalities are described.
Practical Programmable Logic Controllers (PLCs) for Automation and Process Co...Living Online
This workshop is designed to benefit you with practical up-to-date information on the application of PLCs for the automation and process control of plants and factories. It is suitable for people who have little or no exposure to PLCs, but expect to become involved in some or all aspects of PLC installation. It aims to give practical advice from experts in the field, to assist you to correctly plan, program and install a PLC with a shorter learning curve and more confidence. The inventible question is which PLC is being used. We present this course focusing on the generic PLC and use the open programming IEC 61131-3 standard.
For specific examples we use the Allen Bradley range, but are not selling Allen Bradley or for that matter any other PLC! While the workshop is ideal for electricians, technicians and engineers who are new to PLCs, much of the workshop and additional material in the extensive manual will be of value to those who already have some basic skills, but need a wider perspective for larger and more challenging tasks ahead. The accompanying manual includes contributions from a number of experts and will become a valuable reference in your work. The information contained in this workshop advances from the basics to challenge even the most experienced engineer in the industry today.
WHO SHOULD ATTEND?
Consulting engineers
Design engineers
DCS personnel
Electrical engineers
Engineering managers
Instrumentation and control engineers
Instrumentation technicians
Process control engineers
Process control operators
Shift electricians
Trades staff working with or near PLCs
MORE INFORMATION: http://www.idc-online.com/content/practical-programmable-logic-controllers-plcs-automation-and-process-control-39
This document discusses jump instructions in PLC ladder logic. Jump instructions allow a PLC program to break its normal sequential execution and move to another part of the program. The key points covered are:
- Jump instructions work with label instructions to redirect program flow. The jump instruction moves execution to the rung with a matching label number.
- Jumps can move execution forward or backward within a program. Multiple jumps can target the same label. Jumps can also be nested within other jumps.
- Advantages of jumps include allowing a PLC to run multiple programs, jumping sections during faults to reduce downtime, and improving scan time performance.
- An example is provided demonstrating a parking lot control system
Microcontroller (8051) by K. Vijay KumarVijay Kumar
The document provides an overview of microprocessors and microcontrollers. It discusses why they are needed in modern devices and some key components like the CPU, memory, I/O ports, and timers. The document then compares microprocessors and microcontrollers, noting that microcontrollers have these components integrated onto a single chip, making them well-suited for applications where cost, power and space are priorities. It also provides details on the 8051 microcontroller, including its memory architecture, I/O ports, and special function registers.
This document provides an overview of a seminar on programmable logic controllers (PLCs). The objectives are to describe PLC components, interpret specifications, apply troubleshooting techniques, convert relay logic to PLC languages, and operate and program PLCs. The contents include the history of PLCs, relay logic, PLC architecture such as CPU and I/O systems, programming concepts, applications, and troubleshooting. PLCs were developed to replace relay-based control systems and are now widely used in industrial automation.
The document provides an introduction to programmable logic controllers (PLCs). It discusses the main components of a PLC system including discrete and analog input/output modules. Discrete modules connect simple on/off field devices while analog modules interface with devices that have continuous values like temperature, pressure etc. The document also describes the typical parts of a PLC like the central processing unit, power supply, and programming device. It explains the benefits of PLCs like ease of programming and flexibility compared to traditional relay-based control systems. Finally, the document discusses PLC programming languages and provides examples of common applications.
This document provides an introduction to programmable logic control (PLC) and Siemens SIMATIC S7 PLCs. It outlines the module objectives, assessment criteria, and topics to be covered including basic PLC components, programming methods, and Siemens STEP 7 software functions. The key topics covered are the basic principles of PLCs and control systems, PLC components and architecture, input/output modules, programming representations like LAD and FBD, and program execution methods.
This document provides a user's guide for the Electrical Control workshop of the Automation Studio simulation software. It includes instructions for building basic electrical control circuits, defines the properties of electrical components, and provides examples of circuits and their simulations. Components can be added from the Electrical Control library and linked together. Circuits can be simulated step-by-step or continuously, and components can be manually activated during simulation. Color changes show the status of components during operation.
This document is a project report submitted by students of Central Polytechnic College for their diploma in electronics and communication engineering. It details the development of a computer vision system to assist visually impaired people. The system uses a camera to detect and identify objects and people, and an audio playback IC to audibly describe the detections to the user. It has a PIC microcontroller at its core, and includes other components like an LCD, power supply, and serial communication chips. The report includes sections on the system design with block diagrams, detailed descriptions of each hardware component, and the software used to program the microcontroller. The aim of the project is to help blind or visually impaired people navigate and identify objects independently without assistance.
Learn PLC Programming Free - A Beginners GuideACC Automation
PLC Beginner’s Guide to PLC Programming
There are many different PLC manufacturers with different hardware and software. All of the programmable logic controllers have similar basic features. Here is how I would approach learning about basic PLCs.
This document outlines a training course on programmable logic controllers (PLCs) using the Siemens S7-1200 PLC and TIA Portal software. The course consists of 9 modules that cover topics such as PLC hardware components, programming basics, function blocks, timers and counters, math operations, diagnostics, closed-loop control, networking, and human-machine interfaces. The introduction module describes the major PLC components, relay ladder logic, and provides an overview of the S7-1200 PLC and TIA Portal software. The course objectives are to teach students how to program and configure the S7-1200 PLC to automate various industrial processes and systems.
Summer training project report on embedded system at BSNL ALTTC Ghaziabad. Submitted by RAM AVTAR (ECE Department of IMSEC) of 2016 Batch. Submitted in IMS Engineering College, Gaziabad
The document describes the design of a CPU with an 8-bit instruction set. It includes the design of the instruction set architecture, microarchitecture, and implementation in VHDL. The CPU was tested using assembly programs loaded into program memory to perform operations like decrement, increment, shift left, and logic complement. The design and testing demonstrate the basic functioning of the CPU.
The document compares options for embedded computing hardware components for an IoT smart power socket product. It evaluates the ATmega328P microcontroller with CC3100 WiFi module, Electric Imp imp002 board, and ESP8266 WiFi SoC. The ATmega328P/CC3100 combination is recommended due to flexibility, support for customization, and reliability needed to control home appliances remotely. Prototyping is needed to address design challenges like EMI from relay switching within the small form factor.
The document discusses options for multi-core platforms for human machine interfaces (HMIs) in industrial applications. It evaluates Texas Instruments' Sitara AM57x system on chip (SoC), Freescale/NXP's MAC57D5xx multi-core ARM-based microcontroller, and Intel's Atom E3800 SoC. The Sitara AM57x provides various CPU core options along with graphics and communications interfaces. The MAC57D5xx includes ARM Cortex cores, a graphics accelerator, and I/O processor. The Atom E3800 is based on Intel's x86 architecture and offers integrated graphics and I/O. A comparative analysis of these options is presented to determine the most suitable multi-
The document summarizes a student project on web-based control of a pressure loop apparatus using LabVIEW. The project involved designing a closed-loop feedback control system using proportional, integral and derivative (PID) control to regulate air pressure. A virtual laboratory system was created using G-Web Server in LabVIEW to allow remote web-based control and monitoring of the pressure loop. The system could enable applications such as virtual laboratories for distance learning or web-based supervisory control and data acquisition in industry.
Gregg Carlson report sample California LV Strip Sept 18Gregg Carlson
1) Southern California is the largest feeder market for visitors to the Las Vegas Strip, supplying around 25-30% of visitors annually between 2004-2008.
2) Historical economic trends in Southern California like GDP, employment and income have tracked closely with visitation and spending levels on the Las Vegas Strip.
3) Both the Southern California and Las Vegas Strip economies have suffered significantly during the recent recession, with most economic indicators remaining negative in 2009. A recovery is not expected until late 2010 or 2011 according to forecasts.
Web based control of pressure loop apparatusOsama Azim
The document summarizes a student project on web-based control of a pressure loop apparatus using LabVIEW. The project involved designing a closed-loop feedback control system using proportional, integral and derivative (PID) control to regulate air pressure. A virtual laboratory system was created using G-Web Server in LabVIEW to allow web-based monitoring and control of the pressure loop. The system could enable applications such as remote experimentation and industrial process monitoring over a network.
This document discusses the components of a control system, including primary elements/sensors that measure process variables, controllers that compare measurements to setpoints and compute corrections, final control elements like control valves that implement corrections to manipulate the process, and the process itself. It provides examples of a level control loop for a surge tank, describing how level is measured by a sensor and adjusted by a control valve based on the controller's output to maintain the setpoint level. Signal types used between components and common controller types are also outlined.
This document provides an introduction to a course on Process Instrumentation and Control. It defines process control as dealing with mechanisms, architectures, and algorithms for controlling processes. Examples of controlled processes include controlling temperature with steam addition and maintaining fluid levels in tanks. The objectives of control are to maintain operational conditions, transition between conditions, and define key terminology like manipulated and disturbance inputs, control and output variables, and common control structures like SISO, MIMO, and PID controllers.
Instrumentation and process control fundamentalshossam hassanein
Basic course covers:
-Basic understanding of process control
-Important process control terminology
-Major components of a process loop
-Instrumentation P&ID symbols
A Computer Based Artificial Neural Network Controller with Interactive Audito...theijes
The proposed design offers a complete online and offline solution to manage the industrial systems. The designed hardware able to, read analog signals, digital signals, and controls many devices in real time. The heart of the hardware part is microcontroller PIC18F4550 which communicate with a computer via USB. The software part is programmed using Visual C# software to control managed system requires. The system operator can monitor system and diagnostic faults manually or automatically based on artificial neural network. Finally, the system has been simulated and implemented successfully.
This document describes an energy saving visitor counter project that uses a microcontroller and infrared sensors. The objective is to design a circuit that can count the number of people entering and exiting a room and control the room light accordingly. It uses an IR transmitter and receiver to detect movement and increments or decrements the counter value, which is displayed on seven-segment displays. The microcontroller controls the counting and display functionality while receiving input from the IR sensors. Proteus and Keil software are used to simulate and program the microcontroller respectively.
This document discusses embedded systems and provides examples of embedded system applications. It can be summarized as:
Embedded systems are specialized computer systems designed to perform dedicated functions. They are found in devices ranging from smartphones and appliances to vehicles and industrial equipment. Embedded systems typically have specialized hardware optimized for the specific application and software stored in read-only memory. Microcontrollers, which integrate a processor, memory and input/output peripherals on a single chip, are commonly used as the central processing unit in embedded systems. Examples of embedded systems applications discussed include biomedical devices, industrial controls, and consumer electronics.
ELE2303 Assign 1 Page 1 ELE2303 Embedded Systems Design.docxjack60216
ELE2303 Assign 1 Page | 1
ELE2303 Embedded Systems Design
Assignment 1 – Gas Monitor Unit Stage 1
Description Marks out of Wtg (%) Due date
Gas Monitor Unit – Stage 1 200 20 28/04/14
Purpose
This assessment is intended to evaluate the student’s capability in selecting and configuring a
microcontroller unit (MCU), designing simple interface hardware and writing subroutines to
operate those interfaces.
Please note – the purpose of studying a ‘design’ course like this, is that you learn how to design
hardware and write programs to solve new problems. This requires you to understand the how
individual parts of the microcontroller function and how to control them with a program. You are
expected to link together pieces of interface circuitry and combine segments of program you
learn about in the course materials, into a structured solution. Do not expect to find a ‘solution’
to this problem on the internet. Expect that you have to create it!
Grading of this assessment
This task will be assessed against the course objectives 1, 2, 3, 4, 6 and 7. This assessment will
be graded (F, C, B, A, HD) using a rubric marking scheme against criteria such as: the
appropriate selection and use of microcomputer hardware; the design of I/O hardware to meet a
specification; implementation of software to meet a specification; quality of documentation
including organisation of ideas and format; spelling, grammar and punctuation. Note - this
course is a communications benchmark course, hence marks will be awarded for the quality of
documentation.
Assignment Requirements
This assessment requires students to meet the requirements the specification below. Select a
suitable microcontroller from the PIC18 family, design simple interface hardware, write
and test some C programs (subroutines) to operate the hardware interface and then document
the hardware and software as a proposed design. Software is to be written in C using the
MPLAB X IDE. You must create an MPLAB X project which may include one or more C
source files. The testing is to be completed using either: the Oshonsoft PIC18 simulator or the
MPLAB X simulator.
There is NO requirement to assemble any hardware, or layout a PCB for this assignment.
The circuit design for the hardware may be drawn using electronics CAD software, OR hand-
drawn and scanned, for inclusion in the documentation. The ‘hardware’ can be successfully
configured and simulated on the Oshonsoft PIC18 simulator or the MPLAB simulator. A few
screen captures of the software under-going testing are to be included in the documentation.
ELE2303 Assign 1 Page | 2
Each student is required to submit:
1. A report in PDF format which includes:
a brief introduction (100 – 150 words) outlining the design requirements based on the
specification.
the hardware design (250 – 300 words) explaining the key elements of the design and
how they meet the specification, plus ...
Industrial monitoring and control system using android applicationAvinash Vemula
Automation takes the complete control of total plants few authentication and manual actions are needed from user side for completing action .Hence there is a must situation for users presence at all times in the control for taking some timely needed control actions. The proposed system provides a good solution to this problem. The whole control room environment is additionally implemented in the arm-android platform and the same is communicated to the process through Bluetooth. Now the user in control can use mobile at anytime, anywhere to monitor and control the whole plant.8051 is used here for acquiring process control parameters from the sensors like temperature, gas etc and transmitting it via a Bluetooth module to an android device. Hence the parameter values can be monitored and stored simultaneously.
This document describes a microcontroller-based password protected home appliance system. It contains an introduction, block diagram, flowchart, component descriptions, circuit diagram, and descriptions of hardware and software implementations. The system uses an ATmega8 microcontroller to control access to home appliances via a keypad password entry system. It allows authorized users to access appliances when the entered password matches the one stored in memory. The document also discusses objectives, components, programming, and conclusions regarding lessons learned and potential future modifications.
This document describes a digital alarm clock designed and implemented on an Artix7 FPGA development board using Verilog HDL. The clock displays time in hours, minutes and seconds using 8 seven-segment displays and blinks the decimal point LED between hour and minute display. It allows the user to set the current time and alarm time using buttons and has functionality for clock setting, alarm setting and an alarm alert indicator LED or sound. The design was tested successfully using hardware on the FPGA board and some minor issues were addressed. Future work proposed includes modifying the clock format and adding a date display.
Real-Time Monitoring and Control System for Industryijsrd.com
Industrial automation and control systems become an integral part of industries and hence the project Real-Time Monitoring and Control System is an important system. Real-Time Monitoring and Controlling System aims to monitor the environmental parameters like Temperature, Humidity, Pressure statistics in any factory and controlling peripheral systems also transmit parameter wireless to the Monitoring room using Zigbee Technology. It uses ARM 7 based embedded technologies from NXP which is sister company of Philips and made for used in highly sensitive and critical Real Time systems.
This document describes a home automation system that allows control of appliances like TVs, fans, and lights from an Android mobile phone using Bluetooth. The system uses an 8-bit microcontroller board with an AT89S52 microcontroller and HC-05 Bluetooth module. The microcontroller is programmed to control electronic devices connected to its input/output ports based on commands received from an Android application via Bluetooth. Feedback on the devices' status is also provided using LED indicators connected to the microcontroller board. The system provides a low-cost and flexible way to automate home or office appliances remotely using a mobile phone.
This document describes a home automation system that allows control of appliances like TVs, fans, and lights from an Android mobile phone using Bluetooth. The system uses an 8-bit microcontroller board with an AT89S52 microcontroller and HC-05 Bluetooth module. The microcontroller is programmed to control electronic devices connected to its input/output ports based on commands received from an Android application via Bluetooth. Feedback on the devices' status is also provided using LED indicators connected to the microcontroller board. The system aims to provide a low-cost and flexible wireless home automation solution.
1) The document describes an internship report submitted by Daman Singh Walia for an embedded systems training program using PIC microcontrollers.
2) The training covered architecture, memory organization, interrupts, and timers of PIC microcontrollers. The intern interfaced hardware including LEDs, switches, LCDs, and Bluetooth modules with PIC microcontrollers.
3) The document provides information on embedded systems, PIC16F877A microcontroller features, and how to interface common hardware components like LEDs, switches, and LCDs with PIC microcontrollers.
1 PageAlarm Clock Design Using PIC18F45E.docxmercysuttle
1 | Page
Alarm Clock Design Using PIC18F45
ELEC 310
Submitted by: Maria AlKadhem
Contents
Detailed Specification: 2
Input: 2
LCD display: 2
Microcontroller: 4
Clocking Choice 5
Working theory: 5
Pin out of the device: 6
LCD interfacing: 6
Final comments: 7
Introduction:
The major purpose of the project is to get familiar with the PIC18FXX series microcontrollers. We are ought to design an alarm clock which will be able to display the time on an LCD as well as we can give input through the dip switches. The dip switches will be able to increment the hours and minutes. We will go through the detailed design a bit later in the document.
In order to implement the alarm clock we had to make external circuitry as well which was necessary for the following functions.
· Input
· Buzzer
· Display at LCD.
The pith of the alarm clock is to run the clock of MCU in counter mode. When the counter is set the MCU starts counting till the number and then when the threshold is generated the output signal is used to start a buzzer. At the same time there is an LCD used in the circuit which will be responsible for displaying the three things.
· Current time.
· Alarm time
· Remaining time.
For setting the alarm there are two DIP switches. One for adjusting the hours and other is used for adjusting the minutes. For clearing the alarm we simply will be pressing both at a time. The corresponding ports of the MCU will be used in the INPUT mode.Detailed Specification:
Let’s discuss the detailed specifications of this device.Input:
The input of the alarm clock consists of two DIP switches. One switch will be used for adjusting the hours. The second switch will be used for the adjustment of the minutes.
Each time a button is at high logic there will be an increase in the corresponding variable of alarm.
When both of the buttons are pressed there will be a reset of clock making the value to 0.0. It will be the off state of the clock as well.LCD display:
We are using a 16x 2 display screen which is of 16 pin. The device is TRULY LCD MODULE MTC-C162DPRN-2N. It is capable of displaying 16 characters in 2 lines at a time. Making overall 32 characters.
The pin Details are given below for the LCD module.
Pin NO. Symbol Level Description
1 VSS 0V Ground
2 VDD 5.0V Supply voltage for logic
3 VO --- Input voltage for LCD
4 RS H/L H : Data, L : Instruction code
5 R/W H/L H : Read mode, L : Write mode
6 E H, H →L Chip enable signal
7 DB0 H/L Data bit 0
8 DB1 H/L Data bit 1
9 DB2 H/L Data bit 2
10 DB3 H/L Data bit 3
11 DB4 H/L Data bit 4
12 DB5 H/L Data bit 5
13 DB6 H/L Data bit 6
14 DB7 H/L Data bit 7
15 NC --- No Connection
16 NC --- No Connection
The VSS is kept at ground.
Last 2 pins are not included in the design they are not used at all.
Microcontroller:
The selected microcontroller is PIC18F452 because of the following reasons.
This powerful 10 MIPS (100 nanosecond instruction execution) yet easy-to-program (only 77 single word instructio ...
Report (Electromagnetic Password Door Lock System)Siang Wei Lee
This document describes a student's mini project to develop a microcontroller-based electronic door lock system. It includes chapters on the introduction, design and implementation, and software design. The introduction provides background on embedded systems and microcontrollers. It defines the problem of people forgetting door keys and outlines the project aims to create a cheaper digital door lock system. The design and implementation chapter describes the hardware design including schematic diagrams for the power supply, microcontroller, LCD display, buttons/buzzer/relay, and keypad units. It also includes PCB layout diagrams. The software design chapter discusses configuring the microcontroller ports and LCD, and scanning the keypad using functions to detect button presses and check the password.
The user manual provides step-by-step instructions for installing and configuring the AKCP Door Control Unit (DCU) and its access control components. It describes the DCU hardware, how to wire the DCU to card readers, fingerprint readers, exit buttons, and door locks. It also provides diagrams of typical installations and specifications for cable runs. The manual is intended to guide users through setup and common configurations.
This document describes a home automation system that allows control of appliances like lights and fans from an Android mobile phone using Bluetooth. The system uses an 8-bit microcontroller with Bluetooth module to wirelessly communicate with the mobile phone. Home appliances are connected to the microcontroller board, which receives on/off commands from a mobile app to control the appliances. Feedback is provided on the device status by lighting LEDs on the microcontroller board. The system provides a low-cost way to automate home devices using a mobile phone over Bluetooth wireless technology.
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
This document provides an overview of embedded systems and microcontrollers. It defines a microcontroller as a single-chip computer containing memory, input/output circuitry, and other components to function without additional support. The document describes the features and components of a typical microcontroller, including registers, instruction sets, addressing modes, and peripherals. It compares microcontrollers to microprocessors and provides examples of using LEDs and 7-segment displays with microcontrollers.
As many of the industries use induction motors. So, controlling of induction motor plays a very vital role. So,
our project concentrates on controlling the speed of induction motor using Android phone remotely by the help of the
Bluetooth technology. We use Android application which uses Bluetooth to connect to the Bluetooth modem of
control circuit which is connected to the motor. Bluetooth modem is interfaced with microcontroller. The Bluetooth
slave modem receives the command from the mobile phone. The Bluetooth modem sends the signal to the
Microcontroller. The Microcontroller decodes the signal and sends to the relays. Then, respective relay operates to
change the speed of Induction motor from 0% to 100%.
We are not only controlling the speed of the Induction motor, using feedback network we can also detect the
over temperature, high voltage, low voltage, MCB tripping on account of any faults. And we are also adding an extra
application which is very important in industries. That is, monitoring of phase lines. Because these types of
uncertainties like over temperature, high voltage, low voltage etc are likely to happen in Industries. So, this project
will be very helpful in industries, house hold, shopping malls etc.
Development Of An Internet Controlled Surveillance Mobile Robot Part1mimi
The document discusses the development of an internet controlled surveillance mobile robot. The robot can be remotely controlled and stream video over the internet using Xbee modules. The objectives are to construct a robot that can be remotely controlled with a camera for surveillance purposes. So far, the student has constructed the robot and understands how it functions and communicates remotely. Future work includes installing gas sensors on the robot and displaying sensor readings on an LCD.
2. Coursework - 1B : PIC16F887 Assembly Programming
1 | H63ECH - Embedded Computing Osama Azim
1B-i : Heart Monitor
o Introduction:
With available on-board I/O's on the PIC Kit2 - one push button, eight LEDs - the
coursework objectives resemble a simplified heart beat monitor.
Following prominent features of a portable heart beat recorder/monitor were required to be
developed on a PIC16F887 Microcontroller (MCU) in PIC Assembly language using the
MPLAB assembler:
User identification stored in device memory and displayed - emulated by storing
Student ID in MCU EEPROM and successful write operation indicated on LEDs
Device ready or in standby mode - emulated by signaling an LED on/off
Data-logging of heart beat sensor readings - emulated by blinking an LED
intermittently
End of data-log - emulated by indicating appropriate LED sequence upon input from
a pushbutton
o State Diagram and Flow Charts:
Above described coursework objectives can be represented by following state diagram:
State actions:
State Ready: LED 0 is turned ON, initially device enters State Ready by a pushbutton press after EEPROM
data writing.
State Datalog: LED 0 maintained ON while LED 1 blinks intermittently, next transition is upon a
double click of pushbutton and further delay of 3 seconds. LED 4 turned on to indicate a
double press and hold on time.
State End: LED 0, LED 1 are turned OFF, LED 2 turned ON. Transition back to State Ready
on Button press.
Figure1: State diagram
State
Ready
State
DataLog
ButtonPress
= 0
ButtonPress = 1
Double Press = 1,
Delay 3 sec.
Button Double
Press = 0
State
End
ButtonPress = 1
ButtonPress
= 0
3. Main Program Flow Chart
No
No
No
Write Student ID to EEPROM
Start
Debounce
Button
Press?
Turn On LED 5,6,7 :
from Port D
Debounce
State Ready:
LED 0 ON,
LED 2 OFF
Button
Press?
State Datalog:
LED 1 OFF
Delay
Decrement ENDATAL
ENDDATAL
= 1?
State End:
LED-2 ON,
LED-0 OFF,
LED-1 OFF,
LED-4 OFF
LED 1 ON
Button
Press?
Delay
Yes
Yes
Double Click
Double
Click?
Load "10"
To ENDDATAL
Yes
Yes
No
No
Yes
4. Coursework - 1B : PIC16F887 Assembly Programming
3 | H63ECH - Embedded Computing Osama Azim
Flow Chart for Double Click:
Notes on double click:
Hold time for continuous button press during LED 1 blink cycle can be adjusted by
loading appropriate value to DINTERVAL (for max press time) register.
Second click wait time can also be adjusted similarly by loading an appropriate value
to DINTERVAL after first click release
Yes
From
Main
Program
Flow
Yes
Load DINTERVAL
(For maximum second click
wait time)
No
DINTERVAL
= 0 ?
No
Load DINTERVAL
(For maximum press time)
Timer
Button
Press?
Decrement
DINTERVAL
State Datalog:
Blink Routine
Button
Press?
Yes
No
Timer
Button
Press?
Load ENDDATAL,
LED-4 ON
Yes
Decrement
DINTERVAL
DINTERVAL
= 0 ?
No
Yes
No
5. Coursework - 1B : PIC16F887 Assembly Programming
4 | H63ECH - Embedded Computing Osama Azim
o Discussion and Conclusion:
All coursework objectives were realized with certain modifications and known issues, these
are noted in following points:
A debounce subroutine was developed to filter out unwanted, noise like, pushbutton
transitions during button press. This subroutine, although effective, was not
extensively optimized and a more efficient debounce logic can be developed.
The transition hold time of 3 seconds from State DataLog to State End is indicated by
LED 4 being turned ON, this also indicates a successful double press. Though not
essential, this feature was implemented for a better device state indication - as the
double click can often be disregarded due to exit from second click hold time or short
successive click interval.
Upon detecting a click in between of State Datalog blink loop, LED 1 is maintained
ON until a second click is detected or maximum wait time for second click is reached,
whichever occurs earlier. The program developed could not check for double click
while blinking LED 1 simultaneously, but the LED 1 hold ON time during double click
subroutine can be reduced by adjusting the wait time for second click.
Conclusion and Learning outcome:
Programming with a lower level language, assembly, is directly dependent on the
target CPU/MCU. This is in contrast with higher level languages like C - for which the
compiler provides an illusion of codes being generic for multiple machine
architectures.
Considering that every CPU/MCU is designed with their respective assembly
instructions, programs written in assembly for a specific architecture is more robust
when compared to a higher level language.
Due to its hardware dependent nature, optimum hardware utilization can be
achieved by programming in assembly. This is especially useful for embedded
applications, wherein a CPU/MCU is dedicated to execute predetermined tasks,
keeping cost of hardware down along with achieving a higher degree of reliability.
6. Coursework - 1B : PIC16F887 Assembly Programming
5 | H63ECH - Embedded Computing Osama Azim
1B-ii : Smart Power Socket
Introduction:
As described in the Coursework-1A report, the Smart Power Socket was conceptualized as an IoT device
with IP based remote switching and monitoring.
The features realized using the provided PIC16F887 MCU based PIC Kit 2 development board:
A Button Press emulates the remote command to switch device On/Off. With an initial press of
pushbutton, appropriate LED is turned On or Off.
Current consumed by appliance is emulated by varying the voltage supplied to MCU ADC
through the onboard potentiometer.
Usage of ADC :
The PIC16F887 ADC is configured with following parameters:
Port: PORT A, PIN 0
Channel: RA 0 - ADC channel 0
ADC voltage reference: Positive: Vdd, Negative: Vss
ADC conversion clock: Fosc/8
Result Formatting: Left Justified
The conversion process is executed in following steps:
Figure 1: ADC conversion TAD Cycles
The output result format used is left justified, the ADRESH register that holds the conversion result has
following structure:
7. Coursework - 1B : PIC16F887 Assembly Programming
6 | H63ECH - Embedded Computing Osama Azim
Figure 2: ADRESH register format
The ADC conversion result is calculated using the formula:
ADC = VIN/VREF * 1023
The application designed for this coursework turns ON a respective LED in accordance to the voltage
level converted at the ADC. The PIC Kit 2 development board has 8 LEDs connected to PORT D.
Considering an input voltage range of 0V to 5V, each LED is stepped on a voltage of 0.625V (5V/8). The
reference ADRESH value to stitch LEDs is calculated below:
LED ON
Voltage In
(v)
ADC Value Binary
Decimal Ref
(ADRESH)
0 0.625 128 00100000 00 32
1 1.25 255 00111111 11 63
2 1.875 384 01100000 00 96
3 2.5 512 10000000 00 128
4 3.125 640 10100000 00 160
5 3.75 767 10111111 11 191
6 4.37 894 11011111 10 223
7 ~5 1019 11111110 11 254
o State Diagram and Flow Chart:
The program toggles between two states as explained below:
State OFF: All LEDs turned OFF, wait for push button to transition to State ON.
State ON: Capture ADC value and turn ON respective LED to signify voltage level. Next press
of Pushbutton makes the transition back to State OFF.
Figure1: State diagram
State
OFF
ButtonPress
= 0
State
ON
ButtonPress = 1
ButtonPress
= 0
ButtonPress = 1
8. Coursework - 1B : PIC16F887 Assembly Programming
7 | H63ECH - Embedded Computing Osama Azim
Flow Chart for Smart Plug:
Start
Move
ADRESH to W
Yes
Delay Cycle
for Capacitor
Start A2D
Conversion
A2D
Done?
Debounce
Button
Press?
Yes
No
No
Button
Press?
Yes
Clear PORT D -
All LEDs Off
No
YesADRESH =
"x" Volt Level?
No "x" matching
LED = ON
Clear
PORT D
9. Coursework - 1B : PIC16F887 Assembly Programming
8 | H63ECH - Embedded Computing Osama Azim
o Discussion and Conclusion:
Known Issues:
After successive On/Off transitions, the LEDs were found not to turn on by press of
pushbutton, and would turn on only after a change in potentiometer value.
Design Limitations and Conclusion:
Achieving complex design objectives, such as IoT based control, through Assembly is a
lengthy process which would require extensive effort - these objectives can be achieved
with relative ease through higher level programming languages. The focus of this
coursework was not to implement a feature heavy design, but to understand the various
machine level operations such as calculated usage of ADC or utilization of MCU timers, for
example.
Assembly programming, as its uniquely defined for each device, enables complete hardware
usage of target CPU/MCU - this allows for an in depth understanding of the various
computing and peripheral components that make up a MCU. Although assembly codes are
not suitable for real world applications today, knowledge of the underlying hardware and
understanding of the "assembly program development approach" would encourage
programmers to develop efficient programs in higher level languages as well.
10. Coursework - 1B : PIC16F887 Assembly Programming
9 | H63ECH - Embedded Computing Osama Azim
Appendix - i : Subroutines
Subroutines used at multiple instances in Coursework:
COUNTD:
B7 B6 B5 B4 B3 B2 B1 B0
x x x x x x x 1/0
Appropriate COUNTD bit can be tested for required delay to achieve debounce
Flow Chart for
Timer Subroutine:
Using:
Overflow time = 4 * (1/Fosc) *
Prescale * (256-TMR 0)
We have:
Overflow Time = 6.55 x 10-2
sec
Flow Chart for
Delay subroutine:
Delay = (6.55 x 10-2
Sec) * (2X
)
Flow Chart for
Debounce Subroutine:
Yes
Timer
Timer
Rolled
Over?
No
Clear Interrupt
Flag
RETURN
No
Delay "x" ms
TIME1
=0?
RETURN
Yes
Move Time
Multiplier to
TIME1
Timer
Decrement
Time Multiplier
Moved to BUTTOND, and B0
tested for denounced Press
Move COUNTD
to BUTTOND
Yes
Debounce
Button
Press?
No
Delay
Increment
COUNTD
Button
Release?
No
Yes
Delay
Clear COUNTD
RETURN
11. Coursework - 1B : PIC16F887 Assembly Programming
10 | H63ECH - Embedded Computing Osama Azim
Appendix - ii : Coursework 1B-i , Heart Beat Monitor, Assembly Code
#include <p16F887.inc>
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF &
_CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
cblock 0x20
COUNTD
BUTTOND
TCOUNT
TIME
TIME1
COUNTER
DINTERVAL
ENDDATAL
endc
org 0
START: BSF STATUS, RP0 ;SELECT BANK 1
MOVLW B'00000111' ; CONFIGURE TIMER0 PRESCALER BITS
MOVWF OPTION_REG ; MOVE TO OPTION REG
MOVLW 0x01
MOVWF TRISB ; PORTB, PIN0 SET AS INPUT FOR SWITCH
CLRF TRISD ; PORTD SET TO ALL OUTPUTS FOR LEDs
BSF STATUS, RP1 ; SELECT REGISTER BANK 3
MOVLW 0X00
MOVWF ANSELH ; PORTB PINS SET AS DIGITAL INPUT
BCF STATUS, RP0 ; SELECT REGISTER BANK 0
BCF STATUS, RP1
CLRF PORTD ; INITIALIZE PORTD AS ALL OFF (LEDs)
CLRF COUNTD ; CLEAR GPR DATA
CLRF BUTTOND
CLRF COUNTER
CLRF TCOUNT
CLRF TIME
CLRF ENDDATAL
12. Coursework - 1B : PIC16F887 Assembly Programming
11 | H63ECH - Embedded Computing Osama Azim
BSF STATUS, RP1 ; SELECT BANK 2
MOVLW D'99' ; DECIMAL 99, LAST DIGITS OF STUDENT ID:023799
MOVWF EEDATA ; LOAD TO EEDATA
MOVLW 0x20 ; EEPROM ADDRESS
MOVWF EEADR
BSF STATUS, RP0 ; SELECT BANK 3
BSF EECON1, 2 ; WRITE ENABLE FOR EEPROM
BCF INTCON, 7 ; DISABLE GLOBAL INTERRUPTS
MOVLW 0x55 ; SAFETY PROCEDURE
MOVWF EECON2
MOVLW 0xAA
MOVWF EECON2
BSF EECON1, 1 ; START WRITING
BCF STATUS, RP0 ; SELECT BANK 0
BCF STATUS, RP1
BSF PORTD, 5 ; LED 5, 6, 7 ON TO INDICATE WRITE COMPLETE
BSF PORTD, 6
BSF PORTD, 7
S_READY: CALL DEBOUNCE1 ; CHECK DEBOUNCE, BUTTON PRESS
BTFSS BUTTOND, 0 ; BUTTON PRESS?
GOTO S_READY
BSF PORTD, 0 ; INDICATE STATE READY
BCF PORTD, 2 ; CLEAR INDICATION FOR STATE END
S_DATALOG: CALL DEBOUNCE1 ; CHECK DEBOUNCE, BUTTON PRESS
BTFSS BUTTOND, 0 ; BUTTON PRESS?
GOTO S_DATALOG
BLINK: BCF PORTD, 1 ; START BLINK, LED 1 = OFF
CALL DELAY260 ; LED 1 OFF DELAY
DECF ENDDATAL ; CHECK IF DATALOG STATE NEEDS TO END,
;DECREMENT ENDDATAL REGISTER
MOVF ENDDATAL, W ; CHECK IF ENDDATAL HAS REACHED 1
XORLW 1
BTFSC STATUS, Z ; IF YES, GOTO STATE END
GOTO S_END
BSF PORTD, 1 ; BLINK, LED 1 = ON
CALL DELAY260 ; LED 1 ON DELAY
BTFSC PORTB, 0 ; CHECK IF BUTTON IS PRESSED
GOTO BLINK ; IF NOT, LOOP BLINK
13. Coursework - 1B : PIC16F887 Assembly Programming
12 | H63ECH - Embedded Computing Osama Azim
GOTO DOUBLEC ; IF YES, CHECK FOR DOUBLE CLICK
S_END: CLRF ENDDATAL ; CLEAR ENDDATAL REGISTER
BSF PORTD, 2 ; INDIACATE STATE END BY LED 2 = ON
BCF PORTD, 0 ; TURN OFF OTHER LEDs
BCF PORTD, 1
BCF PORTD, 4
CALL DELAY1000
GOTO S_READY ; GO TO STATE READY, CHEC FOR NEXT
; BUTTON PRESS
DEBOUNCE1: BTFSC PORTB, 0 ; CHECK IF BUTTON PRESSED
GOTO DEBOUNCE1
CALL DELAY130 ; DELAY TO FILTER FALSE CLICKS
CLRW
INCF COUNTD ; INCREMENT DEBOUNCE COUNTS, TO
; B'00000001'
BTFSS PORTB, 0 ; CHECK IF BUTTON RELEASED
GOTO $-1
CALL DELAY130 ; DELAY TO FILTER FALSE RELEASE
MOVF COUNTD,W ; MOVE DEBOUNCE COUNT TO BITTOND. BUTTOND
; IS NOW B'00000001'
MOVWF BUTTOND
CLRF COUNTD ; CLEAR COUNTD REGISTER
RETURN ; RETURN FROM DEBOUNCE
DOUBLEC: MOVLW D'3' ; LOAD MAXIMUM PRESS DELAY TO DINTERVAL
MOVWF DINTERVAL
CALL DELAY520
BTFSC PORTB, 0 ; BUTTON STILL PRESSED?
GOTO CHECK ; IF NOT, CHECK FOR SECOND PRESS
DECR1: CALL TIMER ; DECREMENT MAXIMUM PRESS COUNT
DECFSZ DINTERVAL
GOTO DECR1
GOTO BLINK ; RETURN TO BLINK
CHECK: MOVLW D'32' ; LOAD MAXIMUM WAIT FOR SECOND PRESS TO
DINTERVAL
MOVWF DINTERVAL
CALL TIMER
CHECK2: BTFSC PORTB, 0 ; CHECK FOR SECOND PRESS
GOTO DECR2 ; WAIT FOR SECOND PRESS
MOVLW D'10' ; LOAD ENDDATAL WITH BLINK END DELAY TIME
MOVWF ENDDATAL
BSF PORTD, 4 ; INDICATE DOUBLE PRESS WITH LED 4 = ON
GOTO BLINK
14. Coursework - 1B : PIC16F887 Assembly Programming
13 | H63ECH - Embedded Computing Osama Azim
DECR2: CALL TIMER ; DECREMENT DINTERVAL FOR SECOND PRESS WAIT
DECFSZ DINTERVAL
GOTO CHECK2
GOTO BLINK ; RETURN TO BLINK IF NO SECOND PRESS
TIMER: BTFSS INTCON, T0IF ; WAIT FOR TIMER TO ROLL OVER
GOTO TIMER
BCF INTCON, T0IF ; CLEAR INTERRUPT FLAG
RETURN
DELAY130: MOVLW D'1' ; LOAD TIME MULTIPLYER TO TIME1
MOVWF TIME1
CALL TIMER
DECFSZ TIME1,F ; DECREMENT TIME1, RETURN IF ZERO
GOTO $-2
RETURN
DELAY260: MOVLW D'3'
MOVWF TIME1
CALL TIMER
DECFSZ TIME1,F
GOTO $-2
RETURN
DELAY520: MOVLW D'7'
MOVWF TIME1
CALL TIMER
DECFSZ TIME1,F
GOTO $-2
RETURN
DELAY1000: MOVLW D'15'
MOVWF TIME1
CALL TIMER
DECFSZ TIME1,F
GOTO $-2
RETURN
DELAY2000: MOVLW D'31'
MOVWF TIME1
CALL TIMER
DECFSZ TIME1,F
GOTO $-2
RETURN
END
15. Coursework - 1B : PIC16F887 Assembly Programming
14 | H63ECH - Embedded Computing Osama Azim
Appendix - iii : Coursework 1B-ii , Smart Power Socket, Assembly Code
#include <p16F887.inc>
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_OFF &
_CPD_OFF & _CP_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
cblock 0x20
COUNTD
BUTTOND
TIME
TIME1
DINTERVAL
endc
org 0
START: BSF STATUS,RP0 ; SELECT BANK 1
MOVLW B'00000111'
MOVWF OPTION_REG
MOVLW 0x01
MOVWF TRISB ; PORTB, PIN0 SET AS INPUT FOR SWITCH
MOVLW 0xFF
MOVWF TRISA ; PORT A IS ALL INPUT
CLRF TRISD ; PORT D IS ALL OUTPUT
MOVLW 0x00 ; Left Justified, Vdd-Vss referenced
MOVWF ADCON1
BSF STATUS,RP1 ; SELECT BANK 3
MOVLW 0x01 ; PORT A, PIN0 IS ANALOG
MOVWF ANSEL
MOVLW 0x00 ; PORT B, ALL PINS DIGITAL
MOVWF ANSELH
BCF STATUS,RP0 ; RETURN TO BANK 0
BCF STATUS,RP1
MOVLW 0X41
MOVWF ADCON0 ; A2D CLOCK SET TO Fosc/8, A2D CHANNEL 0
; SELECTED (RA0), TURN ON A2D MODULE
16. Coursework - 1B : PIC16F887 Assembly Programming
15 | H63ECH - Embedded Computing Osama Azim
CLRF ADRESH ; CLEAR/INITIALIZE REGISTERS
CLRF PORTD
CLRF TIME
CLRF TIME1
ON: CLRF PORTD
CALL DEBOUNCE1 ; CHECK DEBOUNCE, BUTTON PRESS
BTFSS BUTTOND,0 ; IF BUTTON PRESSED, GO TO CONVERT A2D
AND TURN LED ON
GOTO ON
ADC: NOP ; WAIT FOR BYPASS CAP TO SETTLE VOLTAGE
NOP
NOP
NOP
NOP
NOP
BSF ADCON0,GO_DONE ; START A2D CONVERSION
BTFSS ADCON0,GO_DONE ; CHECK IF CONVERSION DONE
GOTO $-1
MOVF ADRESH, W ; MOVE CONVERTED VALUE TO W
CN: XORLW 1 ; CHECK IF A2D CONVERSION IS 1, LESS THAN 0.625V
BTFSC STATUS, Z
GOTO LEDN ; RESET PORT D
C0: XORLW 32 ; CHECK IF A2D CONVERSION IS 32, 0.625V
BTFSC STATUS, Z
GOTO LED0 ; LED0 ON
C1: XORLW 63 ; CHECK IF A2D CONVERSION IS 63, 1.25V
BTFSC STATUS, Z
GOTO LED1 ; LED1 ON
C2: XORLW 96 ; CHECK IF A2D CONVERSION IS 96, 1.875V
BTFSC STATUS, Z
GOTO LED2 ; LED2 ON
C3: XORLW 128 ; CHECK IF A2D CONVERSION IS 128, 2.5V
BTFSC STATUS, Z
GOTO LED3 ; LED3 ON
C4: XORLW 160 ; CHECK IF A2D CONVERSION IS 160, 3.125V
BTFSC STATUS, Z
GOTO LED4 ; LED4 ON
C5: XORLW 191 ; CHECK IF A2D CONVERSION IS 191, 3.75V
BTFSC STATUS, Z
17. Coursework - 1B : PIC16F887 Assembly Programming
16 | H63ECH - Embedded Computing Osama Azim
GOTO LED5 ; LED5 ON
C6: XORLW 223 ; CHECK IF A2D CONVERSION IS 223, 4.37V
BTFSC STATUS, Z
GOTO LED6 ; LED6 ON
C7: XORLW 254 ; CHECK IF A2D CONVERSION IS 254, 5V
BTFSC STATUS, Z
GOTO LED7 ; LED7 ON
OFF: BTFSC PORTB,0 ; BUTTON PRESSED?
GOTO ADC ; GOTO CONVERTING A2D IF BUTTON NOT PRESSED
GOTO ON ; GOTO RESET PORT D AND WAIT FOR NEXT BUTTON PRESS
LEDN: CLRF PORTD
GOTO ADC
LED0: CLRF PORTD ; RESET PREVIOUS PORTD D VALUE, LED
BSF PORTD, 0 ; SET APPROPRIATE LED
GOTO ADC ; GOTO CONVERTING A2D
LED1: CLRF PORTD
BSF PORTD, 1
GOTO ADC
LED2: CLRF PORTD
BSF PORTD, 2
GOTO ADC
LED3: CLRF PORTD
BSF PORTD, 3
GOTO ADC
LED4: CLRF PORTD
BSF PORTD, 4
GOTO ADC
LED5: CLRF PORTD
BSF PORTD, 5
GOTO ADC
LED6: CLRF PORTD
BSF PORTD, 6
GOTO ADC
LED7: CLRF PORTD
BSF PORTD, 7
GOTO ADC
DEBOUNCE1: BTFSC PORTB, 0 ; CHECK IF BUTTON PRESSED
GOTO DEBOUNCE1