This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51: How Much max count by counter in 1 sec

Hello I use C51 with crystal 11.0592Mhz , my task is i want use timer/counter as event counter and display counter value the maximum count in 1 sec is 2500. is this possible with C51 if yes than please give some idea how it done or if you have sample code than please send me.
Thank you.

Parents
  • i make it zero like

    You answered a different question than you were asked.

    It's not about "making" it zero, it's about what happens if, e.g., the timer rolls from 0x20ff to 0x2100, after you read the low byte, but before you read the high byte. Your code will then believe it 0x21ff.

    It's somewhat unlikely that this causes your problem, though, because the time window for this error is really quite small, so it would not usually be hit every time round.

    Which brings us back to the original problem statement. You said earlier that at 1500 Hz input you got the "wrong" value. But you didn't say what that value actually is, nor which result you think you should have got, or why. What did you get at 1450 Hz, when it still worked?

Reply
  • i make it zero like

    You answered a different question than you were asked.

    It's not about "making" it zero, it's about what happens if, e.g., the timer rolls from 0x20ff to 0x2100, after you read the low byte, but before you read the high byte. Your code will then believe it 0x21ff.

    It's somewhat unlikely that this causes your problem, though, because the time window for this error is really quite small, so it would not usually be hit every time round.

    Which brings us back to the original problem statement. You said earlier that at 1500 Hz input you got the "wrong" value. But you didn't say what that value actually is, nor which result you think you should have got, or why. What did you get at 1450 Hz, when it still worked?

Children