0
46kviews
Write an assembly language to generate square wave of 2 KHz at pin P1. 1 using 8051. Assume 8051 operating frequency 12 MHz.
1 Answer
1
11kviews

(Take the values as given in question and substitute).

Look at the following steps.

  1. T — 1 / 50 Hz = 20 ms, the period of the square wave.

  2. 1/2 of it for the high and low portions of the pulse = 10 ms

  3. 10 ms / 1.085 us = 9216 and 65536 – 9216 = 56320 in decimal, and in hex it is
  4. DCOOH.

  5. TL = 00 and TH = DC (hex)

enter image description here

Please log in to add an answer.