After reading a couple other forums, the MMA7455L slave address of $1D is a 7bit address so you need to left shift $1D 1 bit. This makes the address $3A. ($1D << 1 = $3A).
In an 8bit I2C address the upper 7bits is the device address <7:1> and the LSB <0> is the R/W bit.
So in binary:
$1D = %0001 1101 (7bit address)
$3A = %0011 1010 (7bit address + R/W bit)
The I2CREAD statement should look like this.
addr var byte
yout var byte
addr $07
I2CREAD DPIN1, CPIN1, $3A, addr, [yout]
Hopefully this will work for you.![]()
Bookmarks