I/O Expansion Issue?

Expansion modules and attachments
Post Reply
sbidny
Posts: 123
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

I/O Expansion Issue?

Post 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
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: I/O Expansion Issue?

Post by rimai »

Are you closing the i/o channel to ground?
Roberto.
sbidny
Posts: 123
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

Re: I/O Expansion Issue?

Post 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
sbidny
Posts: 123
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

Re: I/O Expansion Issue?

Post 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.
sbidny
Posts: 123
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

Re: I/O Expansion Issue?

Post 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.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: I/O Expansion Issue?

Post by rimai »

Can you send me a photo of the board?
Roberto.
sbidny
Posts: 123
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

Re: I/O Expansion Issue?

Post by sbidny »

Exterior:

Image

Board:

Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: I/O Expansion Issue?

Post by rimai »

Looks like it is configured to be I/O.
Not sure what is going on.
Roberto.
sbidny
Posts: 123
Joined: Mon Sep 17, 2012 12:41 pm
Location: Lincoln Park, Chicago, IL, USA 60614

Re: I/O Expansion Issue?

Post by sbidny »

Any further way to debug, other than hooking it up to the controller?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: I/O Expansion Issue?

Post 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);
}

Roberto.
Post Reply