Using interrupts on MIAC for CAN
Posted: Sun May 02, 2010 5:26 pm
Hi,
I am trying to find examples of using interupts for CAN, but cannot find any.
Obviously anything using MIAC is better based on HW configuration on the MIAC.
I noticed in the MIAC programming guide that only INT is used and is wired to RA4. I cannot however find anything using the interrupt component which allows use of RA4.
If I read the processor manual section, HW interupts seem to be tagged to port B rather than port A, Am I misunderstanding this.
The interput settings in the CAN general module settings talks about using PIN 0 for the interrupt, but not sure if this still applies to MIAC and should be left set to 0 ?
I am not sure if I would need to take car with other interrupts too as I am not 100% sure but is TMR0 using the same pin also...... ?
Is the MIAC designed to use this input, or is this only expected that this would be used by experienced users that are capable or writing their own ISRs ?
Also it looks like INT is the general purpose input and so is triggered for many reasons, so I assume it being triggered would require a check to see that the Rxbuffer had received a new message rather than take this as a new message interrupt ( I think these use 2 other specific interrupt pins, but not sure if these are used at all by MIAC ?
Any assistance / Guidance is much appreciated.
[Of course, I can just poll the Rxbuffer. It just seemed that interrupts designed into the hardware of CAN and PIC for more efficient processor usage. Then again, I am not really that experienced a programmer so I could be talking out of my hat.]
Cheers,
Mark
I am trying to find examples of using interupts for CAN, but cannot find any.
Obviously anything using MIAC is better based on HW configuration on the MIAC.
I noticed in the MIAC programming guide that only INT is used and is wired to RA4. I cannot however find anything using the interrupt component which allows use of RA4.
If I read the processor manual section, HW interupts seem to be tagged to port B rather than port A, Am I misunderstanding this.
The interput settings in the CAN general module settings talks about using PIN 0 for the interrupt, but not sure if this still applies to MIAC and should be left set to 0 ?
I am not sure if I would need to take car with other interrupts too as I am not 100% sure but is TMR0 using the same pin also...... ?
Is the MIAC designed to use this input, or is this only expected that this would be used by experienced users that are capable or writing their own ISRs ?
Also it looks like INT is the general purpose input and so is triggered for many reasons, so I assume it being triggered would require a check to see that the Rxbuffer had received a new message rather than take this as a new message interrupt ( I think these use 2 other specific interrupt pins, but not sure if these are used at all by MIAC ?
Any assistance / Guidance is much appreciated.
[Of course, I can just poll the Rxbuffer. It just seemed that interrupts designed into the hardware of CAN and PIC for more efficient processor usage. Then again, I am not really that experienced a programmer so I could be talking out of my hat.]
Cheers,
Mark