I2C Master read data

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
CaDu_3933941
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Hi all,

I am working on a device that has two PSoC 5LP MCUs on it. One manages the main controls and the other one manages battery level and input current. 

The control PSoC acts as an I2C master to the battery PSoC. The Master PSoC sends a command (0x01) to which the slave PSoC should respond with the battery level, input current, and motor current.

My problem is whenever the Master requests info from the slave, the data that I see on the master read buffer (Which should be 4 bytes, 3 data bytes and a checksum) the only data displaying on the read buffer is the battery level on all 4 positions of the read buffer.

Would anyone know the cause for this?

I am attaching the projects to this post. The i2c  processes are within the .c files with the i2c on their names.

 

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @CaDu_3933941

Can you please let us know if you are using any of the Cypress Kits or are you using custom boards? If you are using Cypress Kits, can you try connecting the slave device to Bridge Control Panel? Now if you send the master command through the Bridge Control Panel, we can get the slave device's response. This will help in isolating the issue between the master and the slave device. 

Also, can you please try debugging the slave project and confirm if the buffers are copied properly in the i2c_update function? Please let us know your observations.

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
1 Reply
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @CaDu_3933941

Can you please let us know if you are using any of the Cypress Kits or are you using custom boards? If you are using Cypress Kits, can you try connecting the slave device to Bridge Control Panel? Now if you send the master command through the Bridge Control Panel, we can get the slave device's response. This will help in isolating the issue between the master and the slave device. 

Also, can you please try debugging the slave project and confirm if the buffers are copied properly in the i2c_update function? Please let us know your observations.

Thanks and Regards,
Rakshith M B
0 Likes