hi all,
want to manage switches (servo controlled) at Arduino.mega
by Arduino.nano over Expander-Board SX1509, because nano has too less pins..
Job of A.nano : to give power for model railway tracks by servo relais and
control tracks power to realize a roadmap to drive several trains.
Additionally it has to read the actual switch-positions to decide wehther
the switch has to move or not..
At least, there should send a state information about if automation is wanted or not..
Job of A.mega : control switches manually and by signal from A.nano.
the sx1509-expander has 3.3V-Level, A.mega awaits 5V-Level at its pins,which
will be programmed as INPUT (-Pullup?).
My question is : must resistances wired between Expander-Board and
A.mega to avoid damage to the expander ?
please excude my bad english, its not my mother tongue
The minimum VIH for a 2560 is specified as 0.2 * VCC + 0.9V. So that would be 1.9V for a processor running on 5V.
The minimum VOH of the SX1509 is specified as VCC - 0.3V. So that would be 3V.
I do not see a problem why you state that it will cause a problem.
I agree on that; why use 3.3V device in a system that is further 5V?
added : on Logic Levels - SparkFun Learn
i found that is no problem with logoc-levels what matched with my experience on my experimental peripherie..
on other site of sparkfun i found the advice, to wire a resistance (1-2 kOhm) between
input io of expander and arduino..so i put 1,5k-resistors in the connetions..
Maybe
However, since the Mega wants a 5V singam and the SX1509 only outputs 3.3V you may have problems. It may work with one set-up and not another. It may work one day and not the next. It may work with the train stopped but not when it is running.
Because the Mega wants 5V and you are giving it 3.3V any little noise on the connections will cause problems.
what is the principle of a (data)-bus) ?
..to connect between several equipment independent of individual purposes !
so i didnt suppose to find problems connecting arduinos, displays and expanders with this bus..
to add for better understanding
a.mega and a.nano are Not connected via I2C , but in different circuits..only GND is common !
a.mega gets switch-status-info Only by the output-pins of expander !
Why is everyone ignoring that the original requirement is nonsensical?
SX1509, or similar like MCP23017, give Nano more pins. So it is incorrect to say that it has "too less pins". The Mega is not required. Without the Mega, the problem disappears.
If more pins are required, add more SX1509 or MCP23017 or PCF8575 connected to the Nano.
testing the high - output of Anano with sx1509 to A.mega results in the fact, that the output
does not reach enough voltage for the HIGH-input of A.mega : only 2,1 V
As i had no level-converter here i tried again with mcp23017 ..
this time it ran with success giving enough voltage for HIGH-value on A.mega with over 4 V ..
may be , there was an error or something missing in wiring the mcp23017 before..
and found, that might be important to set the I2C-adresses of other environment
expressively, i.e. for the lcd-display.. Not automatic searching !
thanks for your help anyways ..good night and nice weekend !