Re: programming i2c device with TINIs400

Ponsard Raphael <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.tini
Message-ID <[email protected]>
thanks for your help... I am new with I2C...

this is my test code :
 I2CPort port = new I2CPort();
 //port.setStretchCycles(I2CPort.STRETCH0);
 port.setClockDelay((byte)2);
 port.slaveAddress = (byte)0x70;  //the SAA 1064 is at 0x70 (write) 0x71
(read) is slave adress ok (see below...)
 while(i<500) {
     System.out.println("i2ctest read V0.1.0 "+i++);         
len=port.read(b,0,1);
     if (len>0) System.out.println("i2c read "+new String(b,0,len));
//tini prints nothing
     try {Thread.sleep(50);}catch(Exception e){}
 }

I get a scope, I do not see any acknoledge from slave...
-----_----------_______-----------_------- ---    SDA

------_--_--_--_--_--_--_--_--_--_-----------   SCL   T#10µs

I will try with another hardware (I have now an I2C eval. board from
Philipps...)

BTW, from i2ctest.java (tini1.12/examples) I think that the choice of
slave adress is erroneous  according comment on previous line ? // Set
I2C slave we want to talk to.  0x90 in this case. //should be 0x48
     port.slaveAddress = (byte)0x48;   //or should be 0x90 ???


Gerry Dubois wrote:
I've just got my I2C running on a similar HW configuration (TINITs400 with
5V I2C bus). This is the code I used (straight from the demo app )
port = new I2CPort();
port.setClockDelay((byte)2);
Works great. I'm controlling PCF8574 8-bit I/O expanders.
Unfortunately with the limited information provided it's impossible to tell
if you have a hardware or software problem. Can you post the pertinent code
fragments?


RP


_______________________________________________
TINI mailing list
TINI-6tN4nzCoH/[email protected]
To UNSUBSCRIBE, edit your profile, or see list archives:
http://lists.dalsemi.com/mailman/listinfo/tini
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.