Access over 35 million academic & study documents

5 (TCO 6) Write a C program for the HC12 microcontroller to send th

Content type
User Generated
Rating
Showing Page:
1/2
5. (TCO 6) Write a C program for the HC12 microcontroller
to send the pattern 0x33 to byte-sized Memory Location
\"OUTPUT1\" and then call a delay function. The delay
function should generate a delay of 2 ms. Then, send the
pattern 0xCC to byte-sized memory location \"OUTPUT2\"
and call the 2 ms delay function one more time. Repeat
this operation 10 times, using a for( ) loop. Assume that
the bus clock frequency is 6.25 MHz. Write the delay using
inline assembly language. (Points : 35)
Solution
Ans;
void delay()
{
for(i=0;i<6000;i++)
;
}
int main()
{
int i;
for(i=0;i<8;i++)
{
VAR1=78;

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
5. (TCO 6) Write a C program for the HC12 microcontroller to send the pattern 0x33 to byte -sized Memory Location \"OUTPUT1\" and then call a delay function. The delay function should generate a delay of 2 ms. Then, send the pattern 0xCC to byte-sized memory location \"OUTPUT2\" and call the 2 ms delay function one more time. Repeat this operation 10 times, using a for( ) loop. Assume that the bus clock frequency is 6.25 MHz. Write the delay using inline assembly language. (Points : 35) Solution Ans; void delay() { for(i=0;i ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Awesome! Perfect study aid.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4