cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

what is the device address or slave address of kxtj2(accelerometer of psoc4m)?

0 Likes
7 Replies
rola_264706
Honored Contributor II

Address is 0x0F.

0 Likes
rola_264706
Honored Contributor II

Here is more information.

   

0 Likes
Anonymous
Not applicable

A lot many thanks for your help. but i am using KXTJ2,whereas in the above table mentioned it is for KXTJ3.

0 Likes
Anonymous
Not applicable

uint32 SCB_I2CMasterWriteBuf(uint32 slaveAddress, uint8 * wrData, uint32 cnt, uint32 mode);

   

how do we define the value of uint32 mode(parameter i.e transfer mode)?

0 Likes
JoMe_264151
Expert II

Have a look into the datasheet, the valid values are shown there.

   

Writing to slave Count bytes
I2C_MasterWriteBuf(SlaveAddress,DataPtr,Count,I2C_MODE_COMPLETE_XFER);

   

Reading from Slave sending register/command byte first:
I2C_MasterWriteBuf(SlaveAddress,&RegAddress,1,I2C_MODE_NO_STOP);
I2C_MasterReadBuf(SlaveAddress,DataPtr,Count,I2C_MODE_REPEAT_START);

   


Bob

0 Likes
Anonymous
Not applicable

but the data type of mode is uint32..and it is showing error by using the above sent statements.

0 Likes
JoMe_264151
Expert II

but the data type of mode is uint32. Who cares? the conversion will (if needed) be done by the compiler

   

.and it is showing error by using the above sent statements. My magic crystal ball doesn't show any reason, Can you please provide us with your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes