Page 1 of 1

[SOLVED] MD freezes when initializing buttons

Posted: Wed 24. Sep 2014, 19:50
by erikiiofph7
I checked out the latest V2 code for the multidisplay SVN project and (after adjusting the defines) built & flashed it to my MD (which I just finished assembling). But when I start the MD it freezes during button initialization. To be more specific it freezes when running the line

Code: Select all

wire.endTransmission(); 
in function void MultidisplayController::expanderWrite(byte _data) at line 541 in MultidisplayController.cpp, which is called from

Code: Select all

expanderWrite(0b10000011);
in function void MultidisplayController::myconstructor() at line 256 in MultidisplayController.cpp.

At first I thought that the wire.endTransmission() was the problem, but then I noticed that function expanderWrite2 is called at line 240, and that went just fine. Or are expanderWrite and expanderWrite2 communicating with different IC's?

As far as I understand, the expanderWrite function is communicating with MD02 IC6?

But then how come MD02 is involved in initializing the buttons at all? Shouldn't the buttons be connected to MD01 K5 that is connected directly to IO pins on the Arduino?

Feels like I've misunderstood something... :?

EDIT:
I just performed a search in Eclipse, and line 256 seems to be the only line calling the function expanderWrite. And the only line I can find calling for expanderRead is

Code: Select all

buttonCheck_V1(expanderRead());
Does this mean that the button initialization in line 256 is only needed for V1 and not for V2?

Re: MD freezes when initializing buttons

Posted: Tue 30. Sep 2014, 21:43
by erikiiofph7
It turned out to be a communication problem between the Arduino/MD01 and the MD02/MD03.

At first I had a 10m cat5e cable which resulted in this freeze. Then I tested with a 5m cat6 cable, and now it suddenly works!

Conclusion: 10m ethernet cable is to long to use as link between the MD units...

Re: [SOLVED] MD freezes when initializing buttons

Posted: Sat 4. Oct 2014, 22:16
by designer2k2
Hello,

yes a 5m cable works, 10m is quite long and would require some slow down on the communication :!:

to see the limitation you could hook up a oscilloscope and see how "nice" the signal arrives on the MD02

Re: [SOLVED] MD freezes when initializing buttons

Posted: Sun 5. Oct 2014, 21:06
by erikiiofph7
Yeah, well, I don't plan on using a long cable really, it was just that I've set up everything on my desk to have a dry-run testing to get to know the system, and the ethernet cable I took happened to be a 10m cable not thinking about the length.

When the system is installed in my car I expect the cable length to end up to be 2-3 meters.