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

using 89C4051.

Hello,
I have wired up a frequency meter using 89C4051.The signal is connected to P3.4/T0 pin.The circuit runs on 24MHz crystal.Can anyone give me the code of a frequency counter?Thanks in advance...

Parents
  • "will count for every 64k pulses\"

    yes. that's what freq is supposed to do: to be the high word in a multi-byte read consisting of freq:TH1:TL1.

    the isr is the correct isr, even if the rest of the code didn't read TH1:TL1.

    the isr portion of the code has nothing to do with the frequency being too high/low, or T0's maximum clock rate.

    simply put, you didn't understand the code, or your objection to the code. the code may have other problems but the isr you objected to is doing the right thing.

Reply
  • "will count for every 64k pulses\"

    yes. that's what freq is supposed to do: to be the high word in a multi-byte read consisting of freq:TH1:TL1.

    the isr is the correct isr, even if the rest of the code didn't read TH1:TL1.

    the isr portion of the code has nothing to do with the frequency being too high/low, or T0's maximum clock rate.

    simply put, you didn't understand the code, or your objection to the code. the code may have other problems but the isr you objected to is doing the right thing.

Children