CSE466 Assignment 1: Due Monday 4/3
A. Assuming that the main oscillator on an 89C55 is running at 1MHz, what timer-0 reload value should be used to generate an interrupt every 2ms in auto-reload mode (see AT89 series hardware description document)? Show your work
B. Write an 8051 interrupt routine in assembly that generates a PWM signal on P1.1. The period of the signal should be 512ms, and the duty cycle should be variable between 0% and 100% in 2ms increments. You can assume that there is a data byte in directly addressable RAM called THI that controls the duty cycle. Can you fit this routine into 8bytes of program memory? why do we care? (This is basically the FanPWM task from lecture).
C. Write the 8051 assembly start-up code required to configure timer-0 accordingly, then run the temp control algorithm (except you don't need to check for fan speed). Make sure to protect against over and under-flow.
D. Combine A and B into a complete A51 (8051 Assembler) source file that looks something like this:
Absolute Code Segment:
at reset vector: jump to main
Absolute Code Segment
at timer-0 interrupt vector: PWM routine
Relocatable Code Segment
main: setup timer and interrupt hardware
initialize THI to 50%
loop forever
note that "reset vector" and "timer-0 interrupt vector" are specific addresses in memory
Remember, you will be graded on effort from 0 to 3 points, which I may scale later to account for the difficulty of the assignment. I don't require that you simulate and verify your result but it is encouraged. You will lose one point for each late day.