Veronica Amigo

problem with general purpose timer

Discussion created by Veronica Amigo on Apr 2, 2007
Latest reply on Apr 2, 2007 by Paul McConkey
Hello, I have a problem with the GPT (general Purpose to timer).
I want to put a timer each 1 mseg and I do this,
 
void GPTimers_inicializa(void)
{
     MCF_GPT_GPTIOS = 0x01;   //Habilita los 4 GPT como output compare
    MCF_GPT_GPTSCR1 = MCF_GPT_GPTSCR1_GPTEN; //habilita cualquier
    MCF_GPT_GPTIE = MCF_GPT_GPTIE_CI(0x01);  //habilita la interrupcion del GPT0
    MCF_GPT_GPTSCR2 =MCF_GPT_GPTSCR2_PR(0x00); //Prescaler, 30MHz
    MCF_GPT_GPTFLG1 = 0x00; //limpia los chanel flags
    MCF_GPT_GPTFLG2 = 0x00; //limpiar flags
    
   MCF_GPT_GPTC0 = MCF_GPT_GPTC0_CCNT(0x7530);
   MCF_GPT_GPTC1 = 0;
   MCF_GPT_GPTC2 = 0;
   MCF_GPT_GPTC3 = 0;
    
    
   MCF_INTC0_ICR44 = MCF_INTC_ICR_IL(0x7) | MCF_INTC_ICR_IP(0x7); //GPT0
  MCF_INTC0_IMRH &= ~MCF_INTC_IMRH_MASK44;
}

int main()
{
  Leds_Init();
 GPTimers_inicializa();
 
 while(1); // Idle
 
 return 0;
}
 
and also initialize the interrupt vectors. That I am making bad? or, that I need to do? Thanks

Outcomes