WEATHER STATION WITH SERIAL COMMUNICATION
|
|
- Arthur Caldwell
- 5 years ago
- Views:
Transcription
1 WEATHER STATION WITH SERIAL COMMUNICATION Written by: Wenbo Ye, Xiao Qu, Carl-Wilhelm Igelström FACULTY OF ENGINEERING, LTH Digital and Analogue Projects EITF11
2 Contents Introduction... 2 Requirements... 2 Hardware Specification... 2 Processor... 2 LCD-Display... 2 Sensor... 2 Serial communication... 3 Keypad and encoder... 3 Construction... 3 Schematic... 3 Connecting the components... 3 Programming... 3 Results... 4 Conclusion and comments... 4 References and Data sheets... 5 Attachments... 5 Circuit Schematic... 5 Source Code... 5
3 Introduction This course, EITF11, is an elementary course in building and constructing an electronic device which can be either analogue, only using basic electronic components, or digital, using a microcontroller. The students are by the end of the course present a finished and working prototype along with documentation regarding the project. We as a group chose to build a thermometer using an ATMega16 microcontroller programming it in C using Atmel s Studio4 together with a JTagICE MKII programmer. The project is given a relative short time frame for completion and thus we decided to make the most basic device possible and in case of more time over adding more features to the device. In order to be successful in this project it is was crucial to be able to read and understand the respective datasheets accompanying the used hardware, hence we spent the initial time to get accustomed to the way of reading hardware specifications. Requirements The required and implemented functions for the device was established to: Measure current temperature Display the temperature in Fahrenheit and Celsius on a LCD screen The ability to switch between displaying the temperature in Fahrenheit, Celsius and a menu through a keypad Send a data stream containing the measured temperature to a computer through serial communication Automatically update the temperature with appropriate time interval Hardware Specification The hardware components used in this project is described in this paragraph. Processor The processor is an 8-bit ATMega16 using the internal clock at 8 MHz and with a built in A/D converter. It has 32 programmable I/O ports, some of which were by default occupied by the JTagICE MkII programming interface. LCD-Display The display is a 16x2 row LCD display of an unknown brand, but functionality and datasheet corresponds to a SHARP Dot-Matrix LCD unit. Every symbol written to the display is represented by 8- bits. Sensor The temperature sensor, the LM335 gives an output voltage proportional to the temperature in Kelvin. It gives zero voltage output at zero degrees Kelvin and thus we avoid the need to implement negative reference voltages otherwise needed with the available centigrade sensor, the LM35. One degree Kelvin corresponds to an output voltage of 10mV, which is then sent to the A/D converter in the microprocessor and then inside the processor using programming convert the voltage into temperature (Kelvin) and lastly convert it into Celsius and Fahrenheit.
4 Serial communication The possibility of communicating with a computer through a serial RS-232 port was implemented using a standard RS-232 female module connected to a MAX233 serial driver. It is needed in order to convert the signals to and from the serial port into the circuit. The signals running inside the serial needs a higher voltage than inside the circuit. The MAX232 have the ability to use a normal +5V power supply and then amplify the electric tension to the ±7.5V needed in the serial port. Keypad and encoder The keypad used is a generic 4x4 keypad of an unknown brand which we used together with an encoder in order to save pins going into the processor. The encoder is of the brand MM74C922, it sends the information from out keypad to the microprocessor. Construction Schematic The schematic was drawn beforehand construction phase using a software supplied by the school, overall after the first schematic was finished we only needed to rearrange minor details. The reason for this was because of the initial time of the project was spent thoroughly studying the datasheets. Connecting the components The core of our project is ATmega16 microcontroller. The keypad is connected to the microcontroller through an encoder to Port D, therefore only 4 available pins on the microcontroller are required. The LCD display is connected directly to port B of the processor and the display s 3 control bits are connected to Port A. The temperature sensor is connected to Port A where the microprocessor is able to obtain the voltage value with an ADC converter. In order to transform voltage signal between the microcontroller and the PC, a MAX233A was required and it is connected to Port D. During the hardware implement section, a couple of problems presented themselves. Firstly we used LM35 but since it will output zero volt at zero degrees, more efforts are required to make it work due to the need of negative reference voltages for temperatures below zero. We changed the sensor to LM335 which instead outputs a voltage corresponding to a Kelvin temperature scale, which in practice changed the output in a way that the sensor instead outputs zero voltage at zero degrees Kelvin, avoiding the use of negative reference voltages. The sensor still failed to work in the beginning, more precise: It was not measuring any temperature at all. It turned out that in the datasheet, the reference drawing that shows the sensor s pins was showing the pins viewed from the bottom and not from the top. Realizing our mistake in point of view this enabled us to connect the sensor in the correct way. Another important connection that we ignored in the beginning was the AREF pin, it is needed to trigger the AD convertor inside the microprocessor. After we connected the AREF pin to Vcc the AD converter started to work and the hardware was all set. Programming Our project code is written in C using AVR studio 4. In order to implement the functions of the keypad and temperature sensor as the input and LCD_Display and USART as the output, we wrote some sub-functions of LCD, ADC, timer and USART firstly, and also a sub-function for checking the button being pressed. Then we wrote sub-functions for displaying three different screens, one for displaying the home and the other two for displaying the Celsius and Fahrenheit temperature. Finally we began to write the main function to combine each sub-function.
5 We met some problems while debugging the program. Firstly we found that the LCD did not work, so we checked the connection of the hardware by setting the port value manually and found no problem with the connection. Then we inspected the code and found some mistakes in the assignment of the bits in the I/O port. By correcting these mistakes, we made the LCD work as we wanted. Then we used the autostep to run the code but found that the _delay_ms and _delay_us functions took too long time to implement so we changed them for check_busy function. Firstly we found that the check_busy function did not work properly so we split the while loop to make it less complex, and it worked well with autostep. However when we ran the code, the pointer could not get out of the check_busy function. After some modification of the while loop, we got the code running well. Some other problems occurred for instance: when we displayed the character string array on the LCD, there would be some garbled characters at the end of the array. So we limited the length of the array and the garbled characters disappeared. We also cut off some unuseful judgments in the check_button() function in order to prevent them to take too much time in judging the button we pressed. After our elaborate work, we finally finished the code with no errors exhibited in the hardware and got the expected functions as we wished. But there are still small problems, for instance, the keypad sometimes gets stuck because the system cannot read the data of the pressed key. We think that the cause for this is faulty/glitchy wiring. Results After several initializations of different parts the system displays "Display Temp" in the first line and "1:C 0:F" in the second line on the LCD which means key 1 is for the Celsius temperature and key 0 is for the Fahrenheit temperature. Then the system goes into a while loop and checks the changes of the variable checkbutton in the check_button() function for key press. If we press the key 1 on the keypad the system will start the AD conversion to get the temperature value from the temperature sensor and go into a screen which shows the Celsius temperature in the first line and "3:Back to home" in the second line. The temperature will update itself for every 2.1 seconds. Meanwhile the value will be sent to the computer by serial communication. If we press key 3 to go back to the first screen and then press key 2, the system will show the Fahrenheit temperature and "3:Back to home" on the screen and update and send the temperature to the computer for every 2.1 seconds. Conclusion and comments The project concluded in a working thermometer with a LCD-screen interface and serial communication capabilities. Many of the problems that arose were due to lack of experience within this field. The overall understanding for how to carry out an electronics project has increased and also the ability to read and understand datasheets have increased dramatically. In general the workflow progressed surprisingly smooth and most problems were solved within a reasonable timeframe. Further addable features include more programming inside of the PC that the device is communicating with. Such as trends and possible predictions of future temperature changes, or just simply collection of temperature data. There is also a possibility to change the communication interface from RS232 to Wi-Fi, something that would be a more modern solution. Further improvements involve cosmetics, durability and addition of extra sensors related to measuring weather metrics such as air pressure.
6 References and Data sheets ATMega16 microprocessor: LM335 Kelvin temperature sensor: SHARP Dot-Matrix LCD unit: 16-key Encoder: MAX232 +5V powered, Multichannel RS-232 Driver: Attachments Circuit Schematic Source Code #include <avr/io.h>
7 #include <util/delay.h> #include <math.h> #include <avr/interrupt.h> #include <avr/signal.h> #define F_CPU UL // 8 MHz #define USART_BAUDRATE 9600 // Baud Rate value #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) unsigned char flag=0,celtempchar[3],fahtempchar[4],button=0xff,flag1=0; char checkbutton; int templ,temph,temp,celtemp,fahtemp; //void _delay_ms (double ms) //void _delay_us (double us) included in delay.h //Subfunction:I/O Port initialization void IOinit() DDRA = 0x0e; DDRB = 0xff; DDRC = 0xff; DDRD = 0xfa; //set PA0,PA4-PA7 to input ADC,set PA1-PA3 to output //set PB0-PB7 to output //set PC0-PC7 to output //set PD0,PD2 to input,set others to output PORTA =0x00; PORTB =0x00; //Subfunction:write instruction to LCD void write_cmd_lcd(char cmd) PORTA &=~(1<<PA2);
8 PORTA &=~(1<<PA3); //set RS=0 and RW=0 PORTB = cmd; //enable signal and send data to PORTB PORTA =(1<<PA1); //set E=1 of LCD PORTA &=~(1<<PA1); //E=0 of LCD //Subfunction:write data to LCD void write_data_lcd(char data) PORTA &=~(1<<PA2); PORTA = (1<<PA3); //set RS=1 and RW=0 PORTB = data; PORTA =(1<<PA1); //enable signal and send data to PORTB //set E=1 of LCD PORTA &=~(1<<PA1); //E=0 of LCD //Subfunction:read data from LCD unsigned char read_data_lcd() unsigned char address; DDRB = 0x00; //set PB0-PB7 to input PORTA = (1<<PA2); PORTA &=~(1<<PA3); PORTA =(1<<PA1); //set RS=0 and RW=1 //set E=1 of LCD
9 address = PINB; //read data from PORTB PORTA &=~(1<<PA1); //E=0 of LCD DDRB = 0xff; //set PB0-PB7 to output return address; //Subfunction:read data from LCD void check_busy() unsigned char x; x=read_data_lcd()&0x80; while(x==0x80) x=read_data_lcd()&0x80; //Subfunction:LCD initialization void LCDinit() write_cmd_lcd(0x38); //function set:8bit mode write_cmd_lcd(0x07); //entry mode set write_cmd_lcd(0x01);//clear display write_cmd_lcd(0x02);//cursor home
10 write_cmd_lcd(0x0f);//display on/off //Subfunction:clear LCD void clear_lcd() write_cmd_lcd(0x01);//clear display //Subfunction:display a string on LCD void disp_string(unsigned char*s,unsigned char length) unsigned char i=0; for(i=0;i<length;i++) write_data_lcd(s[i]); //Subfunction:ADC initialization void ADInit()
11 ADMUX = 0x00; //Set Reference to AREF and input to ADC0 ADCSRA = 0b ; //Enable ADC and ADC interrupt, set prescaler to 16 SFIOR = 0x00; sei(); //Free Running mode //Enable global interrupts //Subfunction:ADC interrupt ISR(ADC_vect) templ = ADCL; temph = (ADCH & 0x03); temp = (temph*256)+templ; celtemp = temp/1023.0* ; temperature fahtemp = 9/5.0*celtemp+32; temperature //read data from the ADCL and ADCH register //temph is shifted 8 bits to get the total value of 10 bits. //change the ADC conversion result to Celsius //change the Celsius temperature to Fahrenheit ADCSRA =(1<<ADSC); //restart the AD conversion //Subfunction:USART initialization void usart_init() circuitry UCSRB = (1 << RXEN) (1 << TXEN); // Turn on the transmission and reception UCSRC = (1 << URSEL) (1 << UCSZ0) (1 << UCSZ1); sizes,1 stop bit // Use 8-bit character UBRRL = BAUD_PRESCALE; low byte of the UBRR register // Load lower 8-bits of the baud rate value into the
12 UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register //Subfunction:USART receive function unsigned int usart_receive() while (!(UCSRA & (1 << RXC))); // Wait for data to be received return UDR; // Get and return received data from buffer //Subfunction:USART transmit function void usart_transmit( unsigned char data ) while (!( UCSRA & (1<<UDRE)) ); // Wait for empty transmit buffer UDR = data; // Put data into buffer, sends the data //Subfunction:transmit a string void tran_string(unsigned char*s,unsigned char length) unsigned char i=0; for(i=0;i<length;i++) usart_transmit(s[i]);
13 //Subfunction:Timer1 initialization void timer1_init() TIMSK =(1<<TOIE1); // enable timer overflow interrupt for Timer1 TCCR1B = (1 << CS12); //set Timer1 register with prescale value 256 sei(); //Enable global interrupts //Subfunction:Timer1 interrupt ISR(TIMER1_OVF_vect) flag1=1; //set flag1 to 1 for every 65535*255*1/8M=2.1 seconds //Subfunction:check the button pressed on the keypad void check_button() button = (PINA & 0xf0); //masks the four least significant digits of the A-port switch(button) case 0x00: checkbutton = 0; break; case 0x40: checkbutton = 1; break;
14 case 0xc0: checkbutton = 3; break; default: checkbutton = -1; break; //Subfunction:display home menu void disp_home() write_cmd_lcd(0x06); disp_string("display Temp",12); write_cmd_lcd(0xc0); disp_string("1:c 0:F",8); //Subfunction:display Celsius temperature void disp_cel() if (celtemp<0) celtemp=-celtemp; celtempchar[0]=0xb0; //if celtemp<0, output a minus sign else celtempchar[0]=0x2b; //if celtemp>0, output a plus sign
15 celtempchar[2]= celtemp%10+48; celtempchar[1]= celtemp/10%10+48; //ones digit,change integer to character variable //tens digit write_cmd_lcd(0x06); //cursor goes to the first line disp_string("temp:",5); disp_string(celtempchar,3); write_data_lcd(0xdf); write_data_lcd('c'); write_cmd_lcd(0xc0); //cursor goes to the second line disp_string("3:back to home",14); tran_string(celtempchar,3); //Subfunction:display Fahrenheit temperature void disp_fah() if (fahtemp<0) fahtemp=-fahtemp; fahtempchar[0]=0xb0; else fahtempchar[0]=0x2b; fahtempchar[3]= fahtemp%10+48; fahtempchar[2]= fahtemp/10%10+48; fahtempchar[1]= fahtemp/100%10+48; //ones digit,change integer to character variable //tens digit //hundreds digit write_cmd_lcd(0x06); disp_string("temp:",5); disp_string(fahtempchar,4); write_data_lcd(0xdf); write_data_lcd('f');
16 write_cmd_lcd(0xc0); disp_string("3:back to home",14); tran_string(fahtempchar,4); //Mainfunction void main() IOinit(); LCDinit(); ADInit(); usart_init(); timer1_init(); disp_home(); ADCSRA =(1<<ADSC); //start AD conversion while(1) check_button(); if (checkbutton==1&&flag==1&&flag1==1) //update Celsius temperature for every 2.1 seconds clear_lcd(); disp_cel(); flag1=0; else if (checkbutton==0&&flag==1&&flag1==1) //update Fahrenheit temperature for every 2.1 seconds clear_lcd(); disp_fah(); flag1=0;
17 if (checkbutton==1&&flag==0) clear_lcd(); disp_cel(); flag=1; else if (checkbutton==0&&flag==0) clear_lcd(); disp_fah(); flag=1; else if(checkbutton==3&&flag==1) clear_lcd(); disp_home(); flag=0;
Features 2.4 GHz Carrier Frequency RS232 UART interface with variable baud rate Input supply voltage: 5V to 12V 255 possible Channels frequencies (0 to 255) Programmable Device Address (255 per channel)
More informationHow to use RFpro in Packet Mode
How to use RFpro in Packet Mode Jumper Setting Priority Jumper J1 à Configuration Mode Jumper à Higher Priority Jumper J2 à Packet Mode Jumper à Lower Priority When both the jumpers are connected, by default,
More informationOverview RFSv4.3 is a RF module providing easy and flexible wireless data transmission between devices. It is based on AVR Atmega8 with serial output which can be interfaced directly to PC. Features 2.4
More informationUsing the USART Serial Communications
Using the USART Serial Communications Tutorial (c) Dean Camera, 2007. dean_camera@hotmail.com This tutorial will focus on setting up the serial USART on the AVR platform. Although other hardware AVR interfaces
More information#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 informationEE318 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 informationKod. #define white PA5 #define green PA6 #define red PA7
Kod #define F_CPU 8000000UL #include #include #include #include #define USART_BAUDRATE 9600 #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL)))
More informationDigital 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 informationLayman definition: Gadgets and devices Technical definition: Self-controlled devices Usually, such systems consist of I/O (input/output) devices such
Layman definition: Gadgets and devices Technical definition: Self-controlled devices Usually, such systems consist of I/O (input/output) devices such as LCDs, keypads, etc. and other devices like EEPROM
More informationSoftware debouncing of buttons
Software debouncing of buttons snigelen February 5, 2015 1 Introduction Connecting a button as an input to a micro-controller is a relatively easy task, but there are some problems. The main problem is
More informationThe Atmel ATmega328P Microcontroller
Ming Hsieh Department of Electrical Engineering EE 459Lx - Embedded Systems Design Laboratory 1 Introduction The Atmel ATmega328P Microcontroller by Allan G. Weber This document is a short introduction
More informationRobosoft 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 informationTic-Tac-Toe Digital and Analogue Projects, LTH
Tic-Tac-Toe Digital and Analogue Projects, LTH Authors: Joakim Ahle - ada09jah@student.lu.se Anton Botvalde - gda07abo@student.lu.se Mentor: Bertil Lindvall - Bertil.Lindvall@eit.lth.se Lund, 140304 1
More informationINTERRUPTS 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 informationCOMP2121: Microprocessors and Interfacing
COMP2121: Microprocessors and Interfacing Lecture 25: Serial Input/Output (II) Overview USART (Universal Synchronous and Asynchronous serial Receiver and Transmitter) in AVR http://www.cse.unsw.edu.au/~cs2121
More informationIntroduction. 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 informationATMEGA32 MUSIC PLAYER
Digital and Analogue Projects EITF40 09/03/2015 ATMEGA32 MUSIC PLAYER Supervised by: Bertil Lindvall Controlled by buttons and accelerometer The purpose of this project was emulating a music player that
More informationADC: 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 informationSchool of Electrical, Computer and Telecommunications Engineering University of Wollongong Australia
ECTE333 s schedule ECTE333 Lecture 9 -Timers School of Electrical, Computer and Telecommunications Engineering University of Wollongong Australia Week Lecture (2h) Tutorial (h) Lab (2h) L7: C programming
More information12.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 informationUsing printf with an AVR
Using printf with an AVR Based on : http://efundies.com/avr/avr_printf.htm Required Functions You should keep all of the functions that you need from the previous guide: usart_init() usart_getchar() usart_purchar()
More informationThe Atmel ATmega168A Microcontroller
Ming Hsieh Department of Electrical Engineering EE 459Lx - Embedded Systems Design Laboratory The Atmel ATmega168A Microcontroller by Allan G. Weber 1 Introduction The Atmel ATmega168A is one member of
More informationIntroduction to Micro-controllers. Anurag Dwivedi
Introduction to Micro-controllers Anurag Dwivedi Lecture Structure Things to be covered today.. What is a micro-controller? What are the basic features of a microcontroller? How to input and output from
More informationProgramming 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 informationADC: Analog to Digital Conversion
ECE3411 Fall 2015 Lecture 5a. 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 informationUART: Universal Asynchronous Receiver & Transmitter
ECE3411 Fall 2015 Lecture 2a. UART: Universal Asynchronous Receiver & Transmitter Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: {vandijk,
More informationTIMSK=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// 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 informationSTUDENT NAME(s):. STUDENT NUMBER(s): B00.
ECED3204 Lab #5 STUDENT NAME(s):. STUDENT NUMBER(s): B00. Pre Lab Information It is recommended that you read this entire lab ahead of time. Doing so will save you considerable time during the lab, as
More informationAn FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal
Getting Started with the T-Board The T-Board modules were designed to speed up your AVR prototyping. This guide will show you just how quickly you can get up and running with the Hello World for microcontrollers
More informationECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015
ECE 353 Lab 4 General MIDI Explorer Professor Daniel Holcomb Fall 2015 Where are we in Course Lab 0 Cache Simulator in C C programming, data structures Cache architecture and analysis Lab 1 Heat Flow Modeling
More informationSerial Communications
1 Serial Interfaces 2 Embedded systems often use a serial interface to communicate with other devices. Serial Communications Serial implies that it sends or receives one bit at a time. Serial Interfaces
More informationAVR EEPROM Memory Read/Write Cookbook BETA version /23/08
AVR EEPROM Memory Read/Write Cookbook BETA version 0.00 2/23/08 This is the beta version of a tutorial that, once it has been sufficiently reviewed and commented in the forum, will be posted in the tutorials
More informationUNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz II
Department of Electrical and Computing Engineering UNIVERSITY OF CONNECTICUT ECE 3411 Microprocessor Application Lab: Fall 2015 Quiz II There are 5 questions in this quiz. There are 9 pages in this quiz
More informationFinal Design Report. Project Title: Interactive BreakerBox
EEL 4924 Electrical Engineering Design 2 (Senior Design) Final Design Report 23 April 2013 Project Title: Interactive BreakerBox Team Members: Name: Ambrose Coulliette Name: Aaron Joseph Project Abstract:
More informationArduino. (Digital-to-Analog Converter D/A D2A) (Digital to Analog Conversion) 3. (Analog to Digital conversion)
Arduino 1. 2. (Digital to Analog Conversion) 3. (Analog to Digital conversion) 1 2 Analog to Digital Converter (ADC) (Digital-to-Analog Converter D/A D2A) Digital to Analog Converter (DAC) 3 4 DAC Binary
More informationWeekly Update Michael Jorgensen Week of 3/18/11 3/24/11
Weekly Update Michael Jorgensen Week of 3/18/11 3/24/11 This week I programmed the microcontroller to do ADC on a sine wave. I was able to output a digital sine wave with the same frequency and amplitude
More informationAVR 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 informationchip1controller /* * 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 informationUSART Register Description
USART Register Description USART I/O Data Register UDR RXB[7:0] TXB[7:0] Read/Write R/W R/W R/W R/W R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0 UDR (Read) UDR (Write) The USART Transmit Data Buer Register
More informationCN310 Microprocessor Systems Design
CN310 Microprocessor Systems Design Microcontroller Nawin Somyat Department of Electrical and Computer Engineering Thammasat University Outline Course Contents 1 Introduction 2 Simple Computer 3 Microprocessor
More informationEmbedded Systems and Software
Embedded Systems and Software Lab 6 Considerations Lab 6 Considerations, Slide 1 Big Picture Connect to internal ADC + 0-5 V - Sensor To COM port on PC LCD RTC Optional: LCD display Lab 6 Considerations,
More informationC Programming in Atmel Studio 7 Step by Step Tutorial
C Programming in Atmel Studio 7 Step by Step Tutorial Sepehr Naimi NicerLand.com 1/1/017 Contents Introduction... Downloading and Installing Atmel Studio... 3 Opening Atmel Studio... 3 Creating the first
More information19.1. Unit 19. Serial Communications
9. Unit 9 Serial Communications 9.2 Serial Interfaces Embedded systems often use a serial interface to communicate with other devices. Serial implies that it sends or receives one bit at a time. µc Device
More informationCSCE 236 Embedded Systems, Fall 2017 Homework 5
CSCE 236 Embedded Systems, Fall 2017 Homework 5 Started: Tuesday, November 7th, 2017 Due: Friday, November 17th, 2017 (5pm) Instructions: This homework is an individual assignment, collaboration is not
More informationCSCE374 Robotics Fall 2013 Notes on the irobot Create
CSCE374 Robotics Fall 2013 Notes on the irobot Create This document contains some details on how to use irobot Create robots. 1 Important Documents These notes are intended to help you get started, but
More informationLecture 2. Introduction to Microcontrollers
Lecture 2 Introduction to Microcontrollers 1 Microcontrollers Microcontroller CPU + ++++++++++ Microprocessor CPU (on single chip) 2 What is a Microcontroller Integrated chip that typically contains integrated
More informationATmega128. Serial Communication (RS-232C)
ATmega128 Serial Communication (RS-232C) RS-232C EIA (Electronics Industries Association) DTE (Data Terminal Equipment) DCE (Data Communication Equipment) RS-232C Signals 핀번호 (Pin No.) 명칭 (Signal Name)
More information// filename pwm.c // ATtiny84 (14 pin DIP)
// stepper motor driver for spectrometer // with manual speed and direction input // and adjustable scan speed and direction // stepper motor driver set to 32usteps/step (32Hz clk = 1 step/sec) // filename
More informationUsing a Temperature Sensor
Using a Temperature Sensor Add a temperature sensor to the ATmega Board. Site: icode Course: Machine Science Guides (Arduino Version) Book: Using a Temperature Sensor Printed by: Ivan Rudnicki Date: Wednesday,
More informationEmbedded Systems and Software
Embedded Systems and Software Serial Communication Serial Communication, Slide 1 Lab 5 Administrative Students should start working on this LCD issues Caution on using Reset Line on AVR Project Posted
More informationEEL 4924C Electrical Engineering Design. (Senior Design) Final Design Report. April 21st Team Name: The Beatkicks
EEL 4924C Electrical Engineering Design (Senior Design) Final Design Report April 21st 2009 Team Name: The Beatkicks Name: Muqeet S. Mujahid Email: muqeet@ufl.edu Phone: (904) 208 1515 Team Members: Name:
More informationSpring 2017 Project Assignment Alarm Clock with Indoor/Outdoor Thermometer
USCViterbi School of Engineering Ming Hsieh Department of Electrical Engineering EE 109L - Introduction to Embedded Systems Spring 2017 Project Assignment Alarm Clock with Indoor/Outdoor Thermometer 1
More informationEmbedded programming, AVR intro
Applied mechatronics, Lab project Embedded programming, AVR intro Sven Gestegård Robertz Department of Computer Science, Lund University 2017 Outline 1 Low-level programming Bitwise operators Masking and
More informationLab Report for Sensor Calibration using a PIC16F84 GROUP MEMBERS ALFRED MAZHINDU SIMBARASHE CHIWESHE
CY-0205M Sensor and Actuators Lab Report for Sensor Calibration using a PIC16F84 GROUP MEMBERS ALFRED MAZHINDU - 09022270 SIMBARASHE CHIWESHE - 09016352 Alfred Mazhindu & Simbarashe Chiweshe Page 1 CONTENTS
More informationMarten 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 informationATmega128 USART. Overview
USART Dual USART Overview The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. The main features are: Full Duplex Operation
More informationAVR Board Setup General Purpose Digital Output
ECE3411 Fall 2016 Lab 2a. AVR Board Setup General Purpose Digital Output Marten van Dijk, Chenglu Jin Department of Electrical & Computer Engineering University of Connecticut Email: {marten.van_dijk,
More informationEmbedded Systems and Software. Serial Communication
Embedded Systems and Software Serial Communication Slide 1 Using RESET Pin on AVRs Normally RESET, but can be configured via fuse setting to be general-purpose I/O Slide 2 Disabling RESET Pin on AVRs Normally
More informationInternational Journal of Emerging Technology and Advanced Engineering Website: (ISSN , Volume 2, Issue 5, May 2012)
Enhanced Wireless Personal Area Network based Real Time motion(human) data Collection for advanced control room in Power Plants using ZigBee Transceiver Module Rajesh Singh 1, Madhu Sharma 2, Vivek Kaundal
More information4. 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 informationL A M P I R A N UNIVERSITAS KRISTEN MARANTHA
L A M P I R A N LAMPIRAN B LISTING PROGRAM MIKROKONTROLER //Simplest universal VGA(20x20)/PAL(38x20) terminal //For sync used Timer0 Timer1 //To avoid flickering while receive UART data,recommend
More informationUNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz V
Department of Electrical and Computing Engineering UNIVERSITY OF CONNECTICUT ECE 3411 Microprocessor Application Lab: Fall 2015 Quiz V There are 3 questions in this quiz. There are 10 pages in this quiz
More informationMarten van Dijk Department of Electrical & Computer Engineering University of Connecticut
ECE3411 Fall 2016 Wrap Up Review Session Marten van Dijk Department of Electrical & Computer Engineering University of Connecticut Email: marten.van_dijk@uconn.edu Slides are copied from Lecture 7b, ECE3411
More informationProcessor and compiler dependent
Fundamental concept in computation Interrupt execution of a program to handle an event Don t have to rely on program relinquishing control Can code program without worrying about others Issues What can
More informationCSE 466 Exam 1 Winter, 2010
This take-home exam has 100 points and is due at the beginning of class on Friday, Feb. 13. (!!!) Please submit printed output if possible. Otherwise, write legibly. Both the Word document and the PDF
More informationThe 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 informationMarten van Dijk, Syed Kamran Haider
ECE3411 Fall 2015 Wrap Up Review Session Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: vandijk, syed.haider@engr.uconn.edu Pulse Width
More informationOrangutan X2 Command Documentation v1.01
Orangutan X2 Command Documentation v1.01 Page 1 of 27 1. Overview.................................................... 3 2. ATmega644 SPI Configuration........................................ 4 3. Low-Level
More informationADSmartIO Driver Specification for Windows CE
Version: 1.0 ADS document #110110-4004A Last Saved: 12/21/00 2:51 PM Applied Data Systems Inc. 9140 Guilford Road, Columbia, MD 21046 301-490-4007 Driver Change Log Version Release # Date By Changes Draft
More informationIntroduction to Embedded Systems
Introduction to Embedded Systems UsingANSICand the Arduino Development Environment David J. Russell University of NebraskaLincoln SYNTHESIS LECTURES ONDIGITAL CIRCUITSAND SYSTEMS #30 xi Preface Introduction
More informationUse a semaphore to avoid the enqueue and dequeue functions from accessing and modifying count variable at the same time.
Goal: In this project you will create an OS-driven multitasking device than can capture data at precise intervals, buffer the data to EEPROM, and send data over a serial interface to a computer, while
More informationIntroduction 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 informationLab 5: LCD and A/D: Digital Voltmeter
Page 1/5 OBJECTIVES Learn how to use C (as an alternative to Assembly) in your programs. Learn how to control and interface an LCD panel to a microprocessor. Learn how to use analog-to-digital conversion
More informationBachelor of Engineering in Computer and Electronic Engineering
Bachelor of Engineering in Computer and Electronic Engineering Computer Engineering 1 Year 2 Semester 3 Autumn 08 Niall O Keeffe Instructions to Candidates: - 2 hours duration Answer 4 out of 6 questions.
More informationAVR094: Replacing ATmega8 by ATmega88. 8-bit Microcontrollers. Application Note. Features. Introduction
AVR094: Replacing by 8 Features Interrupt Vectors Bit and Register s and locations Oscillators and Start up Delay Brown Out Detection USART Control Register access Internal Voltage Reference Programming
More informationLab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System
Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System Ahmed Okasha okasha1st@gmail.com
More informationSoftware 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 informationirobot Command Module Owners manual
irobot Command Module Owners manual www.irobot.com Important Safety Instructions GENERAL SAFETY INSTRUCTIONS Read all safety and operating instructions before operating irobot Command Module. Retain the
More information,$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 informationRC CAR. Shahadat Hussain Parvez. Jubair Hossain. Tahmid Hassan Talukdar. 12-Apr-12
2012 RC CAR Shahadat Hussain Parvez Jubair Hossain Tahmid Hassan Talukdar 12-Apr-12 Acknowledgement We are very happy that we have completed our first project on micro controller. This is our best chance
More informationAVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help
AVR Intermediate Development Board Product Manual Contents 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help 1. Overview 2. Features The board is built on a high quality FR-4(1.6
More informationMicroToys 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// 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 information6.1. EE 109 Unit 6. LCD Interfacing
6.1 EE 109 Unit 6 LCD Interfacing LCD BOARD 6.2 6.3 The EE 109 LCD Shield The LCD shield is a 16 character by 2 row LCD that mounts on top of the Arduino Uno. The shield also contains five buttons that
More informationEE 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 informationCOMP2121 Experiment 4
COMP2121 Experiment 4 1. Objectives In this lab, you will learn AVR programming on Parallel input/output; Some typical input/output devices; and Interrupts 2. Preparation Before coming to the laboratory,
More informationHome Alarm System. Digitala projekt (EITF40)
Home Alarm System Digitala projekt (EITF40) Supervisor: Bertil Lindvall Written by: Christer Andersson (dt07ca5) Alexander Nässlander (dt09an2) 3/5/2013 Abstract In this report we will show our project
More informationModule 2: Introduction to AVR ATmega 32 Architecture
Module 2: Introduction to AVR ATmega 32 Architecture Definition of computer architecture processor operation CISC vs RISC von Neumann vs Harvard architecture AVR introduction AVR architecture Architecture
More informationPhotoresistor, Transistor, and LED s
PH-1 Photoresistor, Transistor, and LD s Purpose: To introduce photoresistors, LD s, FT s, and transistors used as power switching devices To become familiar with the capability of the Atmega 128 to measure
More informationEE 308: Microcontrollers
EE 308: Microcontrollers Timers Aly El-Osery Electrical Engineering Department New Mexico Institute of Mining and Technology Socorro, New Mexico, USA April 2, 2018 Aly El-Osery (NMT) EE 308: Microcontrollers
More informationAmarjeet Singh. January 30, 2012
Amarjeet Singh January 30, 2012 Website updated - https://sites.google.com/a/iiitd.ac.in/emsys2012/ Lecture slides, audio from last class Assignment-2 How many of you have already finished it? Final deadline
More informationReview on Lecture-1. ICT 6641: Advanced Embedded System. Lecture 2 Branch, Call and Delay Loops, AVR I/O port programming
ICT 6641: Advanced Embedded System Lecture 2 Branch, Call and Delay Loops, AVR I/O port programming Prof. S. M. Lutful Kabir Session: April, 2011 Review on Lecture-1 Three parts of a computer : CPU, Memory
More informationLecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad
Lecture 14 AUTOMATIC CONTROL SYSTEMS Ali Karimpour Associate Professor Ferdowsi University of Mashhad Lecture 4 The AVR Microcontroller Introduction to AVR CISC (Complex Instruction Set Computer) Put as
More informationPIC Microcontroller Introduction
PIC Microcontroller Introduction The real name of this microcontroller is PICmicro (Peripheral Interface Controller), but it is better known as PIC. Its first ancestor was designed in 1975 by General Instruments.
More informationUNIVERSITY OF BOLTON SCHOOL OF ENGINEERING B.ENG (HONS) ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATION SEMESTER /2016
UNIVERSITY OF BOLTON TW59 SCHOOL OF ENGINEERING B.ENG (HONS) ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATION SEMESTER 1-2015/2016 INTERMEDIATE EMBEDDED SYSTEMS MODULE NO: EEE5004 Date: Thursday 14 January
More informationFinal 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 informationAN703. 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 informationUNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017
TW30 UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017 MICROPROCESSOR BASED SYSTEMS MODULE NO: EEM7016 Date: Wednesday 17 May
More informationonetesla Interrupter Firmware Guide General Overview
onetesla Interrupter Firmware Guide Contents: General overview (page 1) Code Walkthrough (page 2) How to program the interrupter (page 15) Compiling the code (page 16) The onetesla MIDI controller is based
More information