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

setting of MR0 value for timer0

Hello,

In timer concept I want to clear a thing to load a value for MR0 for example of 1 seconds.For 1 seconds I used to load a value for MR0 using the following calculation,

F=12Mhz(PCLK)

For calculating time,T=1/F

(i.e.)T=1/(12*10^6)=0.083Usec(for 1 clock cycle)

So using this for 1sec=1hz,the MR0 value I used was 83000.Is it the correct method?

  • Do you really think ^ represents "power"?

    Is that what the language specification suggest?

    If you have 12MHz clock - doesn't that mean it makes 12 million clock ticks in one second? So wouldn't it then be logical to configure that timer to count 12 million ticks?

  • Hello Westermark Sir,

    Ya it represents 10 to the power of 6,which is equivalent to 1MHZ. It doesn't represents the bitwise XOR operation.

    Yes for 12 million ticks,I have moved a value for MR0 using the calculation as below,

    MRO_value=[(PCLK/time req. in Hz)]-1;

    So my PCLK is 12mhz and time required is 1sec=1Hz

    MR0_value=[12000000/1]-1;

    =11,999,999.
    This is the value I used to load in MR0 register.

    Thanks for providing info.