dcc-ex / ex-ioexpander Goto Github PK
View Code? Open in Web Editor NEWDigital and Analogue I/O expander using Arduino AVR
License: GNU General Public License v3.0
Digital and Analogue I/O expander using Arduino AVR
License: GNU General Public License v3.0
The device driver should use the non-blocking capabilities of I2CManager.
Need to update the documentation with the refactored pin maps, added PWM support, updated protocol info, and so forth.
No response
When running <D HAL SHOW>
, this should display the version of EX-IOExpander installed on the device.
No response
No response
From @habazut , I need to clean up the device driver compile time warnings when compiling with no EX-IOExpander device being created:
I would like if you would have a look at all the warning messages about unused variables when compiling the parts of the CS that should talk to the expander when having none or so. You can force the compiler to accept that a variable is unused by doing the (void) thing:
void foo(int i) { (void)i; return; }
Need to validate the includes are correct on the servo branch using Arduino IDE due to reported compile errors.
Add support for Nucleo F411RE and use flash to store I2C address like EEPROM
No response
No response
0.0.7/4.2.9pre1
When using LED outputs, they are dim.
Using test mode they are bright, but as outputs from EX-RAIL they are dim.
Configure any EX-RAIL sequence to SET() a Vpin on EX-IOExpander, and the LED will turn on but be dim.
The behaviour is expected, but the LED should be the same brightness as the test sequence.
No response
Mega/Nucleo CS
Nano/Uno EX-IOExpander
This may potentially be due to continuously setting pin mode rather than only setting it once. It also happens with direct connected LEDs and LEDs connected via ULN2003.
<* EX-IOExpander device found, I2C:0x65, Version v0.0.23 *>
<* EX-IOExpander I2C:0x65 Error:5 (I2C bus timeout) >
< I2C clock speed forced to 400000 Hz >
< EX-IOExpander device found, I2C:0x65, Version v0.0.23 *>
<iDCC-EX V-5.0.0 / MEGA / STANDARD_MOTOR_SHIELD G-3bddf4d>
The following post on Discord sparked this idea: https://discord.com/channels/713189617066836079/1083036104598491256/1118566725273788457
No response
No response
4.2.16/0.0.16
WAITFOR() should cause EX-RAIL servo functions to finish before doing the next task in the sequence, but this doesn't work.
Any sequence with WAITFOR() will not wait.
EX-RAIL should wait until the servo movement completes before continuing.
No response
Nucleo F411RE, Nano
No response
BTW... ioexpander uses a construct like
Millis() > last + duration
This will eventually cause a hang... you should use
Millis() - lastmillis > duration
"Always compare durations... not times"
v4.2.9pre1 (CS), v0.0.6 (EX-IO)
Nanos continually marked as offline, reboot does not work with old bootloader, and @momfertje also is seeing Vpin/pin allocations being mismatched.
Uno works exactly as expected.
Nucleo hasn't been properly tested, but at least shows online with correct pins as far as I can see.
Device should be marked online with correct pin allocations, and an activated input should trigger EX-RAIL or depending on how it's configured.
No response
Nano - old and new bootloader
Nucleo F411RE (CS)
No response
Document disabling I2C pullup options
No response
HEAD
The outputs A10 to A15 in Arduino Mega are not Working. The log in the JMRI is:
10:59:06.656: [Q 861] RX: Sensor Reply (Active): Number: 861, State: ACTIVE
10:59:06.660: [Q 860] RX: Sensor Reply (Active): Number: 860, State: ACTIVE
10:59:06.664: [Q 859] RX: Sensor Reply (Active): Number: 859, State: ACTIVE
10:59:06.669: [Q 858] RX: Sensor Reply (Active): Number: 858, State: ACTIVE
10:59:06.673: [Q 857] RX: Sensor Reply (Active): Number: 857, State: ACTIVE
10:59:06.677: [Q 856] RX: Sensor Reply (Active): Number: 856, State: ACTIVE
and the outputs are not active.
In the case of the report, those outputs have to be INACTIVE.
10:59:06.656: [Q 861] RX: Sensor Reply (Active): Number: 861, State: ACTIVE
10:59:06.660: [Q 860] RX: Sensor Reply (Active): Number: 860, State: ACTIVE
10:59:06.664: [Q 859] RX: Sensor Reply (Active): Number: 859, State: ACTIVE
10:59:06.669: [Q 858] RX: Sensor Reply (Active): Number: 858, State: ACTIVE
10:59:06.673: [Q 857] RX: Sensor Reply (Active): Number: 857, State: ACTIVE
10:59:06.677: [Q 856] RX: Sensor Reply (Active): Number: 856, State: ACTIVE
As soon as I connect to them to GND, they has to change to ACTIVE.
No response
EX-IOExpander (Arduino Mega) + Central (Arduino Mega + Motor Shield + Arduino Netwok Shield )
No response
HEAD
The variable is not declared as bool :
#ifdef DIAG
diag = true;
#else
bool diag = false;
#endif
The solution is:
#ifdef DIAG
bool diag = true;
#else
bool diag = false;
#endif
Not compile if you enable the DIAG
compilation variable.
Compile.
No response
EX-IOExpander Arduino Mega
No response
pre1EXIoexpander
Compiling fails with:
Arduino: 1.8.19 (Linux), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
EX-IOExpander:48:1: error: expected ',' or ';' before 'typedef'
typedef struct {
^~~~~~~
EX-IOExpander:52:3: error: 'digitalConfig' does not name a type; did you mean 'digitalPinMap'?
} digitalConfig;
^~~~~~~~~~~~~
digitalPinMap
EX-IOExpander:67:1: error: 'digitalConfig' does not name a type; did you mean 'digitalPinMap'?
digitalConfig digitalPins[NUMBER_OF_DIGITAL_PINS + NUMBER_OF_ANALOGUE_PINS];
^~~~~~~~~~~~~
digitalPinMap
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino: In function 'void loop()':
EX-IOExpander:131:11: error: 'digitalPins' was not declared in this scope
if (digitalPins[dPin].direction == 1) {
^~~~~~~~~~~
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino:131:11: note: suggested alternative: 'digitalPinMap'
if (digitalPins[dPin].direction == 1) {
^~~~~~~~~~~
digitalPinMap
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino: In function 'void receiveEvent(int)':
EX-IOExpander:177:13: error: 'digitalPins' was not declared in this scope
digitalPins[pin].direction = 0;
^~~~~~~~~~~
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino:177:13: note: suggested alternative: 'digitalPinMap'
digitalPins[pin].direction = 0;
^~~~~~~~~~~
digitalPinMap
EX-IOExpander:211:9: error: 'digitalPins' was not declared in this scope
digitalPins[pin].direction = 1; // Must be an input if we got a pullup config
^~~~~~~~~~~
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino:211:9: note: suggested alternative: 'digitalPinMap'
digitalPins[pin].direction = 1; // Must be an input if we got a pullup config
^~~~~~~~~~~
digitalPinMap
EX-IOExpander:244:9: error: 'digitalPins' was not declared in this scope
digitalPins[dPin].direction = 0;
^~~~~~~~~~~
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino:244:9: note: suggested alternative: 'digitalPinMap'
digitalPins[dPin].direction = 0;
^~~~~~~~~~~
digitalPinMap
EX-IOExpander:253:31: error: 'digitalPins' was not declared in this scope
digitalOutBuffer[0] = digitalPins[dPin].state;
^~~~~~~~~~~
/home/ross/Pictures/marklin/electronics/arduino/EX-IOExpander/EX-IOExpander.ino:253:31: note: suggested alternative: 'digitalPinMap'
digitalOutBuffer[0] = digitalPins[dPin].state;
^~~~~~~~~~~
digitalPinMap
exit status 1
expected ',' or ';' before 'typedef'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Needs a ; at line 59 in SupportedDevices.h
Should compile correctly with ; at line 59 in SupportedDevices.h
No response
EX-IOExpander arduino mega 2560
No response
I don't know how reliable I2C bus is on bigger layouts, but I'm afraid not perfect. What about using UART TTL or even better RS485.
No response
No response
EX-CS v4.2.31, EX-IO v0.0.17
Analogue inputs do not trigger/aren't read correctly.
Configure any sequence to trigger something or read an analogue input, and this will not work.
Analogue inputs should be read successfully.
No response
F411RE/Nano
This appears to be an issue with the pin map being transmitted from the EX-IO device to the device driver, meaning that the data is not associated with the correct Vpin.
Being able to connect EX-IOExpander to the CommandStation using wireless would be a great feature, solving I2C bus distance issues on larger layouts.
No response
No response
v4.2.14pre1 (CS) v0.0.13 (EX-IO)
When using the very last Vpin as a digital input pin using IF() in EX-RAIL, when it activates, other digital input pins also activate.
Use IF(815)
in an EX-RAIL sequence, with other Vpins defined with IF()
statements also.
Each digital input should operate independently of one another.
No response
Nucleo F411RE (CS)
Nano (EX-IO)
This seems to occur when using bit shifting techniques in the device driver, whereas using Arduino bitRead() function results in correct operation.
This triggers the bug:
bool value = _digitalInputStates[pinByte] >> (pin - pinByte * 8);
This operates correctly:
bool value = bitRead(_digitalInputStates[pinByte], pin - pinByte * 8);
Add Peter's new fancy logo, tidy up intro page, make software download more visible, other general refinements.
No response
It would be beneficial to make use of EEPROMs where possible and a command via the serial console to configure the device's I2C address.
This means for appropriate platforms with EEPROM support, zero configuration to the software is required, and a device can be configured entirely via the serial console when uploading the sofware.
No response
No response
HEAD
Not declared variables of I2C fro Arduino mega.
Solution: In the file arduino_avr_mega.h, you have to add this definition variables:
#define I2C_SDA 20
#define I2C_SCL 21
Vpin XXX cannot be used as a digital input pin
Declared the VIO pins.
No response
Arduino Mega
No response
0.0.2alpha
When compiling with PlatformIO on an Arduino Uno, it is detected as a Nano.
When compiling and uploading, it should detect an Arduino Uno.
No response
Nucleo STM32 F411RE + Arduino R3 shield (EX-CS)
Arduino Uno (EX-IO)
myHal.cpp:
`#if !defined(IO_NO_HAL)
// Include devices you need.
#include "IODevice.h"
#include "IO_EXIOExpander.h"
//==========================================================================
// The function halSetup() is invoked from CS if it exists within the build.
// The setup calls are included between the open and close braces "{ ... }".
// Comments (lines preceded by "//") are optional.
//==========================================================================
void halSetup() {
EXIOExpander::create(800, 16, 0x65, EXIO_UNO_DIGITAL_PINS, EXIO_UNO_ANALOGUE_PINS);
}
#endif`
v0.0.3 alpha
When issuing serial returns wrong version:
<* EX-IOExpander I2C:x65 Configured on Vpins:800-817 *> **<* EX-IOExpander x65 using driver version IN *>** <* EX-IOExpander x65: Digital Vpins 800-811, Analogue Vpins 812-817 *> <* Arduino Vpins:2-69 *>
issue in Serial Monitor (CS Side)
should display the correct EX_IOexpander version
No response
Mega Clone with DEEK ROBOT Motor Shield Special CS version 4.2.7pre
Nano (old bootloader) 0.0.3 EX_IOepxander
No response
Both digital and analogue reads are done one pin at a time at present, meaning reading all digital pins in particular will take too long to be optimal.
Need to consolidate all digital reads into a single buffer, and same with analogue reads to optimise this.
Pro Mini has been added, need to document this along with the F412ZG when it is done, and enabling the test sequences via myConfig.h needs to be added.
Also need to ensure doco is clear that serial commands are executed directly on the device, not on the CommandStation.
No response
Once the device driver is loaded and EX-IOExpander is configured with the digital and analogue pin counts, trying to use a defined digital pin as an analogue pin should fail (and vice versa). At the moment it will be allowed and may cause unexpected outcomes.
It would be ideal to offload the servo animations from the EX-IOExpander device driver directly into the EX-IOExpander software itself.
No response
No response
Need basic Fritzing diagrams for each supported uC.
0.0.18/4.2.16+
Nucleo F412ZG does not get configured correctly by the device driver.
The F412ZG correctly sends the initialisation command back to the device driver, but an incorrect byte value is received.
Connect F412ZG to the CommandStation via I2C and enable the HAL device.
The F412ZG should be configured and reported online.
No response
Nucleo F411RE (CS)
Nucleo F412ZG (EX-IOExpander)
No response
It would be great to also be able to drive servos and control LED brightness from EX-IOExpander as per the PCA9685, especially if there is a use case for only one or two servos that can't really justify a dedicated PCA9685 board.
None available at present.
No response
It would be good to have a way to disable the I2C pullups on an EX-IOExpander device when using it in an I2C bus with other devices to ensure the resistance doesn't become too low for the bus to work, and increase reliablity.
The only way to do this is to edit the code and execute digitalWrite(A4, LOW)
and digitalWrite(A5,LOW)
after Wire.begin()
on a Nano/Uno for example to turn the pullups off.
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.