pablo palomba

Some problems with TimeBase on AP32

Discussion created by pablo palomba on Sep 24, 2008
Latest reply on Sep 25, 2008 by bigmac
Hello,
       I`m using the 908AP32CFBE, and I am using CW 6.1. with PE.
  I put a bean that interrupts every second and it increase a global variable, then  it compares the global variable with another.
Here is part of the code
 
 void Base_de_tiempo_OnInterrupt(void)
{
  byte AuxPrev,err;
  word SND;
  float frec,per,Vrms,Irms,PF,aux3;
  Nosep Dato;
 
  //WDog1_Clear();
  base++;
 
  if(base==tiempoentremuestras)
  {
       Muestreo_C_fase_Disable();
       Muestreo_S_fase_Disable();
       Base_de_tiempo_Disable();
       tecla=FALSE;
       KBSCR_ACK=1;              //Coloco nuevamente KEYF en 0
       KBSCR_IMASK=0;   //Habilito nuevamente las interrupciones de teclado
       err=LCD_SendBlock("Paso 1",6,&SND);
       while (err!=ERR_OK);
       AD3204_Disable();
       err=LCD_SendBlock("Paso 2",6,&SND);
       while (err!=ERR_OK);
       LCD_SendChar(12);
       Cpu_Delay100US(50);
      /**************************************************
      **              Para Debug                      ***
      **************************************************/
       err=LCD_SendBlock("Interrupcion",12,&SND);
       while (err!=ERR_OK);
       err=TRUE;
        for(;:smileywink:
        {
          if (tecla)
          break;
        }
        tecla=FALSE; 
        KBSCR_ACK=1;              //Coloco nuevamente KEYF en 0
        KBSCR_IMASK=0;   //Habilito nuevamente las interrupciones de teclado
       
           
       /**************************************************
      **                FIN Debug                      ***
      **************************************************/
      
...
     ...
}
 

When the condition is true, (base=tiempoentremuestras) the uC freezes and I have to reset it.
I simulated it, but it worked fine, so I m not sure where could be the problem.

Please, if someone can give me an advice , I will appreciate a lot.

Thanks
BConf

Outcomes