EE 308
Homework #13
Due April 21, 1996
- What do you need to write to the BAUD, SCCR1 and SCCR2
registers to set up the SCI for
- 9600 Baud
- Enable the SCI transmitter.
- Enable the SCI receiver.
- one start bit, eight data bits and one stop bit.
- Write a C program which will print the string hello, world on
the PC display. You should set up the SCI as describe in Part 1.
- Write a C program which will read the voltage on one of the A/D
converter pins, and write the value to the PC screen. For example, if the
input voltage is 2.5 V, the output should be something like
Voltage on A/D input 3 is 2.5 V
- Write the master program for Lab 13. Turn in a typed version of
the program. It should
- Set up PIA Ports A and B.
- Set up the SPI to communicate with the RTC and the slave HC11.
- Set up the SCI as described in Part 1 of this homework assignment.
- Set up the A/D converter to convert the input channel you select.
- Set up the time on the RTC, and set up the RTC to generate an interrupt
every second.
- Have an XIRQ interrupt service routine to read the value of the
potentiometer, send the value to the slave over the SCI, and receive the actual
speed from the slave. (With no slave running, it won't receive anything yet.)
- Have a TOI interrupt service routine to display the patterns described in
Section 6 of the Lab.
- Have an IRQ interrupt service routine which will set a global variable to
tell the main program to send the time and motor speed to the PC display.
- In the main program loop, the program should monitor the global variable.
When it is set, it should read the time from the RTC, and write the time, set
point and actual motor speed to the PC display.
Bill Rison,
<rison@ee.nmt.edu >