AnsweredAssumed Answered

ADuC7023 : A problem that the reset TIMER2 value is not valid

Question asked by wbp501 on Jan 10, 2018
Latest reply on Mar 9, 2018 by ABuda

Even if TIMER2 is set again after using TIMER2 in periodic mode, its setting may not be valid.
Could you advise on the occurrence condition and how to improve it?


Frequency of occurrence is rare.
It was observed 67 times out of 9,000,000 times.


<SW specification>
1.TIMER 2 setting
    T2LD  : 0x028F (20msec)
    T2CON : 0x00C0 (enable, periodic mode)

2.TIMER1 is used as a fixed period timer of 2msec.
  The following is executed by the timer interruption.
   -T2VAL is read(The remaining time of TIMER 2 is observed)
   -TIMER2 is set again(Specific settings are as follows)
      T2CON  : 0x0040 (TIMER 2 is disabled)
      T2CLRI : 0x55   (Write data is cleared)
      T2LD   : 0x028F (20msec)
      T2CON  : 0x00C0 (TIMER 2 is enabled,  3.2.SW is executed)

About the T2VAL(The remaining time of TIMER2 is observed),
In case of normal operation, this value is 18msec.
In case of abnormal operation, this value is 16msec.
If the value of T2VAL is 16msec, it seems that re-setting of TIMER2 is not valid.
In this case, there is no evidence that the 2msec cycle of TIMER1 was delayed by other processing.