Take away from this lab:
Remember to add hcs12.h in delay.c (as below)
Remind the hex number for displaying 7segment LED lights.
Experiment and data:
HCS 12 CODE
Fig.1. Part 1 code
HCS 12 CODE
Fig.2. Part 2 code
Conclusion:
This lab report aim was to understand the C programming on D12PU Board. The biggest challenge here is to know the trick to add parentheses to the addresses of the pushbutton, and to calculate the delay time needed for risen alarm in different frequencies. I found myself a hard to figure out the logic error in this lab.
About the code-wise, students need to remind themselves about DDRB/ DDRP = 0Xff for the output at port B/P, DDRH for the input. Moreover, the most important topic in this lab was to understand I/O channels. In short, the lab was successful performed and met all professor’s requirements.