Communication between PSOC4 BLE and ADXL345 over 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

Hello everybody,

   

can somebody please help me to resolve my problem? Actually there is no communication between ADXL345 and PSOC4 BLE. I used both I2C Slave Addresses Ox1D and Ox53--> No reaction 

   

In attachment you find my project.

   

regards

   

Ziad

0 Likes
1 Solution
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Did you put pull up resistors on the Data lines? Also to use address 53 you  must ground pin 12 on the chip. Also the pins you selected don't seem like they are correct.  I un-clicked the lock on the pins and regenerated the program an it moved the pins.

View solution in original post

0 Likes
6 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Did you put pull up resistors on the Data lines? Also to use address 53 you  must ground pin 12 on the chip. Also the pins you selected don't seem like they are correct.  I un-clicked the lock on the pins and regenerated the program an it moved the pins.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Line 22

   

  void ADXL345_GetGxyz(float* x, float* y, float* z);

   


is nonsense.

   

You have got multiple identical file names: I2C.c and I2C.h Your sources conflict with the generated files.

   

 

   

Bob

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Thank you Bob, Thank you bobgoar,

   

1. I correct the nonsense to ADXL345_GetGxyz(&x, &y, &z);  and renamed the I2C.h and I2C.c in I2CMaster.h and I2CMaster.c.
2. I change the Pin for SCL and SDA like the program want after unlocked them and rebuild.
Actually the program don´t show any errors but the I2C still don´t work. Any additional suggestions?

   

In attachment you find my actual project.

   

regards

   

Ziad

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Ok. I correct the function I2C_init1 and i have some signal on my Oxilloscope . But on the Bridge control Panel i use following operation: R 53@acc p  the system answer all the time with r 53- FF- p.
@bobgoar: my board have all ready an 10 Kohm Pull down resistor . See: https://learn.adafruit.com/assets/36127

   

regards

   

Ziad

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Sure? You need pull UP resistors 😉

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

There is a misunderstanding about your stopbit and the way I2C works.

   

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

   

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

   


Bob