Trouble sending data over i2c from PSoC 4000s kit to the ezble module

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.
JuRu_3481966
Level 1
Level 1
First like given

This is the code that I have for both the module and the kit. I'm not sure what is going wrong, but my buffers are not being filled on the module side... now, I was able to get the data across but that has since ceased. Any help or suggestion is appreciated!

PSoC 4000s functions:

#define BUFFER_SIZE     0x02

void fillBuffer(int data1, int data2){

     for(uint8 i =  0; i < BUFFER_SIZE; ++i){

        wrData1 = (data1 & 0b1111111100000000) >> 8;

        wrData2 = (data2 & 0b1111111100000000) >> 8;

        if(i < 1){

           data1 = data1 << 8;

           data2 = data2 << 8;

        }

       

    }

}

void write2BLE(uint8 addr, uint8 buffer[]){

    /* clear any previous states */

i2c_I2CMasterClearStatus();

i2c_I2CMasterWriteBuf(addr, (uint8 *) buffer, BUFFER_SIZE, i2c_I2C_MODE_COMPLETE_XFER);

  while(0u == (i2c_I2CMasterStatus() & i2c_I2C_MSTAT_WR_CMPLT)) continue;

}

EZBLE Module function:

void i2cBufferSetup(uint8 dataBuffer1[BUFFER_SIZE], uint8 dataBuffer2[BUFFER_SIZE]){

        i2c_EzI2CSetBuffer1(BUFFER_SIZE, BUFFER_SIZE, dataBuffer1);

        i2c_EzI2CSetBuffer2(BUFFER_SIZE, BUFFER_SIZE, dataBuffer2);

}

0 Likes
1 Solution

If you're using the EZ module from the same kit, you can refer to the code example CE 210709 which has a similar implementation. In case you find any difficulty, do come back.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
5 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi,

Can you please share your project files here?

Also can you please elaborate on your problem?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes
lock attach
Attachments are accessible only for community members.

My problem is that the data I am sending from the kit is not being received by the ble module. Here are my project files.

Thanks again,

Julian

0 Likes

Are you using the EZBLE module available in the 4000S Pioneer kit or a separate EZ BLE module?

Regards

Bragadeesh

Regards,
Bragadeesh
0 Likes

If you're using the EZ module from the same kit, you can refer to the code example CE 210709 which has a similar implementation. In case you find any difficulty, do come back.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

I am using the module onboard the kit.

Thank you,

Julian

0 Likes