Hi Henrik,
Thank you for the subroutine timing analysis. 11us is a pretty good result!
I am now looking at ways to handle the interrupts and still trap subsequent events whilst the first event is being acted upon.
With the PIC16F1783 all pins on all ports can be configured to operate as IOC pins. Individual status flags can be read and cleared individually so my approach will be to jump to the ISR on an interrupt event, check which of the nine lines were affected using IF...ELSEIF...ENDIF statements, increment the appropriate error counter, clear the individual IOC flag and then return to the main program. My concern is the method used within the ISR to determine which line generated the interrupt. Is a 9 option deep IF...ELSEIF...ENDIF faster or slower than a 9 option deep SELECT CASE...END SELECT? Or is there a more elegant way of doing this which would take less time?
Comments and suggestions are, once again, welcomed and appreciated.
Cheers
Barry
VK2XBP
Bookmarks