Show Posts
Pages: 1 [2]
16  Using Arduino / Programming Questions / Mega + MCP2515 : Interrupt Issues on: February 04, 2013, 10:35:35 am
Hi all,

I'm trying to interface with an MCP2515 CAN controller ( http://ww1.microchip.com/downloads/en/DeviceDoc/21801G.pdf ) and use the interrupts generated on RX0BF and RX1BF to signal when data is ready to be read out of the buffers.

I've connected the two RXnBF pins to 18 and 19 on the mega, and used the following code during setup to attach to the interrupts:

Code:
  attachInterrupt(5,intReadRX0,FALLING); // Attach interrupt functions
  attachInterrupt(4,intReadRX1,FALLING);

When I monitor the voltage on the relevant pins with a scope/meter, it does drop when the buffer is full however the interrupt functions (intReadRX0 and intReadRX1) never seem to fire. If I attach pins 18 and 19 to another pin and generate an interrupt signal myself (digital write high > low > high) then it does get picked up and the function runs.

Am I missing something obvious? I've tried with and without a pull-up resistor (had a 33k to hand, so went with that), I've tried different interrupt pins on the mega and as I've said, I've tried monitoring the state of the line with extra equipment to make sure the voltage does drop when the buffer is full.
Pages: 1 [2]