EE 308
Homework #6
Due Feb. 25, 1998
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.
unsigned char array[]={0x00,0x01,0x02,0x03,0x04,0x05,...};
Write a C program which makes Port A and output, and displays alternating 0xaa and 0x55 on Port A forever. Between each display, use a "delay(n)" function to pause for 50 ms.