Question: Produce 5 different frequencies using only one timer and output them on different pins of a parallel port. These frequencies ( time intervals ) will

"Produce 5 different frequencies using only one timer and output them on different pins of a parallel port. These frequencies (time intervals) will be 1,1.2,1.4,1.6, and 1.8 times the given frequency. The frequencies will be generated using the timer; they will not be produced using a table, and interrupts will be used for this task. Timer modes 1 or 2 can be used. For this task, choose a base frequency (time interval) which is 20(or 10) times the given frequency (or choose a value greater than 20 for fine-tuning). Create an interrupt for the base frequency (time interval). Based on this time interval, assign a separate counter and threshold value (separate memory addresses for each frequency) for the 5 different frequencies (time intervals) specified in the assignment. These counters will be incremented by the base frequency. When each of these counters reaches a threshold value, the polarity of the port pin (logical 0 or 1) will be changed. Since there are 5 different frequencies, 5 different port pins and 2*5 different memory areas will be used. Thus, with the interrupt from the base frequency, each counter will be incremented, and when the counters reach the specified threshold values, the polarity of the port pins will be changed to achieve the required frequencies. (In this case, the port pin's polarity (1 to 0; 0 to 1) will be changed.) For each frequency, you need to find a separate threshold value considering the base frequency.
a) Draw the flowchart of the algorithm.
c) Write the algorithm in 8051 assembly code." for this question I have a solution that does not use interrupts "MOV TMOD, #01H
HERE: MOV TL0, #42H
MOV TH0, #0FCH
CPL P1.0
ACALL DELAY
MOV TL0, #0CCH
MOV TH0, #0FCH
CPL P1.1
ACALL DELAY
MOV TL0, #32H
MOV TH0, #0FDH
CPL P1.2
ACALL DELAY
MOV TL0, #81H
MOV TH0, #0FDH
CPL P1.3
ACALL DELAY
MOV TL0, #0C0H
MOV TH0, #0FDH
CPL P1.4
ACALL DELAY
SJMP HERE
DELAY: SETB TR0
AGAIN: JNB TF0, AGAIN
CLR TR0
CLR TF0
RET
END" please solve the question for a random hz value and tell what you have chosen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!