Problems with PSOC 4 SCB 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

Hi Folks,

   

i have some trouble in getting the PSOC4 working as expected. My target is to read out the data of a Current and voltage sensor (max78630) and for that i am using I2C (SCB I2C Master). The software was working but i do not know what happend, but now my I2C communication seems to not work correct anymore. The crazy thing is that my software do't show any behaviour when i disconnect the I2C sensor, no error. Also what crazy is, the sensor address is 3, but when I scan, the sensor answers at address 15, that doesen't make sense to me, I really appriciate every hint 🙂

   

 

   

best regards,

   

Nils

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

You are missing <stdio.h> in your main.c and also the debug.c this caused a lot of warnings also go to Project tab and select build settings and set the sprint settings.  I don't have the device you are using.  The board compiled with no errors after the stdio fixes.

0 Likes
Anonymous
Not applicable

Hi,

   

thanks for your answer, I changed the things you have mentioned but nothing changed. So I measured the signal an an Arduino (where it was working) and on the PSOC doing the same routine, reading out data from the sensor. An Arduino you can see first writing the slave address (3) and then the register (also 3) an the device ancwers. But on the PSOC the behavior is bit crazy, the sensor does not ack the address of it.

   

 

   

From Arduinio:

   

 

   

From PSOC: 

   

   

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        I guess you have pull up resistors on the I2C signals.   
0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Increase the heap size from 0x080 to 0x800 and see if that helps. It is  in the system part of the .cydwr file.

0 Likes
Anonymous
Not applicable

Yes like it is recommended in the datasheet i have Pull-Ups on SDA and SCL, isn't that normal for I2C?

   

Changed the Heap-size but the software has the same output. 

0 Likes
RiLi_333781
Level 2
Level 2

The waveforms show something wrong for SCL,  it is <1.5V, SDA is > 3.3V, you need fig out what's wrong for hardware.  

0 Likes
RiLi_333781
Level 2
Level 2

Oh, I count wrong, the SCL is worse < 0.4V!

0 Likes

Could it be the probe x10 ?

0 Likes