Perhaps this will help.
Looking at the MMA7455 datasheet the I2C Device address is "$1D"
Also to communicate using I2C with the MMA7455 you need to make sure that MMA7455's CS pin is pulled high.
You should not have to issue a write then a read.
I2CRead does this for you.
With PBP Pro, to issue a PBP I2CRead command here is the syntax:
I2CREAD DataPin, ClockPin, Control,{Address,}[Var{,Var...}]{,Label}
"Control" is the MMA7455 I2C Slave Address "$1D"
"Address" is the MMA7455 Register address you want to read, in this case "$07" for "YOUT8".
"Var" will be a single Byte variable because you are only reading a single byte from the MMA7455.
So something like this.
yout var byte 'Holds the value read from the MMA7455 YOUT8 register
addr var byte 'Holds register address
addr = $07 'Assign $07 to access the MMA7455's YOUT8 register
I2CREAD DPIN1, CPIN1, $1D, addr, [yout]
Bookmarks