Docsity

Homework 1 - Single Chip Microcomputers | ECE 447, Assignments of Electrical and Electronics Engineering

Partial preview of the text

Download Homework 1 - Single Chip Microcomputers | ECE 447 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Homework 1

Source code and THRSim11 makefile due

at the beginning of your

lab section

September 21-23, 2004

Demonstration, using THRSim11 environment

, due

at the beginning of your

lab section

September 28-30, 2004

7 points

Task 1:

Specify a menu system for an arbitrarily selected microcontroller application. Your menu system should

•^

consists of at least

four levels

•^

have a form of an unbalanced tree

-^

have at least

two items in each menu

•^

allow going UP by pressing “*”, and going HOME (to the root node) by pressing “#” Each menu should start from the menu number Each item in the menu should start from two digits

first digit

= menu level

second digit

= position in a given menu

Specify each item of the menu in detail

Meals 0- Menu 0 Lunch^ Beverages 1-^

Sandwiches 1- Menu 2 Meals^ Salads 1-

Hot 1- Menu 3 Beverages^ Cold

Task 2:^ Write a general

program to display arbitrary menu

of this form. General:^ •^

menu system defined using data structures only; program independent of the exact shape and contents of the menu system • source of input and output can be easily changed^ with the minimum change in the contents of the program input:

keyboard, switch button, keypad

output:

monitor, LED 7-segment display, LCD display

-^ program portable among various C environments

Deliverables

1. Electronic version of the detailed chart

describing menu system

2. Full source code of your program 3. THRSim11 makefile 4. Demo of the correctly operating system

Required

Reading

Kernighan, Ritchie,

The C Programming Language

Chapter 1. A Tutorial Introduction Chapter 5. Pointers and Arrays Chapter 7. Input and Output

Recommended

Reading

Kernighan, Ritchie,

The C Programming Language

Chapter 2. Types, Operators, and Expressions Chapter 3. Control Flow Chapter 4. Functions and Program Structures Chapter 6. Structures