Skip to main content
Visitor II
April 3, 2006
Question

St72F324 RTC timebase error

  • April 3, 2006
  • 2 replies
  • 881 views
Posted on April 03, 2006 at 14:49

St72F324 RTC timebase error

    This topic has been closed for replies.

    2 replies

    akelAuthor
    Visitor II
    April 3, 2006
    Posted on April 03, 2006 at 13:35

    Hi Users,

    I use RTC timebase timer interrupt for many events

    and i have 2 problems. I set MCCSR=0x02;

    so I should have interrupt every 2ms by 8MHz clock,

    but i have every 4ms ( in option HS:8-16MHz range and resonator type

    - real I have 8MHz resonator)

    Next problem is that sometimes I have interrupt one after one

    - looks like not interrupt flag cleaning, but on the beginning

    of interrupt routine I clear MCCSR&=0xFE flag OIF.

    I use Cosmic C compiler.

    Thanks for any help

    Andrew

    ST Employee
    April 3, 2006
    Posted on April 03, 2006 at 14:49

    Concerning frequency, look into chapter 10 - Fosc2 means half of the Focs, e.g. crystal frequency.

    try to go to disassembly to see, what is listing of your C code. To clear OIF, it should be enough to write

    MCCSR; // clear OIF flag

    in your C code. Flag is cleared by read access to MCCSR and Cosmis will handle it properly.

    Setler