Go Down

Topic: Large button/led board. Multiple SCL-SDA connections (Read 857 times) previous topic - next topic

Moris526


Thank you for you time.


Do you know what debouncing is and how it relates to buttons ?

I have a vague idea of what debouncing is. I had that problem with econders. Im not discarding your sugestion.

Is it posibble to have that effect with the only difference of loading more individual boards on the arduino code,

But still having no change in the fisical board? If you think so, I will dive into it.

How long/messy is the wiring between I2C master and LED board.
Leo..
From Arduino Mega 2560 to the boards just SDA, SCL, Ground and Interrupt wires. The arduino is conected via

usb.  The Board is connected by a 5v 10amp power supply, at 6 different points around the edges.

Moris526

Do you know what debouncing is and how it relates to buttons ?

How long/messy is the wiring between I2C master and LED board.
Leo..
Another data is I dont have any capacitor... (dont know if its relevant)

raschemmel

I don't see any schematic so I don't know what a 'button' has to do with this post.
Post a schematic that shows the button and then we can discuss debouncing.
The fact that you are not clear about debouncing and why it is necessary is a red flag
that may indicate it is relevant to your issue. Without seeing the schematic of the
button circuit I can neither confirm or deny that it is.

Moris526

#18
Oct 07, 2020, 08:22 pm Last Edit: Oct 07, 2020, 08:26 pm by Moris526
I don't see any schematic so I don't know what a 'button' has to do with this post.
Post a schematic that shows the button and then we can discuss debouncing.
The fact that you are not clear about debouncing and why it is necessary is a red flag
that may indicate it is relevant to your issue. Without seeing the schematic of the
button circuit I can neither confirm or deny that it is.
Sorry. Not following you. I have 16 buttons on each individual board...

I attached a zip with a video showing the behaviour.

https://www.adafruit.com/product/3954

The boards are connected with SDA, SCL, Ground and Interrupt wires to Arduino Mega 2560


raschemmel

The only way to isolate th problem is disconnect
the I2C boards from the bus ( ten at a time)
until the issue disappears and then you'll have some data to use to determine if it is a timing issue or a pullup resistor issue. If it turns out to be a pullup resistor issue then you'll have to replace all the pullups with a higher value (15k to 20k).
If it is a timing issue then you have to use a
slower bus speed. (I don't know how to change that)
We are assuming you did your due diligence measuring power supply voltage and current.

Paul__B

If it turns out to be a pullup resistor issue then you'll have to replace all the pullups with a higher value (15k to 20k).
Or as I pointed out, simply remove three out of every four pullups.  :smiley-roll:

Much easier and more practical approach.  You only - arguably - need pullups at each end of the bus run.

raschemmel

Quote
Or as I pointed out, simply remove three out of every four pullups.
On second thought, that does make more sense. but before doing that the OP needs to know how many boards he has to take offline to eliminate the issue. This is a QUANTITATIVE ANALYSIS that yields vital information on
how to implement the solution. (3 out of 4 may be right but truthfully , how could you possibly know this is
the right ratio ? There's nothing wrong with pulling an answer out of your arse if it is correct. I do it all the time.
Almost everyone does. It's called a SWAG (Scientific Wild Ass Guess)
I just think it makes more sense to just take 10 or 20 boards offline until it works properly and then start adding
them back until it doesn't until you arrive at the correct number for how many boards work with no modifications. It it turns out to be 3 out of 4 then all the better but the correct procedures is:
1. test
2. collect data
3. propose solution
4. test solution
5. modify solution as needed
6 implement solution

as opposed to :
1. Propose solution
2. Implement solution


Moris526


I run the test.

More than 6 borads makes the issue appear.

But I did not disconnected the boards from the circuit. I just modified the Arduino code to ignore them......make senses?

One more thing.

When you says ¨remove the pullups¨ you mean desoldering them from the board?  I think bit more than i could chew

Paul__B

#23
Oct 08, 2020, 11:43 pm Last Edit: Oct 08, 2020, 11:43 pm by Paul__B
But I did not disconnected the boards from the circuit. I just modified the Arduino code to ignore them......make senses?
It implies your code is the fault.

raschemmel

You need to remove 80% of your pullup resistors
(or maybe try ten first) and rerun your software
test. If the workable number goes up from six
remove another ten and rerun the test. Continue
that until they all work. If removing ten doesn't help then you need to configure them for a slower
transmission speed.
AFAIK

Paul__B

#25
Oct 09, 2020, 01:39 pm Last Edit: Oct 09, 2020, 01:44 pm by Paul__B
But note he said
But I did not disconnected the boards from the circuit. I just modified the Arduino code to ignore them......make senses?
That is telling you it is not a pull-up matter as he has not altered the pullups in any manner!  :smiley-eek:

Just code!

How do you propose that the number of instances of the "Wire" code opened in the sketch could affect pull-up behaviour?  :smiley-roll:

raschemmel

The boards not run in the code will be essentially
"High-Z", so the pullups will be connected at the
Vcc end but the other end will be connected to
collectors of 'dead' transistors not being commanded to turn on and thus NOT completing
a path to GND. Despite that, there is  no question
that those same collectors are connected to SDA and SCL so those pullups are STILL in parallel
with the ones connected to 'live' transistors
executing code, so while they don't pull DOWN
if they're dead, they remain just as in parallel
BETWEEN SDA and Vcc and SCL and Vcc.
Right ?


Paul__B

Any and every I2C board that is not at the moment partaking in a transaction will be "High-Z", and to the best of my knowledge there is no provision in I2C for either simultaneous communication with more than one master and slave, nor is there any "open" or "closed" connection state.

There is a Start condition followed by data transfer and a Stop condition, following which neither master nor slave is in any different condition in terms of the protocol to before the transfer.   :smiley-roll:

raschemmel


Moris526

#29
Oct 09, 2020, 10:31 pm Last Edit: Oct 09, 2020, 10:48 pm by Moris526
Thanks again for your time.

Yes, looks like a code issue.

More data here. 4 Cases

1- Original case.  I sent and received data via serial (button presses and led position and colour) and then parse the data in the loop section (with interrupt pin). Wierd that code is not efficient since it was on Serial Basics posted by Robin..
Behaviour : I reach the speed I need but when press a button it skips steps and lights wrong colours.

2- Original case without Interrupt pin
 Behaviour :  Worse than original

3- Then I try triggering the sequence from the Arduino code without interrup

Behaviour:  Here I have the behaviour I want,  no stoping of the sequence when a button is pressed, nor changing colour, but I can´t make the sequence go as fast as i want. No matter how low I go with the Dealy at the bottom of the code there is a limit to the loop speed....

4- Same as 3 but with interrupt 

Behaviour:  It doesnt messes with the data and reaches any speed, but stops for a few millisecods when I press a button and then contiues. And sometimes after pressing a button slowsdown to the speed limit of case 3.

SCL and SDA Is one way comunication at a time?



   





Go Up