How many interrupts does the Cortex have again?


We have a robot wanting to put on goodly numbers of sensors that require interrupts. In this case, 3 quad encoders, 2 ultrasonic range finders are wanted on this robot.

  1. What is the max number of sensors that require interrupts? I thought it was 4 but I saw a some posts that says 6.

  2. Are the interrupts assigned to specific ports or is it dictated by the first to claim it on the sensor configuration? So in this case, how should the quads and ultrasonics be laid out port-wise?

  3. SensorValue[myquad] woudl be handling the new data coming back so no new thread/task is needed for listening in, right?

  4. Where is the documentation that explains all this? My search skills must be lacking.


There is no max on the number of sensors you can have on your robot. The only limitation is how many ports you have available on your cortex. However, keep in mind that Digital Port 10 cannot be converted into an interrupt. (Documentation link below)

Depends, ROBOTC or easyC? ROBOTC dictates the ultrasonic, but not the quadrature. easyC dictates both. You can see a more detailed explanation for where they go in the help file for each respective program. (Search for “Motor and Sensors” in ROBOTC)

Correct. ROBOTC will handle all of the listening, etc. for all sensors, assuming you’ve properly set the to the right type. You can always manually listen if you set to Digital IN/OUTS where they should be something different.

Documentation about cortex and interrupts. I would recommend using Ctrl+F…

edjubuh is correct, it should theoretically be limited by the number of digital ports, however, there is a conflict between port 4 and port 10 so only one or the other can be used as an interrupt. Here is one ref

here is another

So I would try
1&2 quad encoder
3&4 quad encoder
5&6 quad encdoer
7&8 sonar
11&12 sonar.

If the does not work try this alternative

1&2 quad encoder
5&6 quad encdoer
7&8 quad encoder
9&10 sonar
11&12 sonar.

Thanks guys. This helps a bunch.