This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interrupts for 5438



So perhaps this will only display my lack of understanding, but should it be possible to modify a header file so that interrupts can be generated by ports that do not have a default interrupt scheme (i.e. P10), or does the hardware prevent this?

--Alex--

  • The header files are only there to tell the compiler which interrupts are available on a specific device. They do not DEFINE interrupts, they only DECLARE them.
    Only Port 1+2 have the hardware circuitry to generate an interrupt request when a signal edge is detected on a port pin.

    The compiler requires the declarations so it knows where to put the code that shall react on a specific hardware interrupt. Basically, each existing hardware interrupt has two bytes at the end of the 64k address range which describe where the handler is. The compiler needs to know where to put the address of an interrupt handler. That's the job of the header files. Nothing less but also nothing more.

    In other words: header files can as well add interrupt funcitonality to other ports as they can add more ports to your MSP. Or more ram.

  • However, you can write software that scans the other ports in a regular interval, based on a timer interrupt, and do appropriate action if a signal level change is detected. For low-frequency signals and when some latency is okay, this might be a viable solution.

**Attention** This is a public forum