LAMPIRAN. Program Keseluruhan Sistem Pengontrolan Level Air

Size: px
Start display at page:

Download "LAMPIRAN. Program Keseluruhan Sistem Pengontrolan Level Air"

Transcription

1 LAMPIRAN Program Keseluruhan Sistem Pengontrolan Level Air /***************************************************** This program was produced by the CodeWizardAVR V Standard Automatic Program Generator Copyright Pavel Haiduc, HP InfoTech s.r.l. Chip type : ATmega8535 Program type : Application Clock frequency : MHz Memory model : Small External RAM size : 0 Data Stack size : 128 *****************************************************/ #include <mega8535.h> #include <delay.h> #include <stdio.h> #define signal_0 PORTD.2 #define echo_0 PIND.2 #define arah_0 DDRD.2 #define out 1 #define inp 0 #define dis_lo PORTC #define dis_hi PORTA #define relay PORTD.0 unsigned char urf_pink (void) unsigned char cnt; cnt=0; arah_0=out; signal_0=1; delay_us(2); signal_0=0;

2 arah_0=inp; signal_0=1; while(echo_0==0); while(echo_0==1) cnt++; delay_us(30); delay_ms(10); return cnt; void indikator (unsigned char idx) if (idx>16) idx =16; switch (idx) case 0: dis_lo = 0x00; case 1: dis_lo = 0x01; case 2: dis_lo = 0x03; case 3: dis_lo = 0x07;

3 case 4: dis_lo = 0x0f; case 5: dis_lo = 0x1f; case 6: dis_lo = 0x3f; case 7: dis_lo = 0x7f; case 8: case 9: dis_hi = 0x80; case 10:

4 dis_hi = 0xc0; case 11: dis_hi = 0xe0; case 12: dis_hi = 0xf0; case 13: dis_hi = 0xf8; case 14: dis_hi = 0xfc; case 15: dis_hi = 0xfe; case 16: dis_hi = 0xff;

5 ; // Alphanumeric LCD Module functions #asm.equ lcd_port=0x18 ;PORTB #endasm #include <lcd.h> // Timer 0 overflow interrupt service routine interrupt [TIM0_OVF] void timer0_ovf_isr(void) // Place your code here // Declare your global variables here void main(void) // Declare your local variables here unsigned char buf[33]; unsigned char lvl, ndx; // Input/Output Ports initialization // Port A initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTA=0x00; DDRA=0xFF; // Port B initialization // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In // State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T PORTB=0x00; DDRB=0x00;

6 // Port C initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTC=0x00; DDRC=0xFF; // Port D initialization // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=Out // State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=0 PORTD=0x00; DDRD=0x01; // Timer/Counter 0 initialization // Clock source: System Clock // Clock value: khz // Mode: Normal top=ffh // OC0 output: Disconnected TCCR0=0x05; TCNT0=0x00; OCR0=0x00; // Timer/Counter 1 initialization // Clock source: System Clock // Clock value: Timer 1 Stopped // Mode: Normal top=ffffh // OC1A output: Discon. // OC1B output: Discon. // Noise Canceler: Off // Input Capture on Falling Edge // Timer 1 Overflow Interrupt: Off // Input Capture Interrupt: Off // Compare A Match Interrupt: Off // Compare B Match Interrupt: Off TCCR1A=0x00; TCCR1B=0x00;

7 TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x00; OCR1BL=0x00; // Timer/Counter 2 initialization // Clock source: System Clock // Clock value: Timer 2 Stopped // Mode: Normal top=ffh // OC2 output: Disconnected ASSR=0x00; TCCR2=0x00; TCNT2=0x00; OCR2=0x00; // External Interrupt(s) initialization // INT0: Off // INT1: Off // INT2: Off MCUCR=0x00; MCUCSR=0x00; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x01; // Analog Comparator initialization // Analog Comparator: Off // Analog Comparator Input Capture by Timer/Counter 1: Off ACSR=0x80; SFIOR=0x00; // LCD module initialization //lcd_init(16); // Global enable interrupts //#asm("sei")

8 //lcd_gotoxy(0,0); //lcd_putsf ("tangki air ultra"); lvl = 0; relay = 0; while (1) // Place your code here lvl = urf_pink (); if (lvl > 25 ) lvl = 0; lvl = 25 - lvl; delay_ms(100); // lcd_gotoxy(0,1); // sprintf(buf,"ping sts : %u cm ",lvl); // lcd_puts(buf); indikator(lvl); if (lvl < 3) relay = 1; if (lvl > 15) relay = 0; /* for (ndx = 0; ndx < 17; ndx++) indikator(ndx); delay_ms(500); ; */

9 Gambar : Bentuk Jalur Jalur Rangkaian Pengontrolan Level Air Pada Papan PCB.

10 UKURAN TEMPAT PENAMPUNGAN TANGKI AIR

11 GAMBAR FISIK RANGKAIAN PENGATURAN PENGISIAN TANGKI AIR

LAMPIRAN. 1. Program Alat

LAMPIRAN. 1. Program Alat LAMPIRAN 1. Program Alat This program was produced by the CodeWizardAVR V2.03.4 Standard Automatic Program Generator Copyright 1998-2008 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project

More information

RANGKAIAN LENGKAP. Universitas Sumatera Utara

RANGKAIAN LENGKAP. Universitas Sumatera Utara RANGKAIAN LENGKAP Lampiran Program /***************************************************** This program was produced by the CodeWizardAVR V1.25.8 Professional Automatic Program Generator Copyright 1998-2007

More information

LAMPIRAN A FOTO ALAT

LAMPIRAN A FOTO ALAT LAMPIRAN A FOTO ALAT Gambar A.1. Gambar robot mobil dilihat dari atas Gambar A.2. Gambar robot mobil dilihat dari depan Gambar A.3. Gambar robot mobil dilihat dari samping Gambar A.4. Gambar keseluruhan

More information

LAMPIRAN A List Program CodeVision Generato Data...A-1 List Program CodeVision Multiplexer...A-11 List Program CodeVision Demultiplexer...

LAMPIRAN A List Program CodeVision Generato Data...A-1 List Program CodeVision Multiplexer...A-11 List Program CodeVision Demultiplexer... LAMPIRAN A List Program CodeVision Generato Data...A-1 List Program CodeVision Multiplexer...A-11 List Program CodeVision Demultiplexer...A-14 List Program Codevision Generator Data /****************************************

More information

// WRITE data to be written to EEPROM

// WRITE data to be written to EEPROM /***************************************************** This program was produced by the CodeWizardAVR V2.03.9 Evaluation Automatic Program Generator Copyright 1998-2008 Pavel Haiduc, HP InfoTech s.r.l.

More information

Gambar A-1 Foto alat prototype infrared thermometer

Gambar A-1 Foto alat prototype infrared thermometer LAMPIRAN A Foto Alat Gambar A-1 Foto alat prototype infrared thermometer A-1 LAMPIRAN A A-2 LAMPIRAN A Daftar Komponen yang digunakan Komponen Aktif Nama komponen Fungsi Jumlah AVR ATMega 8535 Mikrokontroler

More information

LAMPIRAN A. Foto Alat

LAMPIRAN A. Foto Alat LAMPIRAN A Foto Alat A-1 A-2 Rangkaian Skematik PCB Sistem Monitoring Infus A-3 LAMPIRAN B Program pada Mikrokontroller AVR Atmega16...B-1 Program pada Borlan Delhpi 7.0...B-9 PROGRAM UTAMA /*****************************************************

More information

LAMPIRAN A. Listing Program. Program pada Borland Delphi 7.0 A-1 Program pada CodeVisionAVR C Compiler A-6

LAMPIRAN A. Listing Program. Program pada Borland Delphi 7.0 A-1 Program pada CodeVisionAVR C Compiler A-6 A Listing Program Program pada Borland Delphi 7.0 A-1 Program pada CodeVisionAVR C Compiler A-6 LISTING PROGRAM BORLAND DELPHI 7.0 Inisialisasi ==========================================================

More information

LAMPIRAN A. Universitas Sumatera Utara

LAMPIRAN A. Universitas Sumatera Utara 63 LAMPIRAN A Rangkaian Lengkap Perangkat Keras Rangkaian ini terdiri dari Rangkaian Power Supply (PSA), Mikrokontroller atmega8535, RFID Reader ID 12, Rangkaian Infra Merah Fotodioda, driver max232 dan

More information

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Ali Karimpour Associate Professor Ferdowsi University of Mashhad AUTOMATIC CONTROL SYSTEMS Ali Karimpour Associate Professor Ferdowsi University of Mashhad Reference: Microcontroller Based Applied Digital Control Dogan Ibrahim, John Wiley & Sons Ltd, 2006 Liquid Level

More information

LAMPIRAN A FOTO Radio Control Helikopter dan Pengendalinya

LAMPIRAN A FOTO Radio Control Helikopter dan Pengendalinya LAMPIRAN A FOTO Radio Control Helikopter dan Pengendalinya Tampak Atas A-1 Tampak Depan A-2 Tampak Samping A-3 Tampak Belakang A-4 Pengendali A-5 LAMPIRAN B PROGRAM PADA MICROSOFT VISUAL BASIC 6 DAN PENGONTROL

More information

LAMPIRAN A PROGRAM UTAMA ROBOT NOMOR 2

LAMPIRAN A PROGRAM UTAMA ROBOT NOMOR 2 LAMPIRAN A PROGRAM UTAMA ROBOT NOMOR 2 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: [Bioloid Premium]-Robot 2 v 2 22: 23: 24: 25: A-1 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:

More information

Software Design Considerations, Narrative and Documentation

Software Design Considerations, Narrative and Documentation Software Design Considerations, Narrative and Documentation Introduction The project under consideration is an automated shopping cart designed to follow a shopper around a simulated supermarket environment.

More information

Set of pulse decoding algorithms for quadrature rotary and linear encoders*

Set of pulse decoding algorithms for quadrature rotary and linear encoders* version 1.2 Set of pulse decoding algorithms for quadrature rotary and linear encoders* (*) Algorithms are likely platform nonindependent in performance comparison. However results are based to the Atmel

More information

Lampiran I. Rangkaian Lengkap Alat. Universitas Sumatera Utara

Lampiran I. Rangkaian Lengkap Alat. Universitas Sumatera Utara Lampiran I Rangkaian Lengkap Alat Lampiran II Program Pada Alat /***************************************************** This program was produced by the CodeWizardAVR V2.04.9 Evaluation Automatic Program

More information

// Voltage Reference: AREF pin #define ADC_VREF_TYPE ((0<<REFS1) (0<<REFS0) (0<<ADLAR))

// Voltage Reference: AREF pin #define ADC_VREF_TYPE ((0<<REFS1) (0<<REFS0) (0<<ADLAR)) 44 Lampiran 1 Listing program dari seluruh sistem. /****************************************************** * This program was created by the CodeWizardAVR V3.12 Advanced Automatic Program Generator Copyright

More information

J. Basic. Appl. Sci. Res., 3(2s) , , TextRoad Publication

J. Basic. Appl. Sci. Res., 3(2s) , , TextRoad Publication 2013, TextRoad Publication ISSN 2090-4304 Journal of Basic and Applied Scientific Research www.textroad.com Designing and Construction of the Transceiver System by Using a New Generation of Telecommunication

More information

LAMPIRAN A FOTO ROBOT BERKAKI ENAM

LAMPIRAN A FOTO ROBOT BERKAKI ENAM LAMPIRAN A FOTO ROBOT BERKAKI ENAM A-1 A-2 LAMPIRAN B PROGRAM PADA PENGONTROL ATMEGA16 DAN ATTINY2313 B-1 1. Robot mampu berjalan sesuai dengan langkah dan arah yang dimasukkan melalui keypad. ATMEGA16

More information

LAMPIRAN A GAMBAR SISTEM

LAMPIRAN A GAMBAR SISTEM LAMPIRAN A GAMBAR SISTEM SISTEM OBJEK TAMPAK DALAM SISTEM OBJEK TAMPAK LUAR SISTEM PENERIMA LAMPIRAN B PROGRAM AVR ATMEGA 128 /***************************************************** Chip type : ATmega128L

More information

LAMPIRAN - A. Instruksi Mikrokontroler

LAMPIRAN - A. Instruksi Mikrokontroler LAMPIRAN - A Instruksi Mikrokontroler /***************************************************** This program was produced by the CodeWizardAVR V1.25.3 Professional Automatic Program Generator Copyright 1998-2007

More information

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler AVR033: Getting Started with the CodeVisionAVR C Compiler Features Installing and Configuring CodeVisionAVR to Work with the Atmel STK500 Starter Kit and AVR Studio Debugger Creating a New Project Using

More information

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler AVR033: Getting Started with the CodeVisionAVR C Compiler Features Installing and Configuring CodeVisionAVR to Work with the Atmel STK500 Starter Kit and AVR Studio Debugger Creating a New Project Using

More information

Universitas Sumatera Utara

Universitas Sumatera Utara 55 Lampiran 1. Konfigurasi Program Menghitung Data Komputer (Bahasa C) pada Mikro /******************************************************* This program was created by the CodeWizardAVR V2.60 Standard Automatic

More information

Project : Version : Date : 11/04/2016 Author : Freeware, for evaluation and non-commercial use only Company : Comments:

Project : Version : Date : 11/04/2016 Author : Freeware, for evaluation and non-commercial use only Company : Comments: Lampiran 1 Listing program dari seluruh sistem. /***************************************************** This program was produced by the CodeWizardAVR V2.04.9 Evaluation Automatic Program Generator Copyright

More information

Lampiran. Universitas Sumatera Utara

Lampiran. Universitas Sumatera Utara Lampiran LISTING PROGRAM #include #include // Declare your global variables here char buff[16]; unsigned int frekuensi,x; unsigned int detak; // External Interrupt 0 service routine

More information

LAMPIRAN A. Universitas Sumatera Utara

LAMPIRAN A. Universitas Sumatera Utara LAMPIRAN A Program CODEVISIONAVR Untuk program mikrokontroler pada Robot /***************************************************** Date : 8/24/2014 Chip type : ATmega16 Program type : Application AVR Core

More information

LAMPIRAN A. I. Gambar alat percobaan I.1. Power supply. 1. Rangkaian sekunder 2. Dioda. 3. Heatsink 4. Power supply (keseluruhan)

LAMPIRAN A. I. Gambar alat percobaan I.1. Power supply. 1. Rangkaian sekunder 2. Dioda. 3. Heatsink 4. Power supply (keseluruhan) 100 I. Gambar alat percobaan I.1. Power supply LAMPIRAN A 1. Rangkaian sekunder 2. Dioda 3. Heatsink 4. Power supply (keseluruhan) 101 I.2 Gambar bagian bagian alat pemanas induksi 1. Kumparan Solenoide

More information

ECE477: Team 10 Software Design Considerations, Narrative, and Documentation

ECE477: Team 10 Software Design Considerations, Narrative, and Documentation TABLE OF CONTENTS 1 INTRODUCTION...2 1.1 MASTER DEVICE...2 1.2 SLAVE (SITE) DEVICE...2 1.3 CONNECTING BUS...2 2 MASTER DEVICE...3 2.1 SOFTWARE DESIGN CONSIDERATIONS...3 2.1.1 Memory Considerations...3

More information

Burglar Alarm Final Report

Burglar Alarm Final Report Burglar Alarm Submitted By: Brandon Maciel, Linda Thompson, Bradford Savage ETEE3255 Lab VII Instructor: Barry Sherlock Date Due: November 18 th, 2010 Abstract 1 The purpose of this project was to design,

More information

Automatic Gate Prototype Based on Microcontroller of Atmel ATMega16

Automatic Gate Prototype Based on Microcontroller of Atmel ATMega16 Journal of Electrical Technology UMY (JET-UMY), Vol. 1, No. 2, June 2017 ISSN 2550-1186 e-issn 2580-6823 Automatic Gate Prototype Based on Microcontroller of Atmel ATMega16 Anna Nur Nazilah Chamim *1,

More information

How2Use DT-AVR ATMEGA128L BMS. Oleh: IE Team. Picture 1 The layout of DT-AVR ATMEGA128L BMS

How2Use DT-AVR ATMEGA128L BMS. Oleh: IE Team. Picture 1 The layout of DT-AVR ATMEGA128L BMS DT-AVR ATMEGA128L BMS Application Note Oleh: IE Team This Application Note (AN) serves as a tutorial of how to use the DT-AVR ATMEGA128L Bootloader Micro System along with its supplementary software. The

More information

LAMPIRAN. Universitas Sumatera Utara

LAMPIRAN. Universitas Sumatera Utara LAMPIRAN Program Untuk Mengetes Huruf R Pada Matriks 8x8 /******************************************************* This program was created by the CodeWizardAVR V3.09 Standard Automatic Program Generator

More information

ATMega16 AVR AVR AVR DIP. (in-circiut programming) desktop MOSI MOSIT. AVRProg. header. (toggle)

ATMega16 AVR AVR AVR DIP. (in-circiut programming) desktop MOSI MOSIT. AVRProg. header. (toggle) ATMega16 AVR AVR ATMega16 AVR AVR AVR DIP (in-circiut programming) desktop MOSI GND SK MISO MOSIT Ω Dontronic SK MISO AVRProg AVR109 JTAGIEII STK500 AVR header AVRProg clock I/O (toggle) clock GND V ATMega16

More information

How2Use DT-AVR ATMEGA168 BMS. By: IE Team. Picture 1 The layout of DT-AVR ATMEGA168 BMS

How2Use DT-AVR ATMEGA168 BMS. By: IE Team. Picture 1 The layout of DT-AVR ATMEGA168 BMS DT-AVR ATMEGA168 BMS Application Note By: IE Team This Application Note (AN) serves as a tutorial of how to use the DT-AVR ATMEGA168 Bootloader Micro System along with its supplementary software. The layout

More information

LAMPIRAN A LIST PROGRAM SERVER DAN CLIENT

LAMPIRAN A LIST PROGRAM SERVER DAN CLIENT 1 LAMPIRAN A LIST PROGRAM SERVER DAN CLIENT 2 KETERANGAN OBJEK KONTROL SERVER (VB.6) OBJEK PROPERTY SETTING Command1 Caption Exit Command2 Caption START Command3 Caption UP Command4 Caption DOWN Command5

More information

W.E.S.L.E.Y. Waste Eliminating System for Lazy Engineering Youths. Final Report December 9, 2003 John Mercado

W.E.S.L.E.Y. Waste Eliminating System for Lazy Engineering Youths. Final Report December 9, 2003 John Mercado Waste Eliminating System for Lazy Engineering Youths Final Report December 9, 2003 John Mercado Table of Contents: Abstract... 3 Executive Summary... 3 Introduction... 3 Integrated Systems... 4 Mobile

More information

Serial Compact Flash Serial CF Card Module User Manual

Serial Compact Flash Serial CF Card Module User Manual CUBLOC Peripheral Serial Compact Flash Serial Card Module User Manual 3. Specifications Model -COM5 -COM3 Voltage 4.5~5.5V 2.7~5.5V - 115200 bps: 20KB/s - 115200 bps: 15KB/s Read Speed - 9600 bps: 6KB/s

More information

// sets the position of cursor in row and column

// sets the position of cursor in row and column CODE: 1] // YES_LCD_SKETCH_10_14_12 #include //lcd(rs, E, D4, D5, D6, D7) LiquidCrystal lcd(8, 9, 4, 5, 6, 7); int numrows = 2; int numcols = 16; void setup() Serial.begin(9600); lcd.begin(numrows,

More information

AN703. Micro64/128. Accessing the 36k of SRAM 12/3/04

AN703. Micro64/128. Accessing the 36k of SRAM 12/3/04 AN703 Micro64/128 Accessing the 36k of SRAM 12/3/04 Introduction: Micro64/128 has a total of 36k of SRAM. 4 k of SRAM is built into the processor an additional 32k of SRAM is available inside the Micro64/128

More information

Final Design Report. Team Name: No Rest for the Weary

Final Design Report. Team Name: No Rest for the Weary EEL 4924 Electrical Engineering Design (Senior Design) Final Design Report 4 August 2009 Project Title: SLEEP Team Name: No Rest for the Weary Team Members: Renard Sumlar lrsum825@ufl.edu Brad Bromlow

More information

ET-BASE AVR ATmega64/128

ET-BASE AVR ATmega64/128 ET-BASE AVR ATmega64/128 ET-BASE AVR ATmega64/128 which is a Board Microcontroller AVR family from ATMEL uses MCU No.ATmega64 and ATmega128 64PIN. Board ET-BASE AVR ATmega64/128 uses MCU s resources on

More information

TekBots TM Oregon State University. mega User Guide

TekBots TM Oregon State University. mega User Guide mega128.1 ------------------------------------------------- User Guide TekBots TM Oregon State University Version 1.2 By Adriaan Smit OSU EE Graduate Student Page 2 of 32 Index By Adriaan Smit... 1 OSU

More information

" Write"a"single"line"of"C"code"to"implement"each"of"the"following.""Assume"the"following"declarations"

 WriteasinglelineofCcodetoimplementeachofthefollowing.Assumethefollowingdeclarations Name:TianshuangGao LabSection:C CprE288Spring2014 Homework4 DueFri.Feb.14 Notes: Homeworkanswersmustbetypedusingawordeditor. Homeworkisindividualwork.AdheretotheUniversity spolicyrelatingtotheintegrityof

More information

Lampiran 1 Tabel data normalisasi lemari tabung LPG dari alat Konsentrasi Gas LPG Konsentrasi Gas

Lampiran 1 Tabel data normalisasi lemari tabung LPG dari alat Konsentrasi Gas LPG Konsentrasi Gas 52 Lampiran 1 Tabel data normalisasi lemari tabung LPG dari alat Konsentrasi Gas LPG Konsentrasi Gas Waktu (s) Data 1 (ppm) Data 2 (ppm) Data 3 (ppm) LPG Rata-rata (ppm) 10 2640,02 2725,35 2773,96 2713,11

More information

Digital and Analogue Project Report

Digital and Analogue Project Report EITF 040 Digital and Analogue Project Report Group 6 Fida Saidani Qinghua Liu March, 2013 1 Abstract The aim of this project is to build an electronic device that makes use of the law of light reflection,

More information

Interrupt vectors for the 68HC912B32. The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF.

Interrupt vectors for the 68HC912B32. The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF. Interrupts The Real Time Interrupt Interrupt vectors for the 68HC912B32 The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF. These vectors are programmed into Flash EEPROM

More information

The modules in this lab room are 4 line by 16 character display modules. The data sheet/users manual for the module is posted on My.Seneca.

The modules in this lab room are 4 line by 16 character display modules. The data sheet/users manual for the module is posted on My.Seneca. LCD Modules A common output display device used with low cost embedded systems is a character LCD display. The displays are available as complete modules with a standard microprocessor parallel interface.

More information

/*Algorithm: This code display a centrifuge with five variable speed RPM by increaseing */

/*Algorithm: This code display a centrifuge with five variable speed RPM by increaseing */ /*Algorithm: This code display a centrifuge with five variable speed RPM by increaseing */ /*the speed the cell which are less dense can float and the cell that are denser can sink*/ /*the user has five

More information

Introduction to the MC9S12 Hardware Subsystems

Introduction to the MC9S12 Hardware Subsystems Setting and clearing bits in C Using pointers in C o Program to count the number of negative numbers in an area of memory Introduction to the MC9S12 Hardware Subsystems o The MC9S12 timer subsystem Operators

More information

Robosoft Systems in association with JNCE presents. Swarm Robotics

Robosoft Systems in association with JNCE presents. Swarm Robotics Robosoft Systems in association with JNCE presents Swarm Robotics What is a Robot Wall-E Asimo ABB Superior Moti ABB FlexPicker What is Swarm Robotics RoboCup ~ 07 Lets Prepare for the Robotics Age The

More information

EMBEDDED HARDWARE DESIGN. Tutorial Interfacing LCD with Microcontroller /I

EMBEDDED HARDWARE DESIGN. Tutorial Interfacing LCD with Microcontroller /I EMBEDDED HARDWARE DESIGN Tutorial Interfacing LCD with Microcontroller 2009-10/I LCD (Liquid Crystal Display) has become very popular option for displaying in Embedded Applications. Since they are very

More information

Topic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR

Topic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR Topic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR Introduction Timer s objective Timer features Timer Registers - Understand function of each bit Initialization Introduction o In micro-p, we use counter

More information

C Programming Language

C Programming Language C Programming Language Advantages over assembly language for microcontrollers: More portable Math functions Readability Maintainability Editing C End-of-line ignored Use line breaks/tabs/indent for readability

More information

Getting Started With the Micro64

Getting Started With the Micro64 1.0 Software Installation Getting Started With the Micro64 1.1 Installing the CodeVisionAVR C Compiler 1. Open the CodeVisionAVR Demo folder on the CD. 5. Click the Next button and the following window

More information

Introduction to Embedded Systems

Introduction to Embedded Systems Stefan Kowalewski, 4. November 25 Introduction to Embedded Systems Part 2: Microcontrollers. Basics 2. Structure/elements 3. Digital I/O 4. Interrupts 5. Timers/Counters Introduction to Embedded Systems

More information

Programming Microcontroller Assembly and C

Programming Microcontroller Assembly and C Programming Microcontroller Assembly and C Course Number CLO : 2 Week : 5-7 : TTH2D3 CLO#2 Student have the knowledge to create basic programming for microcontroller [C3] Understand how to program in Assembly

More information

4. Application Programming

4. Application Programming 4. Application Programming 4.1 Writing an Application The C programming language, not C++, is utilized to develop the applications that are uploaded to the microcontroller used in this project. However,

More information

The MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function

The MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function The MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function o Registers used to enable the output compare function o Using the MC9S12

More information

Capturing the Time of an External Event Input Capture Subsystem

Capturing the Time of an External Event Input Capture Subsystem Capturing the Time of an External Event Input Capture Subsystem One way to determine the time of an external event is to wait for the event to occur, the read the TCNT register: For example, to determine

More information

INTERRUPTS in microprocessor systems

INTERRUPTS in microprocessor systems INTERRUPTS in microprocessor systems Microcontroller Power Supply clock fx (Central Proccesor Unit) CPU Reset Hardware Interrupts system IRQ Internal address bus Internal data bus Internal control bus

More information

TIMSK=0b ; /* enables the T/C0 overflow interrupt in the T/C interrupt mask register for */

TIMSK=0b ; /* enables the T/C0 overflow interrupt in the T/C interrupt mask register for */ The codes below which help in better understanding of timers and counters. I have tested this code for atmega32. I have taken reference from www.avrfreaks.net. Hope you all will find this useful. Darsh

More information

C Language Programming, Interrupts and Timer Hardware

C Language Programming, Interrupts and Timer Hardware C Language Programming, Interrupts and Timer Hardware In this sequence of three labs, you will learn how to write simple C language programs for the MC9S12 microcontroller, and how to use interrupts and

More information

Team 8: Robert Blake Craig Goliber Alanna Ocampo

Team 8: Robert Blake Craig Goliber Alanna Ocampo Team 8: Robert Blake Craig Goliber Alanna Ocampo Objective of the design CAD Presentation Microcontroller Implementation PCB Design Design Limitations Conclusion Problem: Design a centrifuge which was

More information

UBC104 Embedded Systems. Review: Introduction to Microcontrollers

UBC104 Embedded Systems. Review: Introduction to Microcontrollers UBC104 Embedded Systems Review: Introduction to Microcontrollers Processors General purpose processors: 80386 Pentium Core Duo Large number of pins External memory External peripherals * Figure from Intel

More information

EE318 Electronic Design Lab, Project Report, EE Dept, IIT Bombay, April GPS Tracker. Group No: B11

EE318 Electronic Design Lab, Project Report, EE Dept, IIT Bombay, April GPS Tracker. Group No: B11 EE318 Electronic Design Lab, Project Report, EE Dept, IIT Bombay, April 2009 GPS Tracker Group No: B11 B.V. Sesha Pavan Srinadh (06007038) Mayank Manjrekar (06007036)

More information

Embedded Systems Programming. ETEE 3285 Topic HW3: Coding, Compiling, Simulating

Embedded Systems Programming. ETEE 3285 Topic HW3: Coding, Compiling, Simulating Embedded Systems Programming ETEE 3285 Topic HW3: Coding, Compiling, Simulating 1 Assignment Write the Chasing Lights Program in C Use Codevision AVR to compile the program and remove all syntax errors

More information

,$5$SSOLFDWLRQ1RWH$95 (IILFLHQWSURJUDPPLQJRI$WPHO V $95 PLFURFRQWUROOHUV

,$5$SSOLFDWLRQ1RWH$95 (IILFLHQWSURJUDPPLQJRI$WPHO V $95 PLFURFRQWUROOHUV ,$5$SSOLFDWLRQ1RWH$95 (IILFLHQWSURJUDPPLQJRI$WPHO V $95 PLFURFRQWUROOHUV 6XPPDU\ This application note provides some useful hints on how to program the Atmel AVR microcontrollers using the IAR Compiler.

More information

12.1. Unit 12. Exceptions & Interrupts

12.1. Unit 12. Exceptions & Interrupts 12.1 Unit 12 Exceptions & Interrupts 12.2 Disclaimer 1 This is just an introduction to the topic of interrupts. You are not meant to master these right now but just start to use them We will cover more

More information

Speed Control of a DC Motor using Digital Control

Speed Control of a DC Motor using Digital Control Speed Control of a DC Motor using Digital Control The scope of this project is threefold. The first part of the project is to control an LCD display and use it as part of a digital tachometer. Secondly,

More information

INTERFACING HARDWARE WITH MICROCONTROLLER

INTERFACING HARDWARE WITH MICROCONTROLLER INTERFACING HARDWARE WITH MICROCONTROLLER P.Raghavendra Prasad Final Yr EEE What is a Microcontroller? A microcontroller (or MCU) is acomputer-on-a-chip. It is a type of microprocessor emphasizing self-

More information

WEATHER STATION WITH SERIAL COMMUNICATION

WEATHER STATION WITH SERIAL COMMUNICATION WEATHER STATION WITH SERIAL COMMUNICATION Written by: Wenbo Ye, Xiao Qu, Carl-Wilhelm Igelström FACULTY OF ENGINEERING, LTH Digital and Analogue Projects EITF11 Contents Introduction... 2 Requirements...

More information

Timer 32. Last updated 8/7/18

Timer 32. Last updated 8/7/18 Last updated 8/7/18 Basic Timer Function Delay Counter Load a value into a counter register The counter counts Down to zero (count down timer) Up from zero (count up timer) An action is triggered when

More information

Topic 11: Interrupts ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR

Topic 11: Interrupts ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR Topic 11: Interrupts ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR Objectives To become familiar with interrupts on the AVR Maskable and non-maskable Initialization Triggers To develop interrupt service routines

More information

LCDs. Embedded Systems Interfacing. 20 September 2011

LCDs. Embedded Systems Interfacing. 20 September 2011 20 September 2011 How Polarizers Work How work How Color Work Other Technologies Reflective Nematic (no back light) Cholesteric Liquid Crystal Organic LED/Polymer LED Vacuum Florescent Display Display

More information

Timer0..Timer3. Interrupt Description Input Conditions Enable Flag

Timer0..Timer3. Interrupt Description Input Conditions Enable Flag Timer0..Timer3 Timers are pretty useful: likewise, Microchip provides four different timers for you to use. Like all interrupts, you have to Enable the interrupt, Set the conditions of the interrupt, and

More information

Marten van Dijk, Syed Kamran Haider

Marten van Dijk, Syed Kamran Haider ECE3411 Fall 2015 Lecture 3b. Timers 0, 1 & 2 Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: vandijk, syed.haider@engr.uconn.edu Based

More information

C Language Programming, Interrupts and Timer Hardware

C Language Programming, Interrupts and Timer Hardware C Language Programming, Interrupts and Timer Hardware In this sequence of three labs, you will learn how to write simple C language programs for the MC9S12 microcontroller, and how to use interrupts and

More information

Programming the Atmel ATmega328P in C

Programming the Atmel ATmega328P in C Ming Hsieh Department of Electrical Engineering EE 459Lx - Embedded Systems Design Laboratory Programming the Atmel ATmega328P in C (for AVR-gcc V4) by Allan G. Weber 1 Introduction This document discusses

More information

EE 109 Unit 4. Microcontrollers (Arduino) Overview

EE 109 Unit 4. Microcontrollers (Arduino) Overview 1 EE 109 Unit 4 Microcontrollers (Arduino) Overview 2 Using software to perform logic on individual (or groups) of bits BIT FIDDLING 3 Numbers in Other Bases in C/C++ Suppose we want to place the binary

More information

#include <Mega32.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <delay.h>

#include <Mega32.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <delay.h> // Shing Yan (sy228@cornell.edu) // Raymond Siow (rs234@cornell.edu) // Cornell University, Ithaca, NY 14853, USA // ECE 476 // Final Project - Traffic control // Section: Mondays 4:30pm-7:30pm // Last

More information

EE 308 Spring Exam 1 Feb. 27

EE 308 Spring Exam 1 Feb. 27 Exam 1 Feb. 27 You will be able to use all of the Motorola data manuals on the exam. No calculators will be allowed for the exam. Numbers Decimal to Hex (signed and unsigned) Hex to Decimal (signed and

More information

ADC: Analog to Digital Conversion

ADC: Analog to Digital Conversion ECE3411 Fall 2015 Lecture 5b. ADC: Analog to Digital Conversion Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: {vandijk, syed.haider}@engr.uconn.edu

More information

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,

More information

#include <avr/io.h> #include <avr/interrupt.h> #define F_CPU UL // 8 MHz.h> #include <util/delay.h>

#include <avr/io.h> #include <avr/interrupt.h> #define F_CPU UL // 8 MHz.h> #include <util/delay.h> #include #include #define F_CPU 8000000UL // 8 MHz.h> #include unsigned char buttonpressed; int tempout; int tempin; int realtempout; int realtempin; int maxalarm;

More information

MicroToys Guide: PS/2 Mouse N. Pinckney April 2005

MicroToys Guide: PS/2 Mouse N. Pinckney April 2005 Introduction A computer mouse provides an excellent device to acquire 2D coordinate-based user input, since most users are already familiar with it. Most mice usually come with two or three buttons, though

More information

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly.

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly. More on Programming the 9S12 in C Huang Sections 5.2 through 5.4 Introduction to the MC9S12 Hardware Subsystems Huang Sections 8.2-8.6 ECT_16B8C Block User Guide A summary of MC9S12 hardware subsystems

More information

Laboratory 4 Usage of timers

Laboratory 4 Usage of timers Laboratory 4 Usage of timers 1. Timer based interrupts Beside external interrupt, the MCU responds to internal ones which are triggered by external events (on the external pins). The source of the internal

More information

C:\Users\cunningh\StaysOnPC\ME430 Downloads & Projects\exam2_problem1\problem1Cunningham.c

C:\Users\cunningh\StaysOnPC\ME430 Downloads & Projects\exam2_problem1\problem1Cunningham.c C:\Users\cunningh\StaysOnPC\ME430 Downloads & Projects\exam2_problem1\problem1Cunningham.c / FileName: problem1cunningham.c Processor: PIC18F4520 Compiler: MPLAB C18 v.3.06 This file does the following...

More information

Programming Guide I2C Bus

Programming Guide I2C Bus Programming Guide I2C Bus S-Series, T-Series models cdg, 2016. 6. T: +082-32-719-8055 E-mail: cdg@eltsensor.co.kr www.eltsensor.co.kr Contents 1. Applied Models 2. Compare of each model 3. I2C Frame Sequence

More information

LCD. Configuration and Programming

LCD. Configuration and Programming LCD Configuration and Programming Interfacing and Programming with Input/Output Device: LCD LCD (liquid crystal display) is specifically manufactured to be used with microcontrollers, which means that

More information

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application...

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet Example Application... Overview of the PIC 16F648A Processor: Part 1 EE 361L Lab 2.1 Last update: August 19, 2011 Abstract: This report is the first of a three part series that discusses the features of the PIC 16F684A processor,

More information

chip1controller /* * SeniorDesignI2C.c * * Created: 11/24/2014 6:54:26 PM * Author: Robert Bower / Alonzo Ubilla * Chip 1 control */

chip1controller /* * SeniorDesignI2C.c * * Created: 11/24/2014 6:54:26 PM * Author: Robert Bower / Alonzo Ubilla * Chip 1 control */ /* * SeniorDesignI2C.c * * Created: 11/24/2014 6:54:26 PM * Author: Robert Bower / Alonzo Ubilla * Chip 1 control */ #include #include #include #include "TWI_slave.h"

More information

AVR Timers TIMER0. Based on:

AVR Timers TIMER0. Based on: AVR Timers TIMER0 Based on: http://maxembedded.wordpress.com/2011/06/24/avr-timers-timer0-2/ The basic concepts of AVR Timers. Let me summarize it: We have seen how timers are made up of registers, whose

More information

Marten van Dijk Department of Electrical & Computer Engineering University of Connecticut

Marten van Dijk Department of Electrical & Computer Engineering University of Connecticut ECE3411 Fall 2016 Lecture 4b. Review Session Marten van Dijk Department of Electrical & Computer Engineering University of Connecticut Email: marten.van_dijk@uconn.edu Copied from Lecture 4b, ECE3411 Fall

More information

Introduction. Unit 4. Numbers in Other Bases in C/C++ BIT FIDDLING. Microcontrollers (Arduino) Overview Digital I/O

Introduction. Unit 4. Numbers in Other Bases in C/C++ BIT FIDDLING. Microcontrollers (Arduino) Overview Digital I/O 4.1 4.2 Introduction Unit 4 Microcontrollers () Overview Digital I/O The primary way that software controls hardware is by manipulating individual bits We need to learn how to: Set a bit to a 1 Clear a

More information

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background:

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background: Background: Timer2 Interrupts The execution time for routines sometimes needs to be set. This chapter loops at several ways to set the sampling rate. Example: Write a routine which increments an 8-bit

More information

#include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> #include <string.h> #include <stdlib.h> #include "lcd.c"

#include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> #include <string.h> #include <stdlib.h> #include lcd.c #include #include #include #include #include #include "lcd.c" * key_pressed : The key last pressed in binary form. Taken from PINB. * key

More information

The MC9S12 Timer Input Capture Function

The MC9S12 Timer Input Capture Function The MC9S12 Timer Input Capture Function o Capturing the time of an external event o The MC9S12 Input Capture Function o Registers used to enable the Input Capture Function o Using the MC9S12 Input Capture

More information

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4

1 Introduction to Computers and Computer Terminology Programs Memory Processor Data Sheet... 4 Overview of the PIC 16F648A Processor: Part 1 EE 361L Lab 2.1 Last update: August 1, 2016 Abstract: This report is the first of a three part series that discusses the features of the PIC 16F648A processor,

More information

MECHATRONICS AND CONTROL SYSTEMS LABORATORY HANDBOOK

MECHATRONICS AND CONTROL SYSTEMS LABORATORY HANDBOOK ROZWÓJ POTENCJAŁU I OFERTY DYDAKTYCZNEJ POLITECHNIKI WROCŁAWSKIEJ Wrocław University of Technology Refrigeration and Cryogenics Artur Jędrusyna, Krzysztof Tomczuk MECHATRONICS AND CONTROL SYSTEMS LABORATORY

More information