a watch with a hand or a computerized show that can be begun and halted freely for accurate planning.
Timer/Clocks are fringe gadgets that can be utilized to set the stretch between occasions. In installed frameworks plan, the capacity to accurately set the planning between occasions is amazingly normal. Clocks are utilized to in multi-strung working frameworks to decide to what extent an assignment is dynamic before trading to another errand. Clocks can be utilized to beat width tweak a LED to spare force. Clocks can likewise be utilized to decide the examining pace of a simple sign. Practically any installed programming venture will exploit clocks.
What is basic Timer:
A timer/clock is basically a limited state machine that augmentations or decrements a register once per clock cycle. All clocks have a current register that contains the current estimation of the time. Clocks additionally have a RELOAD register. The RELOAD register is utilized to set the period it takes for the clock lapse. Most clocks in an advanced chip will have multiple registers that direct the conduct of the clock, however we can utilize these two registers to analyze how clocks permit us to gauge an exact term of time.
How about we accept that an essential clock decrements the COUNT register once per clock cycle. So as to set a self-assertive timeframe, the software engineer is permitted to set the RELOAD register with a self-assertive worth. The clock will then decrement until the current register rises to zero. So as to decide the measure of time that has gone between the underlying burden and the clock arriving at zero, we have to know the recurrence at which the clock decrements. The recurrence at which the clock decrements is essentially the clock recurrence driving the clock fringe.
For instance, lets state that the clock fringe was running at 50MHz. This implies the clock decrements once every 20nS. On the off chance that the RELOAD register was set to an estimation of 100,000, we can decide the time of the clock to be 20nS • 100,000 = 0.002S or two milliseconds.
Notwithstanding the current and RELOAD register, clocks have a few different attributes to consider. The following is a short rundown of qualities that a clock may have.
A clock can be a check up or tally down clock. A tally down clock includes down from the incentive in the RELOAD register until it arrives at 0. A check up clock will instate current to zero and tally up until the current register arrives at the incentive in the RELOAD register.
Free Running ( Periodic)
A Timer that is free running, or intermittent, will start the tally succession over again once the customized time frame terminates. On account of a check down time, when the current register approaches zero, it will reload the current register with the worth contained in the reload register. This procedure will rehash until the clock is expressly killed by programming.
A one-shot clock will check up/down for a solitary time frame. When the clock lapses, the clock will quit checking and sit tight for programming to re-arm it.
Prescalars go about as a technique to back off how rapidly a clock will augment/decrement the current register. Rather than altering the current register each clock cycle, a prescalar permits you to set the quantity of clock cycles the clock holds up before changing the check register.
Real Time clock
An ongoing clock is a particular clock that is utilized to decide the date and time that an occasion has happened. An application may realize that two occasions are isolated by 5 seconds, yet at what time? Fundamental clocks permit an application to decide the stretch between two occasions, yet that time frame may have no relationship to what exactly time did the occasion occur.
The motivation behind an ongoing clock is to give date and time data to a framework. When the date/time are set in a framework, the continuous clock will keep on running insofar as force is provided. The continuous clock is then used to put a period stamp on significant occasions for later investigation. The continuous clock can likewise be utilized to plan intermittent occasions where the recurrence of the occasion length hours or days.