0

I have 4 rotary encoders connected to an MCP23017 which in turn is connected to interrupt port 0 on the arduino (and to I2C of course). Everything works fine: I get interrupts for all 4 rotary encoders, can read the values for them and even store these values in the EEPROM and load them in setup.

Fritzing schematic of the (initially) working setup

Now, I connect a WS2812 LED to the arduino (with a resistor and a capacitator in front of it). I connect the UNO and the led lights up. I attach the serial console (resetting the UNO) and it stops working (LED does not light up). This could just be simple wiring mistake and is not my real problem.

I remove the LED (and the capacitor) from the board and start everything up again. I can see via the serial console that the UNO works, however it does not receive any interrupts anymore. I exchange the MCP23017 thinking I fried it somehow but that doesn't change anything either...

Is there some sort of state the UNO has I could have affected?

Or could I have fried the interrupt "sub-system" on the UNO (again: all the other stuff still works)?

EDIT: The code is here: https://github.com/qollin/Liting/blob/master/src/Liting.cpp

  • You need to set the CONFIGURATION REGISTER (ADDR 0x05) to control how INTA and INTB react. – Gerben Feb 24 '15 at 20:50
  • I wonder if the LED is a red herring and you just have some iffy code that is being picky about when it works. Could you post your code? – BrettAM Feb 24 '15 at 20:52
  • Just added a link to the main file (it uses quite a lot of libraries, though)... – qollin Feb 24 '15 at 21:09
  • I think I figured out whats wrong: you need to reset the interrupt handling of the MCP in setup() (by reading from both INT pins). Otherwise the MCP may start in a state where it does not generate new interrupts, because it waits for the old ones to be handled... – qollin Feb 25 '15 at 15:57
  • @qollin please post your solution as an answer so others can find it more easily. – sachleen Jul 14 '15 at 16:17
0

I think I figured out whats wrong: you need to reset the interrupt handling of the MCP in setup() (by reading from both INT pins). Otherwise the MCP may start in a state where it does not generate new interrupts, because it waits for the old ones to be handled...

  • I'd just tie nRESET of the MCP' to the nRESET of the Arduino, but your call. – Ignacio Vazquez-Abrams Aug 4 '15 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.