Page 1 of 1
I/O Expansion Issue?
Posted: Mon Mar 26, 2018 7:41 am
by sbidny
Hello,
I have an I/O expansion that I can't seem to get working as expected. The chip is the 328P, which, I believe, indicates this is a v1.0 module, correct?
When I load up the I/O expansion example code and hook up a float switch to one of the inputs, I don't seem to see any change to the status of the input represented on the display. They all continue to show green. I have also tried multiple float switches, so I don't believe they are the issue.
If I disconnect the module, all of the inputs turn red, so I assume it's recognizing the module itself.
I am happy to debug further if someone is able to provide some next steps.
Thanks,
-Steve
Re: I/O Expansion Issue?
Posted: Mon Mar 26, 2018 3:06 pm
by rimai
Are you closing the i/o channel to ground?
Re: I/O Expansion Issue?
Posted: Mon Apr 02, 2018 2:25 pm
by sbidny
I have one side of the switch in I/O port 0 and the the other side connected to ground, so yes, it should close to ground. I have also tried just jumping between the I/O port and ground, and I still see no indication of it working.
With the I/O expansion connected and no switches attached, should all the inputs on the display show green in the example code? I would think they'd turn green only when a switch is activated.
Thanks,
-Steve
Re: I/O Expansion Issue?
Posted: Mon Apr 09, 2018 11:23 am
by sbidny
Anyone have any thoughts?
I picked this expansion module up from another reefer, but it's the old style (v1.0) and has no exterior labels.
Looking at the "documentation" for the I/O expansion on the website, it shows that it now has a DC connector input. However, this older style module only has a USB connector.
Opening it up, I see that it has the 328P chip, which I assumed meant that it's an I/O expansion. And the inputs in the example code turn green when I plug the module in, reinforcing this.
Is there any chance that this is a dimming expansion and not an I/O expansion? They look very similar from the outside.
Re: I/O Expansion Issue?
Posted: Sun Sep 23, 2018 10:07 pm
by sbidny
Is anyone able to help out here? What additional debugging can I do? Can anyone point me to another thread, for example? I really need this module working in order to move my project forward. Thanks.
Re: I/O Expansion Issue?
Posted: Sun Sep 23, 2018 11:24 pm
by rimai
Can you send me a photo of the board?
Re: I/O Expansion Issue?
Posted: Tue Sep 25, 2018 12:39 pm
by sbidny
Exterior:
Board:
Re: I/O Expansion Issue?
Posted: Tue Sep 25, 2018 1:41 pm
by rimai
Looks like it is configured to be I/O.
Not sure what is going on.
Re: I/O Expansion Issue?
Posted: Tue Sep 25, 2018 1:47 pm
by sbidny
Any further way to debug, other than hooking it up to the controller?
Re: I/O Expansion Issue?
Posted: Tue Sep 25, 2018 2:31 pm
by rimai
If you want, you can debug just the module using Arduino, since this old module has a built-in mcu in it.
The original firmware is:
Code: Select all
#include <Wire.h>
#include <avr/wdt.h>
byte IOports[] ={
3,5,6,9,10,11};
byte IOOut=0;
void setup()
{
wdt_enable(WDTO_1S);
Wire.onReceive(NULL);
Wire.onRequest(requestEvent);
Wire.begin(9);
for (int a=0;a<6;a++)
{
pinMode(IOports[a],INPUT);
digitalWrite(IOports[a],HIGH); //pull up resistor
}
}
void loop()
{
wdt_reset();
}
void requestEvent() {
IOOut=0;
for (int a=0;a<6;a++)
{
IOOut+=digitalRead(IOports[a])<<a; //pull up resistor
}
Wire.write(IOOut);
}