When it comes to interrupt programming , we have to consider some important registers. For this program the registers used are IE(interrupt enable),TCON(timer control),TMOD(timer mode).
In timer interrupt programming calculating the value to be loaded to the timer is very important.
Here XTAL frequency i have considered is 11.0592 MHz.If you are using different frequencies,the just divide the XTAL/12.Then inverse the obtained answer.This will be the time required to complete one machine cycle.Hence for my 11.059 MHz the time will be 1.085 uS .
Now the time period of the square wave required is 200 uS .Therefore now we have to calculate the no of cycles required to generate 200 uS of delay so that the output switches between 0 and 1 to generate a square wave.
N=200 uS/ 1.085 uS = 184.33179 = 184
Using timer 0 in 8 bit auto reload mode we can generate the given delay. Value to be loaded to the TH0,TH1 can be calculated as follows
Hi guys in this article let’s learn about class.You might be thinking that you use class in every single program but don’t know what is class so let’s start.Hope you’ll enjoy it 🙂 Class is the core of Java.Each every single thing in java is referred as object and class. To understand the concept of […]
Hi, guys:) in this article let’s see how to find the largest and smallest number from an array which is taken as input from the user.T o know more about arrays in java click here. Algorithm: 1)Start 2)Take the input size of an array and elements in an array from the user. 3)Assign the first […]
Read array of 10 integers and displaying them. “Array is the limited storage(as size mentioned) with ordered series or arrangement of same kind of data(int or float or char)” Example :Input is asked as : Enter the Array elements, Enter Values like 00,10,20,30,40,50,60,70,80,90 are stored in particular space of array. Example: – This represents that […]