I've interfaced a trackball to a 28 pin PIC18 (PIC18F2525 connected to an ALPS trackball outputting 4 data signals, 2 for each axis). I'd like to tie an interrupt on change for all of these signals so i won't lose any ticks while my uC is outputting stuff to LCD and the like.
The problem is that I can't use the RB<4:7> Interrupt-On-Change functionality because the RB[6:7] pins are used for ICSP. This only leaves INT0-2 for interrupts (not enough, i need interrupt on change of any signal). The way i see it, there are three solutions:
1) Poll, which is what i am doing now. This works, but poses a big limitation on the software because if i don't poll the data signals on time i will miss movement events
2) Have some glue logic do the decoding/counting for me (too expensive and i don't know how to program an FPGA yet)
3) Have an interrupt controller IC between the PIC and trackball, as depicted in the attached picture. On any change of the data signals, the INT0 will go low (or high) and stay that way until ACK is strobed, or some other form of quick acknowledgement. Anyone know of such an IC? Should be really small and simple.
Any other ideas?
The problem is that I can't use the RB<4:7> Interrupt-On-Change functionality because the RB[6:7] pins are used for ICSP. This only leaves INT0-2 for interrupts (not enough, i need interrupt on change of any signal). The way i see it, there are three solutions:
1) Poll, which is what i am doing now. This works, but poses a big limitation on the software because if i don't poll the data signals on time i will miss movement events
2) Have some glue logic do the decoding/counting for me (too expensive and i don't know how to program an FPGA yet)
3) Have an interrupt controller IC between the PIC and trackball, as depicted in the attached picture. On any change of the data signals, the INT0 will go low (or high) and stay that way until ACK is strobed, or some other form of quick acknowledgement. Anyone know of such an IC? Should be really small and simple.
Any other ideas?