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

Fundamentals of Microcontrollers Exercise: Buttons Box - Prof. V. Giurgiutiu, Study notes of Mechanical Engineering

An exercise from a university course on microcontrollers, focusing on the use of parallel ports, specifically portb and portc, and their differences. The exercise involves using a 4-button 4-led box as a communications link and configuring portc for input and output. The document also includes a program demonstrating the use of port b for output and port c for both input and output.

Typology: Study notes

Pre 2010

Uploaded on 10/01/2009

koofers-user-rmo-1
koofers-user-rmo-1 🇺🇸

10 documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download Fundamentals of Microcontrollers Exercise: Buttons Box - Prof. V. Giurgiutiu and more Study notes Mechanical Engineering in PDF only on Docsity! EMCH 367 Fundamentals of Microcontrollers Exercise BUTTONS BOX EXERCISE BUTTONS BOX GOALS AND OBJECTIVES The goal of this exercise is to review the use of the parallel ports as an input/output (I/O) device. Registers that control the parallel ports will be explored. A 4-button 4-LED box will be used as a communications link. This exercise has the following objectives:  Review the use of parallel ports  Illustrate the use of Port C for input and output  Introduce the concept of shifting register and memory content  Practice the use of the THRSim11 IO box for input and output BASIC CONCEPTS a) Define in your own words ”PARALLEL COMMUNICATION”. 6 point(s) b) For the two parallel ports PORT B and PORT C, what is the difference between them? 6 point(s) c) What are the memory locations that are used by each of them? 6 point(s) PORTB: PORTC: d) What is DDRC? 6 point(s) Explain how it works. 6 point(s) e) If you place $f0 in DDRC at address $1007 and then load $aa into PORTC at address $1003, what will the output of parallel Port C be? Fill the results into the table. 12 point(s) DDRC bits Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value PORTC bits PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 Value Dr. Victor Giurgiutiu Page 1 11/30/2020 EMCH 367 Fundamentals of Microcontrollers Exercise BUTTONS BOX PROGRAM BUTTONS_BX This program demonstrates the use of Port B for output and of Port C for both input and output. Port C is configured to have the pins PC1, PC3, PC5, PC7 for output. This is achieved using the Data Direction Register for port C (DDRC). Since the default setting for Port C is input, the pins that have to be set to output have their image set to 1 in DDRC. In our case, the bits ?, ?, ?, and ? of DDRC are set to 1. Thus, the Port C pins PC1, PC3, PC5, PC7 become output, while pins PC0, PC2, PC4, PC6 remain input. Dr. Victor Giurgiutiu Page 2 11/30/2020
Docsity logo



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