ATMEGA32 MUSIC PLAYER

Similar documents
Digital and Analogue Project Report

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

WEATHER STATION WITH SERIAL COMMUNICATION

DT-ROBOT Line Follower

Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System

Embedded Systems and Software

EMBEDDED HARDWARE DESIGN. Tutorial Interfacing LCD with Microcontroller /I

AVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

Building Interactive Devices and Objects. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz MHCI Lab, LMU München

CONTENTS BIGAVR2 KEY FEATURES 4 CONNECTING THE SYSTEM 5 INTRODUCTION 6

ECE 511 Project Group 11: MP3 Boombox 12/03/2013. Carlos R Araujo Divya Chinthalapuri Leegia S Jacob Brian D Jarvis Shawn Wilkinson

Product Information. Features. Table of Contents EA DIP162 DN3LW EA DIP162 DHNLED EA DIP162 DNLED EA DIP162J DN3LW

Bachelor of Engineering in Computer and Electronic Engineering

CN310 Microprocessor Systems Design

Laboratory 3 Working with the LCD shield and the interrupt system

17. I 2 C communication channel

How to use LCD screen from the application board v2

2-Oct-13. the world s most energy friendly microcontrollers and radios

Programming Microcontroller Assembly and C

TEVATRON TECHNOLOGIES PVT. LTD Embedded! Robotics! IoT! VLSI Design! Projects! Technical Consultancy! Education! STEM! Software!

Robotics Training Module ABLab Solutions

Color 7 click. PID: MIKROE 3062 Weight: 19 g

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Digital I/O Operations

Objectives : 1) To study the typical design of a LCD module 2) To interface the digital display unit through parallel printer port using C# program.

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interfacing External Devices using Embedded C Module No: CS/ES/22

Embedded programming, AVR intro

CSE 466 Exam 1 Winter, 2010

EasyAVR6 Development System

Pridgen Vermeer Robotics Xmega128 Manual

Automation Engineers AB Pvt Ltd, NOIDA Job-Oriented Course on Embedded Microcontrollers & Related Software Stack

INTERFACING 16 2 LCD WITH 8051

LCD. Configuration and Programming

3.3V regulator. JA H-bridge. Doc: page 1 of 7

SPDM Level 2 Smart Electronics Unit, Level 2

Lecture (09) PIC16F84A LCD interface LCD. Dr. Ahmed M. ElShafee

Battleship. Magnus Hultin, Adam Johansson. Supervisor: Bertil Lindvall

MiCOKit-3166 Development Kit Hardware Manual

Various power connectors. 3.3V regulator. 64K Flash (Internal) 2K EEPROM (Internal) 4K SRAM (Internal) JA Mem Adr/ Data. Doc: page 1 of 9

Tic-Tac-Toe Digital and Analogue Projects, LTH

Application Note. Connecting standard LCD modules to. the MB90670/5 series. History 01 th Feb. 97 MM V1.0 started 28 th June 00 TKa V1.

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

UNIT 3 THE 8051-REAL WORLD INTERFACING

DOT MATRIX CHARACTER LCD MODULE USER S MANUAL

Lab 5: LCD and A/D: Digital Voltmeter

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

LCD AND KEYBOARD INTERFACING

NB2DSK01 - TFT LCD Panel (with Touch Screen)

Mercury Baseboard Reference Manual

Serial communications with SPI

Laboratory 1 Introduction to the Arduino boards

Microcontrollers. Outline. Class 1: Serial and Digital I/O. March 7, Quick Tour of the Board. Pins, Ports, and Their Registers

Pridgen Vermeer Robotics ATmega128 Revision 0

Mega128-Net Mega128-Net Mega128 AVR Boot Loader Mega128-Net

Parallel Display Specifications Revision 1.0

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.

ATMega128 Rapid Robot Controller Board [RKI-1148]

LCDs. Embedded Systems Interfacing. 20 September 2011

Robosoft Systems in association with JNCE presents. Swarm Robotics

I Introduction to Real-time Applications By Prawat Nagvajara

EXL x240 Graphic LCD Smart Module 3,8 SHORT FORM TECHNICAL SPECIFICATIONS. Via di Corticella, Bologna, Italy

AVR 40 Pin Rapid Robot controller board

How to Use an Arduino

ADSmartIO Driver Specification for Windows CE

Doc: page 1 of 8

EMBEDDED SYSTEMS COURSE CURRICULUM

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface.

Design of analog acquisition and storage system about airborne flight data recorder

Goal: We want to build an autonomous vehicle (robot)

Locktronics PICmicro getting started guide

Using a Temperature Sensor

Texas Instruments Microcontroller HOW-TO GUIDE Interfacing Keypad with MSP430F5529

LCD board. EB005

EE445L Fall 2012 Quiz 2B Page 1 of 6

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Engineer-to-Engineer Note

LED Matrix Scrolling using ATmega32 microcontroller

Implementation of Temperature Sensor on PICM4520 Microcontroller

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017

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

Lab 5: LCD and A/D: Digital Voltmeter

Tic-Tac-Toe with mtouch. Version 1.0. June Cytron Technologies Sdn. Bhd.

ECE2049-E17 Lecture 6 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

SYSTEM DESIGN SPECIFICATIONS ZIGBEE BASIC SYSTEM

M16C/62 APPLICATION NOTE. Using the Expanded Memory Mode with the M16C/ Abstract. 2.0 Introduction. 3.0 Memory Expansion Mode

Microprocessor Systems

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

8051 Training Kit Lab Book

Design of An Embedded System For Monitoring and Controlling Temperature and Light

Lab 4 LCDs and Accelerometers

AVR- M16 development board Users Manual

12.1. Unit 12. Exceptions & Interrupts

PROGRAMMABLE POWER SUPPLY

Lab Experiment 9: LCD Display

MP3 Boombox ECE 511 PROJECT GROUP 11 12/03/2013 CARLOS R ARAUJO BRIAN D JARVIS SHAWN WILKINSON DIVYA CHINTHALAPURI LEEGIA S JACOB

BSCB-2 BASIC STAMP CARRIER BOARD

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

PIC DESIGN (version 1) 2/11/2009

Transcription:

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 can be controlled with external signals. By pressing a button or making a head movement basic operations over the player can be made. An LCD screen and LEDs indicate the user the reproduction state. MARTA LERGO PERDIGUERO [1]

List of contents 1. Abstract... 3 2. Hardware specification 3 3. Construction.. 4 4. Programming. 4 5. Conclusion and comments.. 6 6. Attachments.7 [2]

1. Abstract The aim of this project is emulating a music player. The player initializes and starts playing the first song. The user can change the track, stop the reproduction or modify the volume (up or down). Some LEDs are used to let the user know that the signal for executing a function was received. Each LED corresponds to a different operation: Red: stop reproduction and go back to the first song. Blue: modify the volume. Yellow: go to the next song. The LCD screen indicates the user the song that is being reproduced or the different operations executed. All the functions can be executed pressing the different buttons. Only the STOP function is activated when the accelerometer reaches a high value. 2. Hardware specification The project is based on several hardware components: Buttons: to receive the signals to run a function that will modify the reproduction. This buttons have a pull-up resistance. LED lights: help the user to know when the signals are received. Dot matrix LCD screen, SHARP LM162: it contains two rows with 16 characters each. It receives character codes (8 bits per character) from the microprocessor, transform each character into a 5x7 dot character matrix and displays the character on the LCD screen. Regulated resistance: used to get the contrast control voltage for the screen. OR gate: activates the external interruption bit when one of the buttons is pressed. ATMega32: low power CMOS 8 bit microcontroller. It has four 8 bits I/O ports, which can be used either as standard digital I/O or as other additional functions. The ones used were the AD converter, the external interruptions and the standard digital pins. To program and test the code on the hardware JTAG interface was used. This allows to connect the hardware to a computer via USB. [3]

Accelerometer, MMA7260QT: measures the acceleration of the device itself and returns an output proportional to it. It allows to select among 4 different sensitivities. It also includes a sleep mode. 3. Construction First of all, the schematics was design. All the peripherals had to be added taking care of the bits used. The ADC (analog-digital converter) can only be connected to the A port. The external interruption should be connected to the pins PD2, PD3 or PB2. Instead of using one interruption per button all of them were joined by or gates and connected to the interruption pin. With this system, every time a button is pressed, the interruption pin is set to 1. When this happens, the microcontroller has to check the source that generated the interruption. The buttons had to be connected to Vcc, so as to have value 1 in the interruption pin when one of them is pressed. For this reason pull-up resistances had to be added. The microcontroller also has the possibility to activate them internally. The JTAG is using the pins C3-C6. So they cannot be used for other intentions. Also, every LED had to be connected to a small resistance and to ground. With this system, they will only be activated when the microcontroller sends a 1. The accelerometer was attached to a hairband, so the movement to activate the STOP function should be done with the head. 4. Programming Some details were taking into consideration, to make the program more efficient: The ADC should not be running permanently, as the other interruptions also should be controlled. Besides, the ADC is very fast and that much speed is not needed. That is why a timer was set. The microcontroller has 3 different ones. The one chosen was timer0, as it is the only one with only 8 bits (no more are needed). The timer was set to generate an interruption every 0.1 seconds more or less. When that happens, the ADC is checked. [4]

The output voltage from the accelerometer is not a really high value, so a small reference voltage for the ADC had to be chosen. ATMega32 has an internal reference voltage of 2.56 V, so this was more convenient than taking Vcc. When the program initializes some messages are displayed. Also after a function is executed. During this time, the interruptions are disabled. This is to avoid incomplete messages on the screen. Find the table with the description of every designed function. void InitINT() void ISR(INT1_vect) void InitADC() unsigned int ReadADC() void init_lcd() void LCD_cmd(unsigned char cmd) void LCD_write(unsigned char data) void clear_display() void Entry_mode_set(unsigned char I_D, unsigned char S) void display_control(unsigned char D, unsigned char C, unsigned char B) void cursor_display_shift(unsigned char S_C, unsigned char R_L) void function_set(unsigned char DL,unsigned char N,unsigned char F) void print_string(char word[]) void print_integer(int number) void inittimer0() void ISR(TIMER0_COMP_vect) ISR(ADC_vect) Initializes the interruptions. External interruption function. In this case it is run when any of the buttons is pressed. Initializes the analog-digital converter (ADC). Starts a conversion. Initializes the LCD screen. Sends a command to the display. Writes a character on the display. Clears display and returns cursor to the home position. Sets cursor move direction and specifies shift of the display. Sets On/Off display, cursor On/Off and blink of cursor position character. Sets cursor-move or display-shift and shift direction. Sets interface data length, number of display lines and character font. Prints a string on the screen. Prints an integer on the screen. Initializes the timer0. Timer0 interruption function. ADC interruption function. It runs when the conversion is finished. [5]

5. Conclusions and comments The project concluded in a music player with several reproduction possibilities. The sensitivity for the changes in reproduction is good. The system detects instantly when buttons are pressed and the movement for the STOP function is easily recognized. Some possibilities for developing more or improving this project would be: -Adding real music tracks. -Complement it with more movement possibilities. -Adding custom characters to the display, for instance music characters. [6]

6. Attachments -Schematics [7]

-Datasheets -ATMega32: www.atmel.com/images/doc2503.pdf -Display: www.home.zcu.cz/~dudacek/manuals/lm.pdf -Accelerometer: http://www.datasheetcatalog.com/datasheets_pdf/m/m/a/7/mma7260q.shtml [8]