HOMEWORK VI ECE 3710 — Microcomputer Hardware and Software solved

$30.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

Problem 1. You are part of a team implementing a traffic control system and it is your job to write
the code that controls a traffic light. The light is lit according to the following sequence: red
for 20 seconds, green for 30 seconds, and yellow for 5 seconds (then back to red); this pattern
should repeat forever. Assume that the red, green, and yellow lights are connected to PC.0–2,
respectively, and that to turn a light on its pin is asserted high and to turn it off it is set low.
Rather than using an internal oscillator for a timer source, you have decided to connect a chip
that generates a 5 Hz square wave to the external input for timer one/a and use it as the timer
source. Your code must make use of this external timer source. Since only one uC will be
used for the entire system, it will have to be capable of running many task simultaneously;
thus you need to use an interrupt service routine with timer one/a to change the lights so you
don’t block other tasks from executing. Do this in assembly and C.
Problem 2. Let’s say that you have two devices capable of communicating via UART that you need
to connect together but that one of them operates at 28,800 baud and the other operates at
57,600 baud. This is a common problem that can be solved with a serial buffer. A serial buffer
is a device that receives data at a faster rate than it sends it and, to prevent any information
being lost, stores received data in memory until it can be transmitted.
For this problem, you are to write a serial buffer program in C that configures the M3/4 to
receive data at 57,600 baud and transmit it at 28,800 baud, using interrupts. Data should be
buffered (stored) in data space and transmitted in a first in, first out (FIFO) manner. Your
serial buffer implementation needs to be capable of transmitting data at the same time as it
is receiving it (hence the need for interrupts). Prioritise receiving data over sending it. You
may find it useful to employ a circular buffer.
Problem 3. (EXTRA CREDIT) Implement the DuhES encryption routine from http://dominionofawesome.
com/cryptobox/.