Question
Write a code fragment in code warrior for the HCS12 microcontroller that stores the sines of the angles 0 through 10 degrees in one-degree increments
Write a code fragment in code warrior for the HCS12 microcontroller that stores the sines of the angles 0 through 10 degrees in one-degree increments in addresses $5000 through $500A. The sines should be stored as 3-digit integers since the microcontroller cant do floating point arithmetic (i.e., the sine of 5o = 0.087; this should be stored as 087).
Modify your code to do the following:
a) Read a byte from Port H
b) Clear bits 4-7 of the byte read from Port H
c) Use the resulting 4-bit number to pick the corresponding number from the list above and move it to Port B (e.g., if the number at Port H is $5, copy the number in address $5005 to Port B).
d) Repeat steps (a) through (c) forever.
Remember to set up the DDRs for Ports H and B.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started