Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

RE: [lpc2000] Strange timer problem

2005-03-30 by Mark Crow

When you execute:

      VICVectAddr = 0;
you allow the VIC to post another IRQ interrupt.  This should be the last
operation performed before exiting the IRQ function.

Could you try:

      T0IR = 0x1;
      VICVectAddr = 0;

  -----Original Message-----
  From: peterburdine [mailto:lordofdawn@...]
  Sent: Wednesday, March 30, 2005 11:54 AM
  To: lpc2000@yahoogroups.com
  Subject: [lpc2000] Strange timer problem



  I'm using the Keil's compiler and I'm trying to setup a system clock
  that increments every 5ms.  I am doing this by having a unsigned long
  int that gets incremented on the timer interrupt.  The timer also
  resets when the interrupt occurs.  The problem is this seems to
  somehow corrupt a few registers every once in a while and will
  generally end up in a data abort.  I believe the timer must be the
  cause because if I remove it, I no longer have these problems.

  I'd appreciate any suggestions.

  The applicable code is listed here:

  unsigned long int getTickCounter (void);
  void T0_ISR (void) __arm __fiq;
  unsigned long int tickCount = 0;



        T0MR0 = PCLK/200; // Every 50ms
        T0IR = 0xF;      // Clear Interrupts on MR0
        T0MCR = 0x03;  // Reset and Interrupt on MR0
        VICIntEnable = 1 << 4;
        VICVectAddr3 = (unsigned long)T0_ISR;
        VICVectCntl3 = 0x20 | 4;
        T0TCR = 0x2;      // Reset the timer
        T0TCR = 0x1;      // Start the timer


  void T0_ISR(void) __arm __fiq {
        tickCount++;

        // Clear Interrupts
        VICVectAddr = 0;
        T0IR = 0x1;
  }


  This is a very useful function!
  void DAbt_Handler(void) __arm __irq {
        Uint32 i;
        // Grab the return address (location where mem access failed)
        __asm      {STAV R14, R0, i};
        printf("*****Data abort occured 0x%x *****", i);
        // Now just spin
        while(1);
  }





        Yahoo! Groups Sponsor
              ADVERTISEMENT





----------------------------------------------------------------------------
--
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/lpc2000/

    b.. To unsubscribe from this group, send an email to:
    lpc2000-unsubscribe@yahoogroups.com

    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.