I want to build circut with 8051 micro controller which detects whether Clock signal is available or not ie I want to detect Clock signal is presetnt or not how to or not do this .
What clock signal?
What processor?
Please spend time writing long questions, to avoid that people have to guess what you mean.
Do you mean that you want to verify that an crystal oscillator is working and has stabilized before you switch from an RC oscillator? Or where you thinking about an real-time clock? Or something else?
I want to detect Clock is presetnet by the 8051 micro controller ie it is on .i use crystel for the mhz
Simple. If your processor executes instructions, the clock is present and it is on.
If no instructions are executed, there is no clock present and it is off.
As noted, the processor must have a running oscillator to be able to do anything at all.
It is only with a processor that can boot with an RC oscillator and then switch over to a crystal oscillator where it may be meaningful to figure out if the crystal is working, and if the oscillator is running stable.
However, such a test is not possible with all processors and if possible, the test is very processor-specific.
One processor I used could run from an RC oscillator, while the crystal oscillator could be selected as input source for a timer, allowing the program to verify that the timer did tick with a reasonable speed.
Some other processors have a lock flag that can be checked to see if the oscillator is working and the PLL has managed to lock onto the crystal frequency.
By the way: Exactly _why_ are you asking this question? Do you have a problem, or what are you trying to solve?
Another thing: Where you going for the monthly award for the least meaningful thread subject with the text: "How to implement This"? Exactly who would be able to guess the contents of the thread from this subject?
i explaian agin .I want to detect Clock on moving wheel. how fast it is.
Three posts just to get to the fact that you want to measure the time between pulses. You lost a lot of time by not being explicit in your first post. But you still haven't given all information.
What type of sensor do you have?
How is it connected to the processor?
What is the expected frequency of the pulses? Max pulses / second when the wheel is turning fast, and the longest amount of time between two pulses before you consider the wheel as stopped?
You can use a timer in the processor to count the time between two pulses. Depending on how the signal is connected, the timer can do most of the work itself, or you may have a pin-change interrupt where you start/stop the timer, or you may busy-loop while keeping track of your timer.
There are a lot of sample code available for how to use a timer. And there are many threads about it, if you just use the search feature you can see in the upper right of this web page.