Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Push Buttons - Embedded System Design - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Embedded System Design which includes Hardware Design, Elevator Controller, Simple Elevator Controller, Try Capturing, Unit Control, Request Resolver, Sequential Program Model, Partial English Description, System Interface etc. Key important points are: Push Buttons, Dragon Board, Corresponding, Released, Using Switches, Same Bits, Level Sensitive Data, Position, Corresponding, Activity Level

Typology: Slides

2012/2013

Uploaded on 03/22/2013

dhritiman
dhritiman 🇮🇳

4.7

(6)

112 documents

1 / 8

Toggle sidebar

Related documents


Partial preview of the text

Download Push Buttons - Embedded System Design - Lecture Slides and more Slides Computer Science in PDF only on Docsity! Using push buttons and switches 1 •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-SW5. Non-blocking •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 Docsity.com Using switches 2 •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); Docsity.com Seven Segment Display 5 •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 s, int b); //display hexadecimal value of i on 7SEG digit b Docsity.com LCD controller 6 E R/W RS DB7–DB0 LCD controller communications bus microcontroller 8 CODES I/D = 1 cursor moves left DL = 1 8-bit I/D = 0 cursor moves right DL = 0 4-bit S = 1 with display shift N = 1 2 rows S/C =1 display shift N = 0 1 row S/C = 0 cursor movement F = 1 5x10 dots R/L = 1 shift to right F = 0 5x7 dots R/L = 0 shift to left RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 Description 0 0 0 0 0 0 0 0 0 1 Clears all display, return cursor home 0 0 0 0 0 0 0 0 1 * Returns cursor home 0 0 0 0 0 0 0 1 I/D S Sets cursor move direction and/or specifies not to shift display 0 0 0 0 0 0 1 D C B ON/OFF of all display(D), cursor ON/OFF (C), and blink position (B) 0 0 0 0 0 1 S/C R/L * * Move cursor and shifts display 0 0 0 0 1 DL N F * * Sets interface data length, number of display lines, and character font 1 0 WRITE DATA Writes Data •Dragon board has Sanyo DM1623 display of 2x16 characters. •See control signals in pg. 33 and table 7.1 in pg 34 Docsity.com Using LCD 7 •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 Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved