4-Integrating Peripherals in Embedded Systems (cont.)

Slides:



Advertisements
Similar presentations
Chung-Ta King National Tsing Hua University
Advertisements

kashanu.ac.ir Microprocessors 6-1 I/O Devices Switches, LED, LCD Lec note 6.
Input/Output (I/O) Ports and Interfacing
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
7-1 Keypad Scanning interface Used for interfacing push-button(momentary) switches Used for large number(>8) push-buttons Relies on matrix arrangement.
Digital Outputs 7-Segment Display
Embedded Systems Design 1 Lecture Set B Interfacing the MCS-51 to: –7 and 16 segment displays –a Multiplexed 7-Segment Display –a Keypad –an LCD.
COE4OI5 Engineering Design Chapter 2: UP2/UP3 board.
1 4-Integrating Peripherals in Embedded Systems (cont.)
Input/Output Ports and Interfacing
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
The miniDragon+ Board and CodeWarrior Lecture L2.1.
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Engineering 1040: Mechanisms & Electric Circuits Winter 2015 Interfacing Light-Emitting Diodes (LEDs) & Push Buttons to Microcontrollers.
Parallel Interfacing Chapter 7. Parallel Interfacing Parallel I/O Ports Using Parallel Ports Seven-Segment Displays Keypad Interfacing Liquid Crystal.
Digital Inputs Interfacing Keypad
Input Interface – Microprocessor
Programming Microcontrollers in C Lecture L7.1. C Data Types TypeSizeRange char1 byte-128 – 127 unsigned char1 byte0 – 255 Int2 bytes – unsigned.
Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE /17/2008.
I/O Devices Switches, LED, LCD
Examples Lecture L2.2. // Example 1a: Turn on every other segment on 7-seg display #include /* common defines and macros */ #include /* derivative.
Tutorial 9 Module 8 – 8.1,8.2,8.3. Question 1 Distinguish between vectored and non-vectored interrupts with an example Build a hardware circuit that can.
Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16.
LED AND KEYBOARD INTERFACING PREPARED BY :- PREPARED BY :- RAVAL AKASH ( ) RAVAL AKASH ( ) PATEL HARDIK ( ) PATEL HARDIK.
1 4-Integrating Peripherals in Embedded Systems (cont.)
Circuit diagram for interfacing Common Anode 7-Segment Display.
ENERGY METER TO INDICATE BILLING IN RUPEES FOR LOAD WISE OR DAY WISE
40106B Schmitt Trigger (A way of switch De-Bouncing)
Michael Rahaim, PhD Candidate Multimedia Communications Lab
DE2-115 Control Panel - Part I
CS4101 嵌入式系統概論 General Purpose IO
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
LCD Interfacing using Atmega 32
More on LED’s with Arduino
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
LCD AND KEYBOARD INTERFACING
Input/Output Ports and Interfacing
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
TI ARM I/O Programming Chapter 2
LCD and Keyboard Interfacing
Microcontroller 8951S #interface-2.
SUBMITTED BY EDGEFX TEAM
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
GANDHINAGAR INSTITUTE OF TECHNOLOGY
4-Integrating Peripherals in Embedded Systems
COMP211 Computer Logic Design Introduction to the DE2 Board
4-Integrating Peripherals in Embedded Systems
CS4101 嵌入式系統概論 General Purpose IO
SMART CARD ENABLED EMPLOYEE IDENTIFICATION FOR SECURITY PURPOSE
EET 2261 Unit 11 Controlling LCD and Keypad
Example 10 ASCII String to Binary Conversion
LCD and Keyboard Interfacing
Example 6 Hex Keypad Lecture L3.2.
EET 2261 Unit 11 Controlling LCD and Keypad
Create a paper craft for any object that makes a sound
LCD and Keyboard Interfacing
Example 15 Interrupt-Driven Controller
Microcontrollers and Microprocessors
Example 16 Circular Queue
Example 13 The Serial Peripheral Interface (SPI)
JC Technology Logic Gates.
82C55 Programmable Peripheral Interface
Example 7 Liquid Crystal Display
LCD and Keyboard Interfacing
8051 Micro Controller.
Lab 1. Introduction to the DE2 Board
LCD (LIQUID CRISTAL DISPLAY) SCREENS
Lecture 4. Introduction to the DE2 Board
LCD AND KEYBOARD INTERFACING
Interfacing keyboard with FPGA
Presentation transcript:

4-Integrating Peripherals in Embedded Systems (cont.)

Using push buttons and switches Push buttons SW2 to SW5 on the Dragon Board are connected to bits 3 to 0 of PortH When button is pushed, a corresponding bit of Port H is reset. What activity level? Can be enabled/disabled: SW_enable(); Can be checked with C function calls: SW1_dip(); //returns 8-bit reading of SW1 SW2_down(); // true if SW2 is down SW2_up(); //true if SW2 is up. Use while ((PTH & 0x01)==0) //to check if the SW5 is being pressed { //…SW5 still pressed } //SW5 released

Using switches There are also 8 DIP switches (sliders) on the Dragon board. The rightmost 4 switches share the same bits of portH with push buttons. These switches are intended for use as level-sensitive data inputs to a circuit. When a switch is in the ON position (away from LCD) it provides a 0 bit on corresponding PORT H bit. What activity level? Use: DDRH=0x00; //Port H inputs leds_on(~PTH);

Using Keypad keypad_enable() getkey() wait_keyup() keyscan() The Dragon board has a 4x4 keypad, connected to Port A. Scanning is used to minimize interface bits. See page 29. Use C function call key_scan(). See listing 6.1 Use C function call get_key(). See listing 6.3 To avoid bouncing: keypad_enable() getkey() wait_keyup() keyscan()

Using LEDs The Dragon board provides 8 red LEDs. You can use C function calls to set/reset LEDs led_on(int b); //Sets bit b of PORTB High, or on led_off(int b); //Sets bit b of PORTB Low, or off leds_on(int h); //Sets bits of all 8 leds according to hexadecimal value h

Seven Segment Display The Dragon Board has four 7-segment displays. These displays are arranged with the intent of displaying numbers of medium sizes. Must be enabled/disabled since using same port B of LEDs: seg7_enable(); seg7_disable(); Applying a high logic level to a segment causes it to light up, and applying a low logic level turns it off. seg7_on(int s, int b); //turns on segment s on 7SEG digit b What will be the hexadecimal digit coding (assume 0 segment is least significant)? [9 coded as 0x6F] Use seg7dec(int i, int b); //display hexadecimal value of i on 7SEG digit b

LCD controller Dragon board has Sanyo DM1623 display of 2x16 characters. See control signals in pg. 33 and table 7.1 in pg 34 E R/W RS DB7–DB0 LCD controller communications bus microcontroller 8

Using LCD See figure 4.7(d), pp 96 Void WriteChar (char c) { RS=0 /*indicate control being sent*/ DATA_BUS=0x01;//Clear Display /*toggle LCD Enable, with delay*/ EnableLCD (45); //…other controls /*indicate data being sent */ RS=1; /*send data to LCD */ DATA_BUS=c; }

Using LCD For Dragon12 we may use: char * msg; msg=“Dragon12-Plus”; lcd_init(); //set configurations set_lcd_addr(0x01);//for first line type_lcd(msg); set_lcd_addr(0x45); //for second line