Interrupts, flags and functions

Hello, I need to know the exact moment when an input is set.

I'm using XC167CI and I have fast interrupts. This way is full, I mean I have used all fast interrupts.

I don't know how I can know when an input por is set and reset.

What can I do? I which file can I paste the code? Maybe in MAIN.C? Maybe in IO.C?

Please, help me.

Parents
  • "Hello, I need to know the exact moment when an input is set."

    To do this you either need to use some means of generating an interrupt based on the input or you need to poll the input very quickly.

    "I'm using XC167CI and I have fast interrupts. This way is full, I mean I have used all fast interrupts."

    If you can guarantee that the signal generating the interrupt will remain active for greater than the latency period you can 'OR' several signals together on one interrupt pin and connect each one to a port pin. In the ISR you then poll each pin to see which one generated the interrupt. Alternatively you might look at using an external interrupt controller IC.

    "What can I do? I which file can I paste the code? Maybe in MAIN.C? Maybe in IO.C?"

    Only you can make that decision.

Reply
  • "Hello, I need to know the exact moment when an input is set."

    To do this you either need to use some means of generating an interrupt based on the input or you need to poll the input very quickly.

    "I'm using XC167CI and I have fast interrupts. This way is full, I mean I have used all fast interrupts."

    If you can guarantee that the signal generating the interrupt will remain active for greater than the latency period you can 'OR' several signals together on one interrupt pin and connect each one to a port pin. In the ISR you then poll each pin to see which one generated the interrupt. Alternatively you might look at using an external interrupt controller IC.

    "What can I do? I which file can I paste the code? Maybe in MAIN.C? Maybe in IO.C?"

    Only you can make that decision.

Children
More questions in this forum