- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I'm using the uart interrupt.
when data is received trough the uart the program jump to perform the interrupt the problem is that the interrupt flag of the uart stays on and so the interrupt is perform again and again and doesn't return? is the responsibility of clearing the interrupt is mine? how do I clear the interrupt ?Enlace copiado
8 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Are we talking SDK or HAL?
HAL: By default, the HAL ISRs should handle all of the IRQ clearing activity. SDK: I'm honestly not sure what is handled and what isn't. I'm sure others will be able to answer this one though. If you're not using Nios II, then the latter case would apply. Also, how do you know that the UART is the cause of your problem? Have you set a breakpoint in your ISR to see if that's where the failure is happening? Cheers, - slacker- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
i'm talking on HAL
and i don't see that it clears the interrupt- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I have set a breakpoint in the interrupt handler and so that it perform the handler routine.
and then goes to check if there are other pending interrupt and return to perform the uart interrupt's handler routine again and again- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Are you using your own interrupt handler or the one from the HAL?
The HAL UART driver clears the interrupt in the function alt_avalon_uart_irq before processing it. But it is possible that if you're single stepping then the hardware will have interrupted again before you have stepped out of the interrupt routine. For example, if transmit interrupts are enabled then it will take a few ms to send the characters which have been queued up, but several tens of seconds for you to step out of the interrupt routine. One thing I notice when stepping through interrupt routines is that the timer interrupt is almost always set (since it takes more than 10ms for me to step a few times). I solve this by stepping out of alt_irq_handler using the step out button rather than one line at a time.- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
thanks wombat
I'm using my own interrupt handler. where can I find the hal's handler ? it is true that I get interrupted by the timer , but the problem is that the uart interrupt doesn't get clear and so it is called again and again- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
ok found the Hal's handler it is in
altera_avalon_uart.c- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
If you're using your own handler then you need to make sure the HALs one doesn't get installed as well. The easiest way to do this is to run your initialisation code from main, but make sure the first thing it does (before touching any registers etc) is to unregister the interrupt handler.
Another way to do it (if you aren't replacing the whole initialisation scheme) would be to copy the UART files into your system library project and edit them there to replace the HAL code with your own.- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
don't call fscanf or fgets from with in the interrupt handler

Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla