This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to make work usb and pit interrupt

Hello,

i need to have at same time turned on pit interrupt and usb interrupt. When i use only one of it it works good. But when both interrupts are turn on the pit interrupt works good but usb stops during enumeration process. I work with at91sam7x and use atmel's kod for mass storage device.

Thanks in advance

  • In addition to previous thread.
    If usb is working with interrupt, part of program is running in a main infinit loop. When i start pit in interrupt mode, he part of program which is situated in infinit loop is not executeed. It behaves like there were only two interrupt to handle and nothing more. I am a bit confused. i have made many experiments and i can not get any importetconclusions.

  • You might have an error in the interrupt handler, so whenever the ISR ends, a new interrupt is directly trigged again. Then you can have a situation where there are no time left for handling the main loop.

    Another thing - if one ISR blocks the processor for too long times from entering the other ISR, then the USB functionality can fail. The USB subsystem have very specific timing requirements that must be fulfilled.

  • "You might have an error in the interrupt handler, so whenever the ISR ends, a new interrupt is directly trigged again. Then you can have a situation where there are no time left for handling the main loop."

    So what would be the solution? What are your proposition? Is situation where there are no time left for handling the main loop possible?

  • Read the datasheet for the specific interrupt source. It tells you what the ISR needs to do - if it needs to clear any register bits to acknowledge that the interrupt has been handled?

    Is it possible to run out of time for the main loop? Of coruse there is - I wouldn't have written it if it wasn's so. If the peripherial still thinks it needs servicing when the interrupt handler ends, then the processor will once more detect the interrupt source and reenter the interrupt. So depending on processor used, you may get zero or maybe a few clock cycles for the main loop before next interrupt happens.

  • At the end of servis routine in both handlers i set AIC_eoicr but it gives no effect. Also i made an experiment and cleard both handler function (they were empty inside) and it gives no change. Is it possible that pit(system int) and usb (as mass storage divice) int when wokrs simultaneously cause no enter to main loop?