I am working on a project in which I need to implement a Master Device (Pioneer Kit) and a Slave Device (Prototyping Kit) that communicate with each other through I2C. I have designed two different projects named I2C_MASTER1 and I2C_Slave that are attached here inside a zip file called I2C_Comm (1). The functionality that I want to implement is as below:
1. The master sends a character to the slave thorugh I2C.
2. The slave receives the character and does some process on it.
3. The master reads the processed character from a slave and then sends it to PC using UART.
I am not getting the desired results as of now. Anybody working in this direction can guide.
Thanks and Regards
What exactly does not work?
In the master you write -
I2CM_I2CMasterWriteBuf(I2C_SLAVE_ADDR, (uint8 *) i2cMasterWriteBuf,
You have declared the buf to be an array, therefore a pointer, then cast it again to another pointer.
I think you should change write command to -
You do the same thing on the read.
- Master UART is working perfect individually.
- I put CRO on SDA pin, whenever I send a character from PC to PSoC4 through UART, it gives a spike that concludes data transmission is happening from master to slave I suppose.
- I am afraid but I do not have other I2C devices.
A real low cost logic analyzer, works great, very good SW.
I have 2, very useful.