EE 308
Homework #5
Due Feb. 23, 2000
For the homework problems which follow assume you have included the file
hc12.h in your C program. Thus, you can refer to PORTB when
you want to access a byte at address 0x0001. Where I ask for "some
code" just write that part of a C program which will do the task. Where I ask
for "a program" write a complete program, include the #include
"hc12.h"
line, the declaration of variables, the
main()
function, etc.
Write some C code which will make bits 3-0 of PORT B input and
bits 7-4 of PORT B output.
Write some C code which will read Port B, and write a 0x55 to
Port A if Bit 2 of Port B is high, and write a 0xaa to Port A if
Bit 2 of Port B is low.
Write a C program which makes Port A an output, and displays alternating 0xaa and 0x55 on Port A forever. Between each display, use a "delay()" function to pause for about 64 ms. Use the timer overflow function of the HC12 to implment the delay.