Beginner UEXT Questions

Started by dacarys, September 18, 2012, 09:24:05 PM

Previous topic - Next topic

dacarys

I am new to UEXT and I2C.  I have been looking for code that will allow me to interface the MAXI with the MOD-IO device that I have, but so far none of the sample code works.  I have loaded the ArchLinux image and it has a sample on it that should turn on the Relays and then switch them off after a time.  When I run that, I get Error sending data: Connection timed out

I then ran i2cdetect -r 0 and it found no devices. 

Physically, I have the MOD-IO supplied with its own 12v, 500ma power supply.  I have it connected from UEXT out on the main board to the UEXT-Male on the MOD-IO board.  I have nothing else connected.  I did hook up a load yesterday to see if that was the problem, but it had no effect.  I expect to see the LEDs light up for the relays when the command is issued.

Has anyone else had these issues?  Am I doing something wrong in my setup or is there some other thing that I need to do for this to work?

Thanks in advance.

jeroends

Hello,
do you see the yellow led blinking on the MODIO board?
If not, then you problably have no firmware on the MODIO...
Normally the relays of the MODIO can be setted with i2cset -y 0 0x58 0x10 0x0f (turn all outputs on).

davidjf2001

Did you change the solder jumpers on the board?

Kean

Just a note re the jumpers on the Micro:
When cutting the default traces on jumpers SDA_SW & SCL_SW be very careful!

It is easy to also cut through the nearby traces hidden under the solder mask - and then spend ages trying to work out why I2C still doesn't work.

Looking at the Maxi, it doesn't look like this is as tricky.  And I think Tsvetan has indicated the newer boards will come with HW I2C as the default...

Kean

dacarys

@jeroends, there is no yellow blinking light.  Do I need to load firmware?  I didn't get this impression when I purchased the component. 

@davidjf2001 & @Kean,

I have never cut jumpers on a board.  I can't find anything in the documentation that helps me to even see where to cut.  I do now see in the documentation where it says to do this, but can't figure out where or what to cut. 

Can you point me in the right direction?  I will order the new boards when they come out, but for now I need to get this prototype up and running.  I have to interface with the Mod-IO, GSM Modem, SD Card, Thermocouple and possibly RS-485 modules as well.

Since I am new to this, am I making a mistake going with i2c here?  Will all of these devices communicate via SPI?  would that be a better approach?  i2c seemed pretty simple to me, but I don't want to damage the board just trying to get it to work. 

Kean

@dacarys

See section 6.12.1 of the Maxi docs.
The board ships by default set for software I2C, but the Linux driver uses hardware I2C (different IO pins).

The jumpers are near "GPIO_CON" text.  On both jumpers you need to cut the trace connecting the left and centre pair, and then blob solder across the centre and right pair.

Sorry, I haven't used any of those modules - but the above should get I2C working.

Kean

dacarys

I found the jumpers and I think I was able to get them setup correctly.  However, I have to create 10 of these things.  I was hoping that I would be able to use these devices due to the low cost, but now I am not sure it is worth the time.  Without a doubt, due to my inexperience soldering and cutting, I will break at least one of the boards - probably more. 

I think I will go a different route for now and come back to this after my skills improve or a newer version with i2c enabled comes out. 

Thanks for your time and expertise.  I will continue to play around with this on my time, but here on company time I need to focus on getting this product out the door.


jeroends

Quote from: dacarys on September 19, 2012, 04:59:35 PM
@jeroends, there is no yellow blinking light.  Do I need to load firmware?  I didn't get this impression when I purchased the component. 


Then there's no firmware loaded. When the firmware is loaded you'll see a slow blinking yellow led on the board. Without that you can search long and do a lot of soldering ...

davidjf2001

I don't think SPI works at all yet, at least with arch.  I2C has problems too. I can write all I want but cannot read.  You seem to want to interface a lot of things to this new platform.  Perhaps a more mature platform would be better for you.  No doubt over the next few months things will improve, if you can wait.

Kean

Quote from: davidjf2001 on September 22, 2012, 09:11:58 PM
I don't think SPI works at all yet, at least with arch.

Hardware SPI isn't wokring, but I've done software SPI using mmap'd GPIO's and get approx 3MHz throughput.

Quote from: davidjf2001 on September 22, 2012, 09:11:58 PM
I2C has problems too. I can write all I want but cannot read.

Hardware I2C works, but has a problem with doing repeated starts.  Oh and you need to modify the on-board jumpers to SDA_HW/SCL_HW positions.

With a lot of I2C devices you need to write a register number, send a repeated start, and then read data.  If you do a full stop/start then the register number gets reset to 0.  Because of the repeated start issue, on such devices all reads will read register 0.

I've tried some C code using the IOCTL that allows repeated starts (I2C_RDWR) and it doesn't work as expected.  Googling found others reporting the same issue on other hardware.

My solution was if I want register X to read X+1 bytes in one go.  It will return all registers from 0 to X.

Kean

davidjf2001

I suspected I2C repeated start problems, I am trying to read my smb battery (Inspired Energy) which needs repeated starts.