Loading ...
Sorry, an error occurred while loading the content.

5256Re: [AT91SAM] HELP ME PLS (problems in intrrupt)

Expand Messages
  • ehsan ziyaee
    Jan 15, 2012
      hi Eric ....
      i can run it correctly,yesterday  .... thanks a lot for your attention .....



      From: Eric Pasquier <epasquier@...>
      To: AT91SAM@yahoogroups.com
      Sent: Sunday, January 15, 2012 11:18 AM
      Subject: RE: [AT91SAM] HELP ME PLS (problems in intrrupt)

       
      Hi,
      Did you set the IRQ stack correctly ?
      Eric.
       
      De : AT91SAM@yahoogroups.com [mailto:AT91SAM@yahoogroups.com] De la part de ehsan
      Envoyé : dimanche 15 janvier 2012 08:16
      À : AT91SAM@yahoogroups.com
      Objet : [AT91SAM] HELP ME PLS (problems in intrrupt)
       
       
      hi every one ............
      i have a big promblem in intrrupt ... each intrrupt that i actived it , occured one time .... and for the second time it goes to pendding mode ...... pls help me .............

      void timer0_init (void)
      {
      unsigned int div;
      unsigned int tcclks;
      unsigned int MCLK_F = 48000000;
      unsigned int Disr_F = 1;

      PMC_EnablePeripheral(AT91C_ID_TC0);
      IRQ_ConfigureIT(AT91C_ID_TC0, AT91C_AIC_PRIOR_HIGHEST | AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL, (void (*)(void))ISR_Tc0);
      IRQ_EnableIT(AT91C_ID_TC0);

      TC_FindMckDivisor(Disr_F,MCLK_F, &div, &tcclks);
      TC_Configure(AT91C_BASE_TC0,tcclks| AT91C_TC_CPCTRG);
      AT91C_BASE_TC0->TC_RC = (MCLK_F / div) / Disr_F;
      AT91C_BASE_TC0->TC_IER = AT91C_TC_CPCS;
      TC_Start(AT91C_BASE_TC0);
      }

      void ISR_Tc0 (void)
      {
      unsigned int dummy;
      dummy = AT91C_BASE_TC0->TC_SR;
      dummy = dummy;
      kk++;
      j = ~j;
      if(!j)PIO_Set(&GPIO_porta0);
      else PIO_Clear(&GPIO_porta0);

      AT91C_BASE_AIC->AIC_ICCR = 0x1 << AT91C_ID_TC0;
      AT91C_BASE_AIC->AIC_EOICR = 0;
      }


    • Show all 3 messages in this topic