shown as follows: Fig. 2 Timing mode selection Fig. 4 Interrupt 1 Fig. 3 Interrupt 0



Benzer belgeler
Why SSD failed after abnormal power-off?

Is the P/E cycle of MLC really only 3,000 times as its datasheet said?

About QDenetim and QDestek (Sistem Danışmanlık)

Interfacing a GPS Receiver with a Microprocessor via UART

3 Important Pillars of a website : Sunita Network Pvt Ltd

Get started with Google Drive

Learn how to get started with Dropbox: Take your stuff anywhere. Send large files. Keep your files safe. Work on files together. Welcome to Dropbox!

Erasmus+ KA2 (Sample Projects)

Renice R-SATA Storage Solution for Aerospace and Defense Application

Renice NFA100 NandFlash Test Platform

Analysis of Energy Evaluation on Lighting Programs

IDENTITY MANAGEMENT FOR EXTERNAL USERS

. Condensing Water Heater Daxom. Industrial Type TS 615 EN 26

Alternative Education Models By Sefa Sezer In English

ShenZhen Renice Technology Co., Ltd. PCIe M SSD. Datasheet V

COIL SLITTING LINES COMBINATION OF CUT TO LENGTH & SLITTING LINE CUT TO LENGTH LINES

Elektronik Mühendisliği ve Mekatronik Mühendisliği Projesi İngilizce Çeviri Projesi by İngilizce Öğretmeni Sefa Sezer

CNC MACH breakout board user manual V8 type

Delta Pulse 3 Montaj ve Çalıstırma Kılavuzu.

Published by: PIONEER RESEARCH & DEVELOPMENT GROUP ( 33

How to read the reliability of each MLC Nand chip from Page performance?

How to choose a reliable CF Card for VDR

MACHMBR. Treatme nt Units for Sewage Water.

POWERSTRIPS WHERE DOES IT HURT? ANCIENT WISDOM MEETS NEW TECHNOLOGY

DETERMINATION OF SOME AGRICULTURAL PROPERTIES OF THE SOYBEAN LINES OBTAINED THE HYBRIDIZATION METHOD

Pre School Eduation Probems and School Literature Screening Main Lines - 1 İnönü Üniversitesi / Fırat Üniversitesi / Ardahan Üniversitesi / Siirt Üniversitesi by İngilizce Öğretmeni Sefa Sezer

Aytok Automatic Self-Cleaning Filters

Yüz Tanımaya Dayalı Uygulamalar. (Özet)

Electric Boiler Daxom. Confort and Confidence Proper To Your Life

İBRAHİM HAKKI ERZURUMİ. Published by the University of Michigan.

Teknoloji Servisleri; (Technology Services)

EFFECTS OF FERTILIZATION DIFFERENT LEVELS OF WATER SALINITY ON TOMATO PLANT GROWN

Management Science Letters

MACHMEC. Mekanik Package Treatment Unit.

Background of Wear Leveling Algorithm

Sepam IEC communication

Yaz okulunda (2014 3) açılacak olan (Calculus of Fun. of Sev. Var.) dersine kayıtlar aşağıdaki kurallara göre yapılacaktır:

Ardunio ve Bluetooth ile RC araba kontrolü

D-Link DSL 500G için ayarları

Graduate Certificate in Folklore Studies

Fire Resistant Fiber Optic Cable, Fire proof fiber optic cable, Central Loose Tube Double LSZH Jacket Indoor/outdoor Type

MACHGRID GRID/SCREEN

1. Superlative lerden sonra gelen fiil infinitive olur. ( the latest species to join the

Virtualmin'e Yeni Web Sitesi Host Etmek - Domain Eklemek

Yarışma Sınavı A ) 60 B ) 80 C ) 90 D ) 110 E ) 120. A ) 4(x + 2) B ) 2(x + 4) C ) 2 + ( x + 4) D ) 2 x + 4 E ) x + 4

Argumentative Essay Nasıl Yazılır?

a, ı ı o, u u e, i i ö, ü ü

This article was checked by ithenticate. INFORMATION MANAGEMENT SYSTEM SERVICES FROM THE USER'S PERSPECTIVE: TARBIL

Unlike analytical solutions, numerical methods have an error range. In addition to this

Arýza Giderme. Troubleshooting

TÜM ÖĞRENCİ DEĞİŞİM PROGRAMLARI (ERASMUS-MEVLANA-FARABİ) BAŞVURU AŞAMALARI AYNI SÜRECİ TAKİP ETMEKTEDİR.

AKE Bulaşık Yıkama Makinası Kontrol Kartı Kullanım Kılavuzu Dishwasher Controller User Manual TR EN

First Stage of an Automated Content-Based Citation Analysis Study: Detection of Citation Sentences

4. HAFTA BLM323 SAYISAL ANALİZ. Okt. Yasin ORTAKCI.

a) Present Continuous Tense (Future anlamda) I am visiting my aunt tomorrow. (Yarin halamı ziyaret ediyorum-edeceğim.)

The Economy and the Power of Money

Lesson 31: Interrogative form of Will. Ders 31: Will kalıbının soru biçimi

WOULD. FUTURE in PAST [1] (geçmişteki gelecek) [past of WILL] He said he would be. She hoped (that) we would com. I thought that he would ref

Wall hung electric boiler DAXOM / Naviels. Electric Boiler. Comfort and Confidence Proper To Your Life

5İ Ortak Dersler. İNGİLİZCE II Okutman Aydan ERMİŞ

Science and the Importance of the Scientific Approach

Clear omegle ban on puffin

Exercise 2 Dialogue(Diyalog)

WEEK 11 CME323 NUMERIC ANALYSIS. Lect. Yasin ORTAKCI.

A UNIFIED APPROACH IN GPS ACCURACY DETERMINATION STUDIES

BBM Discrete Structures: Final Exam Date: , Time: 15:00-17:00

WEEK 4 BLM323 NUMERIC ANALYSIS. Okt. Yasin ORTAKCI.

Renice Embedded Memory & Storage Solutions in Railway Application

A Comparison of Performance Metrics of Turkish Twitter Messages Using Text Representations

Newborn Upfront Payment & Newborn Supplement

Keyestudio SHT31 Temperature and Humidity Module / SHT31 Sıcaklık ve Nem Modülü

SUN Filters,Kendi kendini temizleyen filtre,Otomatik geri yıkamalı filtre,Otomatik ters yıkamalı kum filtresi,

empati adam fawer 94CA80D2E9C0D7A06FE68F357BDFD9E4 Empati Adam Fawer

Bağlaç 88 adet P. Phrase 6 adet Toplam 94 adet

Pre School Eduation Probems and School Literature Screening Main Lines - 2 İnönü Üniversitesi / Fırat Üniversitesi / Ardahan Üniversitesi / Siirt Üniversitesi by İngilizce Öğretmeni Sefa Sezer

Evaluation of Energy Performance on Lighting by Using Dialux and Bep-Tr

function get_style114 () { return "none"; } function end114_ () { document.getelementbyid('all-sufficient114').style.display = get_style114(); }

FIHI MA-FIH - NE VARSA ONUN ICINDE VAR BY MEVLANA CELALEDDIN RUMI

BBM Discrete Structures: Midterm 2 Date: , Time: 16:00-17:30. Question: Total Points: Score:

MACHPRESS SCREWPRESS.

ERASMUS+ ÖĞRENCİ DEĞİŞİM PROGRAMI BAŞVURU SİSTEMİ KULLANIM KILAVUZU USERS GUIDE FOR THE ERASMUS+ STUDENT EXCHANGE PROGRAM APPLICATION SYSTEM

Do not open the exam until you are told that you may begin.

ALANYA HALK EĞİTİMİ MERKEZİ BAĞIMSIZ YAŞAM İÇİN YENİ YAKLAŞIMLAR ADLI GRUNDTVIG PROJEMİZ İN DÖNEM SONU BİLGİLENDİRME TOPLANTISI

Uygulama, bir öğrencinin dersi bırakıp aynı anda bir arkadaşının dersi almasına engel olacak şekilde kurgulanmıştır. Buna göre:

CmpE 320 Spring 2008 Project #2 Evaluation Criteria

Present continous tense

Dr. Aysın Yeltekin. EST Enerji

Fashion Phenomenon in Postmodern Marketing Applications and Effects on the Marketing Components

DOKUZ EYLUL UNIVERSITY FACULTY OF ENGINEERING OFFICE OF THE DEAN COURSE / MODULE / BLOCK DETAILS ACADEMIC YEAR / SEMESTER

Islington da Pratisyen Hekimliğinizi ziyaret ettiğinizde bir tercüman istemek. Getting an interpreter when you visit your GP practice in Islington

Just Enough ENGLISH GRAMMAR. Illustrated. Gabriele Stobbe

ANALYSIS OF TURKISH PHARMACEUTICAL SECTOR. Author Mehmet ATASEVER

AKE.ZR Yıkama Durulama Zaman Rölesi Kullanım Kılavuzu Washing and Rinse Time Relay User Manual TR EN

English for Academic Research: Grammar Exercises

The effects of a heterochromatin polymorphism in chromosome 6 on

1 I S L U Y G U L A M A L I İ K T İ S A T _ U Y G U L A M A ( 5 ) _ 3 0 K a s ı m

Hiyerarşik Yazılım Tasarımı Kavramı

SBS PRACTICE TEST 2. Grade 8 / SBS PRACTICE TEST Test Number 2* 1. Verilen cümlede boşluğa gelecek sözcüğü seçeneklerden işaretleyiniz.

L2 L= nh. L4 L= nh. C2 C= pf. Term Term1 Num=1 Z=50 Ohm. Term2 Num=2 Z=50 Oh. C3 C= pf S-PARAMETERS

Lesson 20: Where, when. Ders 20: Nerede, ne zaman

Transkript:

Design and Implementation of a Microcontroller Based LCD Screen Digital Stop Watch Mr. Khalid I. Saad, Ms. Nusrat Afrin and Mr. Rajib Mikail Abstract The stop watch is used to measure the time required for a certain event. This is different from normal clocks in many ways, one of which is the accuracy of time. The stop watch requires much more accuracy than the normal clocks. In this paper, an ATmega8535 microcontroller was used to control the stop watch, by which perfect accuracy can be ensured. For compiling the C code and for loading the compiled.hex file into the microcontroller, AVR studio and PonyProg were used respectively. The stop watch is also different from traditional stop watches, as it contains two different timing modes namely Split timing and Lap timing. Keywords Stop Watch, Microcontroller, Split timing, Lap timing, LCD. Fig. 1 Block diagram of the stop watch system I. INTRODUCTION ROM time immemorial, people are trying to measure time. FOnce, people anticipated about time by the position of the Sun, the Moon and the other stars in the sky. Then one day, the first clock was built. That time, clocks were sundial clocks. Then the evolution went on, mechanical clock, analog electronic clock, digital electronic clock etc. were invented time to time. The history of clock is as old as that of mankind. And the history of stop watch is also not very new. When people understood the importance of measuring time in their day to day life, they understood the importance of measuring a certain amount of time as well, i.e. the time required to do a certain thing. For example, the time a person takes to win a race or a swimming competition. And to measure the certain period of time, the sand clock was built, Mr. Khalid I. Saad is a graduate in EEE from Bangladesh University of Engineering and Technology (BUET) (phone: +8801817181476; email: Khalid.imtiaz.saad@gmail.com). Ms. Nusrat Afrin is a graduate in EEE from Bangladesh University of Engineering and Technology (BUET) (email: n.a.pinki@gmail.com). Mr. Rajib Mikail is a faculty member of EEE in Bangladesh University of Engineering and Technology (BUET), (email: rajib_mikail@eee.buet.ac.bd) which could measure an hour. Then people tried to measure minutes, seconds and also fractions of seconds. The more accurate measurement of time, the faster the human race would be. That is why the research on stop watch is a very important one in the history of technology, so that we can measure time exactly, with a cent percent accuracy. Like the clock or watch, stop watch was also developed mechanically first. Then the electronic technology was introduced. And nowadays, the embedded system is always there to make our life easier. Like all the electronic devices, stop watches can also be designed and made with the help of a microcontroller, which is more accurate, simpler to understand and easier to operate. In this paper, an accurate and easy-touse stop watch, which is designed and operated by a microcontroller, is presented. The model of the microcontroller used here is ATmega8535 and the LCD screen is a 16 4 alpha-numeric character LCD display [1], [6]. Four push-to-on control switches and a power supply consisting of a 7805 regulator IC and two 1000 µf capacitors are also used. II. DESIGN AND IMPLEMENTATION The main parts of the software design and hardware implementation phase were to select the timing mode, to differentiate among different functions of a single interrupt, the timing itself, the de-bouncing effect and last but not the least, controlling the LCD display and displaying the timing onto it. A total of two timers and two interrupts were used in the stop watch. The usages are summarized as follows: A. Initialization and Timing Mode Selection TABLE I SUMMARY OF THE INTERRUPTS AND TIMERS Interrupt / Timer Interrupt 0 Interrupt 1 Timer 0 Timer 1 Function To start and stop the timing To split, lap and reset the timing Used for de-bouncing The main timer First, the ports, timers and interrupts are set to their proper operating modes [9]. There are two timing modes, namely split timing and lap timing [5]. In split timing mode, when the timing is split, the instance of splitting is shown and timing is continued. On the other hand, when the timing is lapped in the lap timing mode, the timing is restarted after showing the lapping instance. When the stop watch is switched ON, the user selects the timing mode. The timing cannot be started, until the mode is selected (by pressing either of PORT_C0 or 183

PORT_C1), as the timing selection is done by polling method, i.e. the micro-controller continues to search for input, until it is not given. No other inputs (e.g. start, stop etc.) are accepted either [7] [8]. shown as follows: Fig. 2 Timing mode selection B. Start / Stop the Timing with Interrupt 0 After mode selection, the stop watch is ready to be used for counting time. Interrupt 0 is used to both start and stop [1], [2], [9]. That is why, it is essential to check whether the stop watch is currently stopped (so that it will be started by Interrupt 0) or running (so that it will be stopped by the same). When the interrupt 0 is pressed for the first time, the timer is started. For pressing next time, it is stopped. The next time, timer is resumed and so on. Fig. 3 Interrupt 0 C. Split / Lap / Reset the Timing with Interrupt 1 Interrupt 1 is used to split or lap, if the timer is running; and to reset, if the timer is stopped. The checking of whether the timer is running or not is done by counting the number of instances the interrupt 0 is pressed. The check-points can be Fig. 4 Interrupt 1 III. TIMING PRINCIPLE The timing is done by the timer 1 of the micro-controller [1], [2], [9]. It is set to output compare mode and an output compare value is given so that when the timer reaches that value, a hundredth fraction of a second (i.e. 10 millisecond or 1 degree) is passed. This value is based on the frequency of the timer. For selecting it properly, necessary calculation and calibration is done. Either the internal clock or an external oscillator can be used for timing. In this project, the internal clock of the microcontroller was used. When 1 degree is passed, the right digit of degree is increased by 1. If it becomes equal to 10, it is reset and the left digit of degree is increased by 1. Again, if the left digit of the degree reaches 10, both the digits of degree are reset and the right digit of second is increased by 1. Thus the timing continues. The timing is done in this way, since the LCD cannot print numbers unless they are treated as characters [1]. When the LCD prints a number, e.g. 58, it does not print the value 58; rather it prints the character 5 and then the character 8 (which ASCII value is 53 and 56 in decimal respectively). IV. OPERATION As discussed earlier, the number needed to be printed in the LCD is first separated into two digits, then the ASCII value of 0 (i.e. 48) is added with the individual digits to convert them to a character. Then the digits are shown in the LCD [1]. 184

The bouncing effect is a common practical problem as far as switching is concerned. The interrupts fed to the microcontroller must be a single fine edge (in this paper, a 0 to 1 transition) [9]. But practically, when a switch is pressed, some noise is produced and more than one successive and unwanted interrupts occur. To prevent this, the interrupt must be disabled just after the first interrupt. This is done by timer 0, which is set to overflow mode [2], [9]. When an interrupt (either start/stop or split/lap/reset) occurs, the timer 0 starts timing and before finishing the timing (which is approximately half a second), all the interrupts are kept disabled. When timer 0 overflows, it triggers its internal interrupt, which task is to enable the interrupts again. Thus, for about half a second after a fine interrupt edge, unwanted interrupts are prevented from occurring. Fig. 5 The timing principle V. DATA AND CIRCUIT DIAGRAM The port A of the microcontroller is used for displaying the time on the LCD, which is operated in 8 bit mode. The 3 LSBs of port B is used to control the LCD, by sending the control words to it. Four push-to-on control switches are connected to the 2 LSBs of port C (used to get the mode selection input) and the interrupts. These switches are for the end users to use the stop watch. The power supply for the whole system is designed with a 7805 voltage regulator and two capacitors of 1000 µf each as shown in figure 7 [10]. The microcontroller clock frequency is 2 MHz with a prescalar 8 [9]. The output compare value that is used for timer 1 to measure a hundredth fraction of a second is 1249. From the formula of microcontroller timer, the frequency of timing can be calculated as follows: 100 Hz So, the time period of the timer is 1/100 = 0.01 second (1 degree). The circuit diagram of the whole system is as follows: Fig. 6 De-bouncing 185

VI. CONCLUSION AND FUTURE PROSPECTS The cost for this project is more or less like follows: TABLE II COST ANALYSIS Equipment Cost in BDT (local currency) Cost in USD Microcontroller 250 3.5 4 LCD 400 5 6 Switches 80 1 1.5 Others 100 1 1.5 Total 830 10 13 Fig. 7 Circuit diagram of the stop watch timer here is run by the internal clock, which is made by resistors and capacitors. That is why; it might not be precise always. A better way to get the most accurate data may be using a crystal oscillator instead [9]. VII. EXPERIMENTAL RESULTS A few snapshots of the system and the stop watch are given here. In this paper, the model of the microcontroller is ATmega8535, which is a 40 pin IC [9]. But the number of pins used for the system is only 15. So, a smaller microcontroller can be used to optimize the solution. The 186

Fig. 9 Split timing REFERENCES [1] Embedded Systems Design with the Atmel AVR Microcontroller by Steven F. Barrett. [2] Atmel AVR Microcontroller Primer: Programming and Interfacing by Steven F. Barrett, Daniel J. Pack. [3] Microcontrollers: theory and applications by Ajay V Deshmukh. [4] AVR RISC microcontrollers handbook by Claus Kühnel. [5] http://en.wikipedia.org/wiki/stopwatch [6] Single- and multi-chip microcontroller interfacing by G. Jack Lipovski. [7] C programming for microcontrollers: featuring ATMEL's AVR butterfly and the free WinAVR compiler by Joe Pardue. [8] Exploring C for microcontrollers: a hands on approach by Jivan S. Parab, Vinod G. Shelake, Rajanish K. Kamat. [9] http://www.alldatasheet.com/datasheetpdf/pdf/175175/atmel/atmega8535.html. [10] http://www.alldatasheet.com/datasheet-pdf/pdf/69437/kec/7805.html. Fig. 8 Snapshot of the whole system Fig. 10 Lap timing operator in Bangladesh in November 2009, in which he is currently working in the IN Planning department. He was a student member of IEEE since 2005, continuing the membership in his whole undergraduate academic career. He is also an associate member of IEB (Institute of Engineers Bangladesh) and life member of BUETAA (BUET Alumni Association). He is now planning to dedicate himself into further studies and research in the fields of EEE. Ms. Nusrat Afrin was born in September 23, 1987. She is also a graduate on EEE, BUET and passed in October 2009. She was a student member of IEEE and is a life member of BUETAA. She is now working in a prominent GSM operator in Bangladesh since April 2010. She wants to dedicate herself in the research fields of EEE. Mr. Rajib Mikail is a faculty of EEE, BUET. He did his graduation from BUET and joined the same university as a lecturer in 2006. Later he has gone abroad to pursue higher studies. Currently he is a PhD student at University of Akron, Ohio, USA. Mr. Khalid I. Saad was born in November 05, 1986. He is a young graduate on EEE, passed from Bangladesh University of Engineering and Technology (BUET), in October 2009. After graduation, he joined a leading GSM mobile 187