In SX Microcontrollers, SX/B Compiler and SX-Key Tool, davehein wrote: Chet, I think the following code should work. I haven't tested it myself, so let me know if there's problems. Dave MEM_OUT: tmpW1 = __WPARAM12 ' copy address I2CSTART SDA tmpB1 = $A0 ' ID with RW bit set to zero for write I2CSEND SDA, tmpB1 ' send slave ID I2CSEND SDA, tmpW1_MSB ' send word address MSB I2CSEND SDA, tmpW1_LSB ' send word address LSB tmpB1 = __PARAM3 ' copy value I2CSEND SDA, tmpB1 ' send data byte I2CSTOP SDA ' finish RETURN MEM_IN: tmpW1 = __WPARAM12 ' copy address I2CSTART SDA tmpB1 = $A0 ' ID with RW bit set to zero for write I2CSEND SDA, tmpB1 ' send slave ID I2CSEND SDA, tmpW1_MSB ' send word address MSB I2CSEND SDA, tmpW1_LSB ' send word address LSB I2CSTART SDA ' restart for read tmpB1 = $A1 ' ID with RW bit set to one for read I2CSEND SDA, tmpB1 ' send slave ID I2CRECV SDA, tmpB1, Nak ' get one byte I2CSTOP SDA RETURN tmpB1 ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=143252#m143284 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)