Is it possible to use the analog or digital I/O lines instead of the interrupts for all of the different sensors? I am trying to get a number of shaft encoders and ultrasonic sensors working in the same design. I am currently using EasyC2.0 and I do not see any way to avoid running out of interrupts.
Yes, you can use the Analog or Digital Ports for these sensors. They output a high or a low which can be read from the Analog/Digital Ports. Depending on your application, you may not be able to read from these ports fast enough and may miss some data. Therefore using the Interrupts Ports are best but may not be required depending on your application.
What are interrupts for?
Interrupt processing is an alternative to polling Analog/Digital pins. In polling, you must be reading the input when the event is occurring so that you do not miss that the event occurred. You use interrupts when you do not want to miss data or an event. The interrupt flags the micro-processor that something has happened. In your code, you will write an interrupt routine that should be executed when the interrupt has occurred. The interrupt routine should be as short as possible so that the main routine can continue its execution of code ASAP so that another event is not missed.
What interrupts are available to the user. I recall the some are used to communicate with the master controller like the SPI interrupt. Are there any others I should steer clear of, or can I use all the others available on the pic.
*You have 6 interrupt ports on the Vex Controller and you can use all 6 of these interrupts. Use the aliases.h file for a mapping of these inputs. See the section called ---------- Aliases for INTERRUPTS connectors (inputs) -------------------------