This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530: OVFIF cannot set to 1

Part Number: CC2530

Hi team,

Here's an issue from the customer may need your help:

Issue: the CC2530 timer 1 requires channel 0 to operate in the mold, and with all interrupts off, only CH0IF is set when the count value matches the target value. And the spec shows that OVFIF will also be set to 1. Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hello Cherry,

    The behavior of T1STAT.OVFIF is dependent on the T1CTL Timer 1 operation mode, which is not shared in the code excerpt.  As CH0IF is mentioned it would appear that modulo mode is used, in which case CH0IF is set when the channel 0 interrupt condition occurs.  Timer 1 counter-overflow interrupt flag OVFIF is only set when the counter reaches the terminal count value (0xFFFF) in free running or modulo mode, and when zero is reached counting down in up-and-down mode.  OVFIF is only set in modulo mode if the timer is started with a value above T1CC0, otherwise it will never reach 0xFFFF.  I would recommend enabling interrupts to service these interrupt flags.

    Regards,
    Ryan

  • Is the description of the part circled in red in the picture correct? I think that under the mold, OVFIF will be set to 1 only once, and it will not necessarily appear, but the description in the specification book misleads many people.

  • Thanks! As you said, OVFIF is set to 1 randomly in modulo mode. After setting the value of T1CC0, if the value of T1CC0 is smaller than the counter, when the counter reaches 0XFFFF, OVFIF will be set to 1. At this time, I set OVFIF to 0, and the counter starts counting from 0x0000 again, after which OVFIF will never be set to 1. Is that right?

  • Many Chinese books are written in this way. When the count value reaches the value stored in the T1CC0 register, it overflows, sets T1IF and OVFIF, and then triggers an interrupt. I think it should be described as follows. When the count value reaches the value stored in the T1CC0 register, it overflows, sets T1IF and CH0IF, and then triggers an interrupt. Is this correct?

  • Your understanding is correct.  OVFIF may be set only once during the first iteration of modulo mode based on the current value of the T1CC0 register when the timer is started.  Otherwise, CH0IF should be the only interrupt triggered in T1IF for this mode of operation.

    Regards,
    Ryan

  • Thank you very much.