Houngninou 2. Abstract

Similar documents
EMBEDDED SYSTEM DESIGN FOR A DIGITAL MULTIMETER USING MOTOROLA HCS12 MICROCONTROLLER

REACTIVE POWER COMPENSATION IN DISTRIBUTION SYSTEM

I. INTRODUCTION II. LITERATURE REVIEW

Arbeitskreis Hardware. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz MHCI Lab, LMU München

RC Filters and Basic Timer Functionality

Small DC Motor Control

Measuring Distance Using Sound

PICee Development System

EXAMINATION PAPER EMBEDDED SYSTEMS 6EJ005 UNIVERSITY OF DERBY. School of Computing and Technology DATE: SUMMER 2003 TIME ALLOWED: 2 HOURS

HD66702 (LCD-II/E20) (Dot Matrix Liquid Crystal Display Controller/Driver) Description. Features

8XC51FA FB FC PCA Cookbook


LM4: The timer unit of the MC9S12DP256B/C

11 Counters and Oscillators

Embedded Systems and Software

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

Multivibrators. Department of Electrical & Electronics Engineering, Amrita School of Engineering

Monitoring of Intravenous Drip Rate

Instrument Cluster Display. Grant Scott III Erin Lawler Mike Carlson

Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim

Chapter 6 PROGRAMMING THE TIMERS

HD44102D. (Dot Matrix Liquid Crystal Graphic Display Column Driver) Features. Description. Ordering Information

Programming and Interfacing

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

Brian Hanna Meteor IP 2007 Microcontroller

SUNSTAR 传感与控制 TEL: FAX: Humidity and temperature measurement system using a

FACTFILE: GCSE Technology and Design

Design and Development of Train Tracking System in South Central Railways

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

Physics 116B TLC555 Timer Circuit

Single Board Computer System Undergraduate Education: Design and Fabrication of a mixed signal automated Guitar tuning system

ECE 511: FINAL PROJECT REPORT GROUP 7 MSP430 TANK

Microcontrollers and Interfacing

GF of 9 THE GADGET FREAK FILES CASE #165. Analog Clock Measures Time in Meters

Breadboard Traffic Light System

uc Crash Course Whats is covered in this lecture Joshua Childs Joshua Hartman A. A. Arroyo 9/7/10

HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM

MD04-24Volt 20Amp H Bridge Motor Drive

Many people in their spare time try to find interesting activities to do to keep them

HIGH LOW Astable multivibrators HIGH LOW 1:1

Microcontroller: Timers, ADC

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

ELEXBO A-Car-Engineering

DATA SHEET. PCD pixels matrix LCD controller/driver INTEGRATED CIRCUITS Apr 12

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones

AVL-10000T AUDIO VIDEO LINK TRANSMITTER TECHNICAL MANUAL

Seminar Report Railway Gate Control 1. INTRODUCTION

ELCT 912: Advanced Embedded Systems

EE445L Fall 2015 Quiz 2 Page 1 of 5

Normally, digital speedometers

PIC ADC to PWM and Mosfet Low-Side Driver

SD8000S. 20 bits ADC SOC with RTC. SD8000S Bare Die. Features. Applications. Description. Ordering Information. Pin Diagram and Descriptions

Pulse Width Modulated Linear LED Bar Graph Display

ATmega16A Microcontroller

HD61103A. (Dot Matrix Liquid Crystal Graphic Display 64-Channel Common Driver) Features. Description. Ordering Information

EE 308 Spring S12 SUBSYSTEMS: PULSE WIDTH MODULATION, A/D CONVERTER, AND SYNCHRONOUS SERIAN INTERFACE

HD44105D. (Dot Matrix Liquid Crystal Graphic Display Common Driver) Description. Features. Ordering Information

arxiv:physics/ v1 [physics.ed-ph] 19 Oct 2004

Microcontroller Based Electric Expansion Valve Controller for Air Conditioning System

UNISONIC TECHNOLOGIES CO., LTD CD4541

EE 308 Lab Spring 2009

Digital Logic Troubleshooting

ECE Senior Design Final Report For. Scalable Regulated Three Phase Power Rectifier. May 10, 2004 Rev. 1.0

I2C Demonstration Board I 2 C-bus Protocol

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function

Introduction. Circuit diagram

EE445L Fall 2015 Quiz 2A Solution Page 1

Controlling DC Brush Motor using MD10B or MD30B. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Lab 5 Timer Module PWM ReadMeFirst

Robot Rangers. Low Level Design Document. Ben Andersen Jennifer Berry Graham Boechler Andrew Setter

MICROPROCESSORS A (17.383) Fall Lecture Outline

The rangefinder can be configured using an I2C machine interface. Settings control the

UNISONIC TECHNOLOGIES CO., LTD UU6032B Advance LINEAR INTEGRATED CIRCUIT

Portable Multi-Channel Recorder Model DAS240-BAT

PHYS 102 Quiz Problems Chapter 27 : Circuits Dr. M. F. Al-Kuhaili

CQM1H-MAB42 Analog I/O Board Connector CN1: Analog inputs 1 to 4. Name Specifications Model number Slot 1 (left slot) High-speed Counter Board

GFT1012 2/4 Channel Precise Slave Generator

AVR1606: XMEGA Internal RC Oscillator Calibration. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Hardware and software resources on the AVR family for the microcontroller project

On-chip RC oscillator based Watchdog Timer(WDT) can be operated freely 12 I/O pins with their own independent direction control 3. Applications The ap

MM Liquid Crystal Display Driver

FRIDAY, 18 MAY 1.00 PM 4.00 PM. Where appropriate, you may use sketches to illustrate your answer.

Adjustable Parametric Equalizer Hardware Description

MICROCONTROLLER TUTORIAL II TIMERS

AN EFFICIENT ALGORITHM FOR THE REMOVAL OF IMPULSE NOISE IN IMAGES USING BLACKFIN PROCESSOR

DS Wire Digital Potentiometer

Chapter 13: Comparators

Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its

Intelligent and passive RFID tag for Identification and Sensing

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

CMX860 Telephone Signalling Transceiver

EE 314 Spring 2003 Microprocessor Systems

AVR42778: Core Independent Brushless DC Fan Control Using Configurable Custom Logic on ATtiny817. Features. Introduction. AVR 8-bit Microcontroller

Final Report Data Acquisition Box

MicroToys Guide: Motors N. Pinckney April 2005

This portable DC ground fault locator provides a quick and cost-effective solution for ground fault locating in DC distribution systems.

University of Utah Electrical & Computer Engineering Department ECE 1250 Lab 4 Pulse Width Modulation Circuit

Induction Motor Protection using Micro Controller

Lab 5: Inverted Pendulum PID Control

Transcription:

Houngninou 2 Abstract The project consists of designing and building a system that monitors the phase of two pulses A and B. Three colored LEDs are used to identify the phase comparison. When the rising edge of pulse A occurs 10 us or more before the rising edge of pulse B, a red LED is on. If the rising edge of pulse B occurs 10 us or more before the rising edge of A, a yellow LED is on. If the rising edge of A and B are within 10 us of each other, a green LED is on. This project uses the 8-bit flash microcontroller ATMEL AT89C51RD2. Components: (1) 8-bit flash microcontroller ATMEL AT89C51RD2 (1) HD44780U HITACHI Dot Matrix Liquid Crystal Display (3) LEDs (1) TC4584BP Hex Schmitt Trigger (1) On/Off switch (3) 300Ω Resistor (1) 0.001 µf Capacitor (1) Potentiometer

Houngninou 3 Frequency Generator ( TTL Output ) P o r t 1.6 Pulse A Atmel AT89c51RD2 Board R LCD DISPLAY LEDS Schmitt - Trigger Circuit Pulse B P o r t 1.5 R R +5V Figure 1: Connection Diagram (Overview)

Houngninou 4 Figure 1: Detailed Circuit Diagram The idea in designing this device is to use the 8-bit flash microcontroller ATMEL AT89C51RD2 to compare the rising edge time of pulse A and pulse B. The PCA (Programmable Counter Array) included in this processor consists of a dedicated timer/counter which serves as the time base for an array of five compare/capture modules. In this project, I used the module 3 and 2 respectively for the pulses A and B. Both modules are set put in rising edge capture mode and interrupt enabled. I chose the rising edge capture mode because my design needs to capture the rising edge of each pulse in order to calculate the phase difference.

Houngninou 5 Description of the algorithms Source Code Documentation: The software makes use of 2 modules: module 3 and module 2. The project uses an interrupt routine that measures the rising edge time of pulses A and B and calculates the phase difference between the pulses coming at ports P1.6 and P1.5. Two flags are used to determine the first rising edge between pulse A and pulse B. The external variables rising_flag and difference are global variables known to the main code. In the main code, the pins P1.3, P1.4 or P1.5 are set according to the value of the difference and the phase difference is sent to an LCD display. - Interrupt routine design: 1 If the PCA overflow flag CF (in the CCON SFR) is set 1 when the PCA timer overflows. 1.1 Reset the flag CF 1.2- Increment the PCA overflow variable 2- Otherwise must be a capture 2.1- If rising edge of pulse A 2.1.1- Get the rising edge time with CCAP3 2.1.2- Reset CCF3 for the next interrupt 2.1.3- Check if pulse A rising edge occurs first and set a flag 2.2- If rising edge of pulse B 2.2.1- Get the rising edge time with CCAP2 2.1.2- Reset CCF2 for the next interrupt 2.1.3- Check if pulse B rising edge occurs first and set a flag 2.3- If pulse A rising edge occurs first 2.3.1- Set the rising flag A to 1 2.3.2- Calculate the difference between the rising edge times. 2.4- Otherwise if pulse B rising edge occurs first 2.4.1- Set the rising flag B to 1 2.4.2- Calculate the difference between the rising edge times.

Houngninou 6 - Initialize routine design 1- Initialize the display 2- Initialize the PCA 2.1- Put PCA in osc divide by 6 mode and enable PCA interrupt for overflow counting 2.2- Put module 3 in rising and falling edge capture mode and enable interrupt 2.3- Put module 2 in rising and falling edge capture mode and enable interrupt 2.4- Enable PCA clock source (PCA starts counting) 2.5- Interrupt Enable Control 0 - Main program design 1- Call the Initialize() routine 2 While loop 2.1- If the phase difference is greater than 10 and the rising flag A is 1 2.1.1- Activate pin P1.4 2.1.2- Display message 2.2- If the phase difference is greater than 10 and the rising flag B is 1 2.2.1- Activate pin P1.5 2.2.2- Display message 2.3- If the phase difference is less than 10 2.3.1- Activate pin P1.3 2.3.2- Display message - Display routine design 1- LCD Delay module 2- LCD Driver module 3- Display text module 4- Display number module

Houngninou 7 The system has: - 2 pulse signal inputs: Pulse A input at port P1.6 Pulse B input at port P1.5-3 output pins: P1.3 connected to the Green LED P1.4 connected to the Red LED P1.5 connected to the Yellow LED How does the device work internally? The device uses a single pulse coming from the TTL output of a pulse generator. Pulse A is the initial pulse. This initial pulse is inputted to a TC4584BP Hex Schmitt Trigger that generates pulse B. The pulses A and B are inputted to Ports P1.6 and P1.5 respectively and the processor calculates the phase difference between the two pulses. According to the phase difference obtained, the pin P1.3, P1.4 or P1.5 is activated and turns ON one of the colored LEDs Setup of the TC4584B Hex Schmitt Trigger In order to meet the requirements of the project, two pulses A and B need to be generated. The generation of pulse B is achieved by connecting a single resistor-capacitor network to a Schmitt trigger. The capacitor connects between the input and ground and the resistor connects between the input and the pulse generator. The output is a continuous pulse whose characteristics depends on the values of R and C, and the threshold points of the Schmitt trigger. From the characteristics of the TC4584B Hex Schmitt Trigger: 1. 1 I decided to use a potentiometer to get different delays between the pulses A and B. By adjusting the knob of the potentiometer with a screwdriver, I can change the RC value which automatically changes the delay between pulse B and pulse A. These are some delays obtained by adjusting the potentiometer resistance value: For C = 0.001µF, When R = 10kΩ, delay t = 10µs, the Green LED is ON When R = 20kΩ, delay t = 20µs, either the Red or Yellow LED ON Physical value of the capacitor: C = 0.001 µf Physical characteristic of the Potentiometer: 0 100 kω

Houngninou 8 Extra features The device is portable, using a pack of 4 x 1.5V AA batteries. An On/Off switch is added to easily power the device on and off. An HD44780U HITACHI LCD is added to display the leading pulse and the state of the LED. Reference used: Microelectronic Circuit Analysis and Design, (third edition) Author: Donald Neamen. Publisher: McGraw-Hill Science ISBN-13: 978-0073285962 Chapter 15, page 1078 to 1082. TOSHIBA TC4584BP Hex Schmitt Trigger datasheet from: http://eecs.evansville.edu 8-bit flash microcontroller ATMEL AT89C51RD2 datasheet

Houngninou 9 Final Board Picture Conclusion The main problem encountered with this project was to calculate the delay between the rising edge time of pulses A and B in the interrupt routine code. In hardware, I first used a fixed value resistor of 10kΩ, with resulted in a fixed delay between pulse A and B. Therefore, I decided to use a potentiometer that allowed the Schmitt trigger to vary the delay efficiently, just by adjusting the potentiometer knob with a screwdriver. An LCD has been added to the board to display additional information on the phase comparison and the state of the LEDs (See final picture). Finally, the device had been tested multiple times and works successfully.