|
The first problem that you have described (where 0x0C to 0xFF are not acknowledged) is strange. I am not able to comment on this without having a look at the PSoC1 project.
Regarding the address:
The 7 bit address is the address value without the Read / Write bit. This is the address that you would have set in the I2C user module parameter in the PSoC1 project. When a Master wants to read or write to the I2C slave, it left shifts the 7 bit address by one bit and adds the Read / Write bit. A 0 in the R/W bit means a write operation and a "1" means read operation. So, when Master wants to write to the slave, it will use address 0x08 and to read 0x09.
Now coming to the "w" and "s" commands. The "w" command is a write command where you pass the 7 bit address. The bridge application will left shift the address add the R/W bit and send to the slave. So, when you use 0x04 in the "w" command, the slave will respond. When you use "0x08" in the "w" command, the Master will actuall be sending "0x10" as the address and hence the slave will not respond.
The "s" command is to generate a start condition and hence has to be followed by the 8 bit address. So, if you want to write to the slave, you will use "s 0x08" followed by the data. This is why you see the slave "ACK" the 0x08 address when "s" command is used.
The "r" command is similar to "w" command, where you provide the 7 bit address and hence the "r" command with 0x04 is working fine.
Best Regards,
Ganesh
|