Can't write more than two bytes to I2C..?

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.
Anonymous
Not applicable

I'm trying to send 3 bytes of data to a DAC, MAX5217, trough I2C. But I can't seem so send more than 2 bytes before the communication stops.

   

I'm doing:
            temp = I2CM_I2CMasterWriteBuf(I2C_SLAVE_ADDRESS, (uint8 *) sample,
                                        WR_BUFFER_SIZE , I2CM_I2C_MODE_COMPLETE_XFER);

   

With WR_BUFFER_SIZE set to 3,  but I only see the address + the first 2 bytes of my data with an oscilloscope. Setting the WR_BUFFER_SIZE to 1, sends 1 byte, anything above 1 sends 2 bytes.

   

Any ideas?

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is an example project that should help you understand the I2C process. It also contains a PDF on the I2C example.

0 Likes