Monday, 27 August 2012

PIC timer0


PIC16F877 Timer Modules tutorials - Timer0
Many times, we plan and build systems that perform various processes that depend on time.
Simple example of this process is the digital wristwatch. The role of this electronic system is to display time in a very precise manner and change the display every second (for seconds), every minute (for minutes) and so on.
To perform the steps we've listed, the system must use a timer, which needs to be very accurate in order to take necessary actions.The clock is actually a core of any electronic system.
In this PIC timer module tutorial we will study the existing PIC timer modules. The microcontroller PIC16F877 has 3 different timers:
We can use these timers for various important purposes. So far we used “delay procedure” to implement some delay in the program, that was counting up to a specific value, before the program could be continued. "Delay procedure" had two disadvantages:
  • we could not say exactly how long the Delay procedure was in progress
  • we could not perform any further steps while the program executes the "delay procedure"
Now, using Timers we can build a very precise time delays which will be based on the system clock and allow us to achieve our desired time delay well-known in advance.
In order for us to know how to work with these timers, we need to learn some things about each one of them. We will study each one separately.
PIC Timer0 tutorial
The Timer0 module timer/counter has the following features:
  • 8-bit timer/counter
  • Readable and writable
  • 8-bit software programmable prescaler
  • Internal (4 Mhz) or external clock select
  • Interrupt on overflow from FFh to 00h
  • Edge select (rising or falling) for external clock
Let’s explain the features of PIC Timer0 we have listed above:
Timer0 has a register called TMR0 Register, which is 8 bits of size.
We can write the desired value into the register which will be increment as the program progresses. Frequency varies depending on the Prescaler. Maximum value that can be assigned to this register is 255.
TMR0IF - TMR0 Overflow Interrupt Flag bit.
The TMR0 interrupt is generated when the TMR0 register overflows from FFh to 00h. This overflow sets bit TMR0IF (INTCON<2>). You can initialize the value of this register to what ever you want (not necessarily "0").
We can read the value of the register TMR0 and write into. We can reset its value at any given moment (write) or we can check if there is a certain numeric value that we need (read).
Prescaler - Frequency divider.
We can use Prescaler for further division of the system clock. The options are:
  • 1:2
  • 1:4
  • 1:8
  • 1:16
  • 1:32
  • 1:64
  • 1:128
  • 1:256
The structure of the OPTION_REG register
We perform all the necessary settings with OPTION_REG Register. The size of the register is 8 bits. Click the link to explore the relevant bits of OPTION_REG Register
Initializing the OPTION_REG register
The following is an example how we can initialize the OPTION_REG:
  1. PSA=0; // Prescaler is assigned to the Timer0 module
  2. PS0=1; // Prescaler rate bits
  3. PS1=1; // are set to “111”
  4. PS2=1; // which means divide by 256
  5. TOSE=0; // rising edge
  6. TOCS=0; // Internal instruction cycle clock
Block diagram of the PIC Timer0 / WDT prescaler

PIC TIMER0 block diagram
Calculating Count, Fout, and TMR0 values
If using INTERNAL crystal as clock, the division is performed as follow:


PIC TIMER0 formula for internal clock
Fout– The output frequency after the division.
Tout – The Cycle Time after the division.
4 - The division of the original clock (4 MHz) by 4, when using internal crystal as clock (and not external oscillator).
Count - A numeric value to be placed to obtain the desired output frequency - Fout.
(256 - TMR0) - The number of times in the timer will count based on the register TMR0.
An example of INTERNAL crystal as clock
Suppose we want to create a delay of 0.5 second in the our program using Timer0. What is the value of Count?
Calculation:

First, let’s assume that the frequency division by the Prescaler will be 1:256. Second, let’s set TMR0=0. Thus:


Formula to calculate Cout using Timer0
If using EXTERNAL clock source (oscillator), the division is performed as follow:


PIC TIMER0 formula for external clock
In this case there is no division by 4 of the original clock. We use the external frequency as it is.
An example of EXTERNAL clock source (oscillator):
What is the output frequency - Fout, when the external oscillator is 100kHz and Count=8?
Calculation:

First, let’s assume that the frequency division by the Prescaler will be 1:256. Second, let’s set TMR0=0. Thus:


Formula to calculate Fout for Timer0
Delay of 1 sec using Timer0
The following simple program creates a delay of 1 sec using Timer0:


1 sec delay using Timer0

Monday, 9 January 2012

Embedded System Projects


ADVANCED ROBOTICS SOLUTIONS 

• Artificial Intelligence, Fuzzy Logic, Neural Networks

• Wireless AI Based Mobile Robot For Multi Specialty Operations
• Wireless AI Based Fire Fighting Robot For Relief Operations
• Wireless AI Based Intelli-robot For Materials Handling
• Integrated Rule Based Control Of Robot Using Fuzzy System & Neural Networks
• AI Based Fire Fighting Robot For Relief Operations
• AI Based Intelli-robot For Materials Handling
• AI Based Mobile Robot For Multi Specialty Operations
• Industrial Security Robot With Motion Detection System
• Microcontroller Controlled Robot Arm For Paint Spraying
• Production Monitoring Robot
• Two Axis Robot With Artificial Intelligence
• Three Axis Robot With Artificial Intelligence
• Four Axis Robot With Artificial Intelligence
• Five Axis Robot With Artificial Intelligence
• Wireless Industrial Security Robot
• Alive Human Detector Robot With Counter Using Wireless Pc Interfacing
• Microcontroller Based Surveillance Robot For A Military Application
• PC Controlled Wireless Robot Using RF Module With Feedback Sensor To Detect Fire, Temperature And Human

GPS BASED PROJECTS 


• Global Positioning System

• GPS Based Active Fleet Management - Automated Vehicle Tracking
• GPS Based Highway Monitoring & Control
• GPS Based Intelligent Guided Vehicle with Collision Mitigation
• GPS Enabled PC Based Geographic Information System (GIS) and Routing/Scheduling System
• GPS Based Vehicle Parameter Monitoring With Intelligent Data Analysis
• Global Positioning System with AI

BIOMETRICS 


• Biometric finger print identification based security system.

• Biometric finger print identification based access control system.
• Biometric finger print identification based time recorder with Wigand output system.
• Biometric finger print identification based bank locker security system.
• Monitoring of time and attendance with fingerprint bio-metric solution.
• Fingerprint identification based security system for bank locker.
• High level authentication for power plant using voice recognition
• IVRS based home automation with immediate voice feedback
• Electronic voting system with automatic image comparing system
• Home automation for disable persons using his personal voice tag

SECURITY & ACCESS CONTROL SYSTEM 


• Intelligent Industrial Security Surveillance System With Auto Dialer

• Smart Networked Home – Connected Devices With Auto Design Methodology For Modeling A Microcontroller With The Tele-load Switch Application
• Code Modulation Based Encryption & Decryption For Secured Wireless Communication
• Automatic Railway Gate Signaling Simulator & Controller
• Smart / Proximity Based College Campus Card & Access Control System
• Smart Card / Proximity Based Membership Management System
• Smart / Proximity Based Punctuality Monitoring System For Public Transport System
• Smart / Proximity Based Employee ID Cards & Access Control
• Smart Card / Proximity Based Human Resources Management System
• Smart Networked Home – Connected Devices With Auto Dialer
• Wireless Bluetooth Enabled Network Synchronizer
• Wireless Code Modulation For Secure Communication Using Encryption & Decryption
• Wireless Heart Beat Rate Monitoring & A Cardiac Pacemaker Simulation – Mobile Messenger
• Smart Card / Proximity Based Vehicle Identification & Access Control System

ARTIFICIAL INTELLIGENCE, FUZZY LOGIC BASED EMBEDDED PROJECTS 


• Speed Control Of DC / Induction Motor Using PID / Fuzzy Controller

• Fuzzy Logic Control Of Stepper Motor
• Fuzzy Logic Controller Design DC Motor Speed Control System
• Elevator Control System Using Fuzzy Logic
• Integrated Rule Based Control Of Robot Using Fuzzy System & Neural Networks
• Intelligent Fuzzy Control Guided Vehicle For Collision Intelligent Application Of Fuzzy Logic In Automated Train Speed Control System
• AI Based Fire Fighting Robot For Relief Operations
• AI Based Intelli-robot For Materials Handling
• AI Based Mobile Robot For Multi Specialty Operations
• Instrumentation With Artificial Intelligence
• Frequency Jammer For Remote Controlled Bomb Blasting System
• Fuzzy Logic Based Collision Prevention For Vehicle
• Microcontroller Based Speed Control Of A Vehicle

POWER ELECTRONICS 


• Intelligent Power Factor Correction With Multiple Capacitors Banks

• Intellectual Power Analyzer & Phase Changer
• Hand Held Intelligent Multi Parameter Monitoring System – Das With LCD Display
• Smart Multi Functional Power Meter With LCD Display
• Digital Energy Meter & Voice Annunciation With Proximity Card – Contact Less
• Intelligent Power Sharing Of Transformers With Auto Protection
• Prepaid Digital Energy Meter Billing & Cost Indicator With Voice Annunciation
• Multiple Starter With Overload & High, Low Voltage Protection
• Prepaid Electricity Billing Automation & Cost Indicator
• Industrial Power Management System
• Smart Power Monitoring For Efficient Energy Management
• Distribution & Sub Station Automation With SCADA
• Automatic Phase Changer Cum Change Over & Load Breaker
• Microcontroller Based SCADA For Substation By WAP
• Microcontroller Controlled Power Supply For Testing Application
• Power Line Monitoring System

ELECTRICAL PROJECTS


• Noise Less Speed Control Of DC Motor Using PWM Converter

• Remote Control Of AC / DC Motor With Parameter Monitoring
• Remote On / Off Of An AC / DC Motor
• Remote On/Off Controller For AC Motors With Parameter Monitoring
• Remote Speed Control Of AC / DC Motor
• Remote Switching System For Home Appliances
• Dual Control Of Electrical Devices Through Computer Keyboard And Hardware
• Substation Monitoring System - Electrical Transmission And Distribution Process
• Electrical Network Automation & Communication Systems
• Remote Data Monitoring & Data Analysis For Power Station
• Post Paid Electricity Billing Automation
• Power Sharing Of Transformer With Overload Protection
• EB Theft Monitoring And Control System 
• Artificial Intelligent Solar Tracking System With True Graph & PC Interface

MECHANICAL, MODEL BASED & MECHATRONICS – EMBEDDED PROJECTS 


• Smart Solar Tracking System For Optimal Power Generation

• GPS Based Intelligent Guided Vehicle With Collision Mitigation
• Automatic Electrolyte Battery Filling Using Conveyer System

SCADA & PLC BASED EMBEDDED PROJECTS 


INSTRUMENTATION


• Electrical Station Variables Reader/Controller With True Graph And SCADA

• Microcontroller Based SCADA For Substation By WAP
• Multi Channel Voltage Scanner – SCADA
• Multi Parameter Measurement System – SCADA
• Plc Based Bottle Filling Station With Conveyors
• Automatic Anesthesia Controller Using Infusion Pump With Heart Beat Rate
• Automatic Anesthesia Controller Using Infusion Pump With Respiratory

BIO MEDICAL SYSTEM AND APPLICATIONS


• Smart Medicare System – ICU Care Taker & Life Support System

• Wireless Heart Beat Rate Monitoring & A Cardiac Pacemaker Simulation – Mobile Messenger
• Automatic Anesthesia Controller Using Infusion Pump With Heart Beat Rate
• Automatic Anesthesia Controller With Respiratory Using Infusion Pump
• Smart Card Based Bio Medical Health Card System
• Bedside Patient Monitoring System With Remote Alert
• Unique System For Remote Monitoring Patients With Data Mining
• Heart Beat Monitoring System With Wireless Pc Interfacing Including Body & Respiratory Temperature
• RF Based Heart Beat Monitoring System With Pacemaker
• Detection Of Cardiac Disorder Using Bio-Medical Sensor
• Automatic Anesthesia Feeder Based On Medical Analysis