adafruit / Adafruit-MCP23017-Arduino-Library

Arduino Library for Adafruit MCP23017
Other
359 stars 204 forks source link

setupInterrupts issue with 8 MCP23017 #79

Closed AdriGuillaume closed 2 years ago

AdriGuillaume commented 2 years ago

Hello,

I need some help about setupInterrups method.

My HW setup:

Adruino Leonardo 8 x MCP23017 (address : 0x20 to 0x27)

I have a class "Board" where a method BoardInit is defined. This method is call in "setup" function of Arduino frame (in the main.cpp)

in this BoardInit method, i init the MCP23017 with the method "begin_I2C(address of each MCP)" for each MCP. until here, all is fine and no error appear.

but when I try to initialise "setupInterrupts(false,false,HIGH)" for all of my modules, Arduino seems to be stucked on the 7th module. if I comment this ligne, code is runned until the end and it's ok. if I comment all the setupInterrupts ligne except the concerned, it's ok too !

not ok: m_ExpIOModule1.setupInterrupts(false, false, HIGH); m_ExpIOModule2.setupInterrupts(false, false, HIGH); m_ExpIOModule3.setupInterrupts(false, false, HIGH); m_ExpIOModule4.setupInterrupts(false, false, HIGH); m_ExpIOModule5.setupInterrupts(false, false, HIGH); m_ExpIOModule6.setupInterrupts(false, false, HIGH); m_ExpIOModule7.setupInterrupts(false, false, HIGH); m_ExpIOModule8.setupInterrupts(false, false, HIGH);

ok ! :

m_ExpIOModule1.setupInterrupts(false, false, HIGH);
m_ExpIOModule2.setupInterrupts(false, false, HIGH);
m_ExpIOModule3.setupInterrupts(false, false, HIGH); 
m_ExpIOModule4.setupInterrupts(false, false, HIGH); 
m_ExpIOModule5.setupInterrupts(false, false, HIGH);
m_ExpIOModule6.setupInterrupts(false, false, HIGH); 
//m_ExpIOModule7.setupInterrupts(false, false, HIGH);
m_ExpIOModule8.setupInterrupts(false, false, HIGH);

ok ! : //m_ExpIOModule1.setupInterrupts(false, false, HIGH); //m_ExpIOModule2.setupInterrupts(false, false, HIGH); //m_ExpIOModule3.setupInterrupts(false, false, HIGH); //m_ExpIOModule4.setupInterrupts(false, false, HIGH); //m_ExpIOModule5.setupInterrupts(false, false, HIGH); //m_ExpIOModule6.setupInterrupts(false, false, HIGH); m_ExpIOModule7.setupInterrupts(false, false, HIGH); //m_ExpIOModule8.setupInterrupts(false, false, HIGH);

any idea ?

-platformIO

thanks a lot !

AdriGuillaume commented 2 years ago

Finally it's due to an hardware issue