Re: MPLAB Device Blocks for Simulink 2019
Thanks for your feedback.
Please try creating one forum thread per question whenever possible.
Peripheral are handled in background and already benefits from interrupts (I2C, SPI, UART, CN…). Your model-based design might not require interrupts thus.
However, in some specific case, interrupt might be required for example within the interrupt driven I2C sequence. Such « user interrupt » can be defined within the I2C, or SPI block which define the sequence. Subsystem executed will be part of the I2C or SPI interrupt. User responsibility to make is fast.
For change Notification, interrupt is provided as well to be able to react asynchronously to any change on specific a pin (for brushless motor using a hall effect sensor to switch magnetic field steps).
Same for Timers which allows to create an asynchronous task at any given rate.
Note however that it is much better using the multi-rate modeling capability of Simulink. A multitasking scheduler is implemented by default when more than one rate is present. It can be forced to a single tasking scheduler which would provide much more constraints on real-time (require to slice any slower tasks to fit in between higher tasks slots).
Could you post your model for me to check ?