A) write an 8051 program that would generate a 12.5khz, 50% duty cycle, square w
ID: 1847411 • Letter: A
Question
A) write an 8051 program that would generate a 12.5khz, 50% duty cycle, square wave at P1.0. Use Timer 0 for delay. Assume 4 MHZ clock. All data must be in hex show every step of calculation.
B) write an 8051 program that would generate a 200khz, 50% duty cycle, square wave at P1.0.Use Timer 0 for the delay. Ignore the overheads cycles due to the instructions in the loop. Assume 12 MHz clock. All data must be hex. show every step of calculation. what would be the correct initial value if the overhead values were considered?
Explanation / Answer
MOV TMOD,#2H
MOV TH0,#-150
AGAIN: SETB P1.0
ACALL DELAY
ACALL DELAY
CLR P1.0
ACALL DELAY
SJMP AGAIN
DELAY:
SETB P1.0
BACK: JNB TF0,BACK
CLR TF0
CLR TR0
RET
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.