[SOLVED] MD freezes when initializing buttons

Support in english
Post Reply
erikiiofph7
Posts: 26
Joined: Thu 10. Jul 2014, 20:10
Location: Sweden

[SOLVED] MD freezes when initializing buttons

Post 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?
Last edited by erikiiofph7 on Tue 30. Sep 2014, 21:44, edited 1 time in total.
erikiiofph7
Posts: 26
Joined: Thu 10. Jul 2014, 20:10
Location: Sweden

Re: MD freezes when initializing buttons

Post 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...
User avatar
designer2k2
Administrator
Posts: 721
Joined: Mon 31. May 2010, 20:13
Location: Innsbruck
Contact:

Re: [SOLVED] MD freezes when initializing buttons

Post 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
itsmyfault...
erikiiofph7
Posts: 26
Joined: Thu 10. Jul 2014, 20:10
Location: Sweden

Re: [SOLVED] MD freezes when initializing buttons

Post 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.
Post Reply