Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

bojec_3707286
Level 1
Level 1

Hello Friends

i'm trying to use i2c sensor and want to show the sensor value in Serial Monitor in PC

So i try 2 SCB ( UART and I2C)  like the screenshot

pastedImage_0.png

and wrote code like this

#include "project.h"

//#define I2C_SLAVE_ADDR      (0x28u)

int main(void)

{

    CyGlobalIntEnable; /* Enable global interrupts. */

    UART_PC_Start();

    //I2C_Start();

   

    for(;;)

    {

        UART_PC_UartPutString(" PM2008 TEST \r\t" );

        CyDelay(1000);

    }

}

when i did not use i2c block , the monitor gives me correct message for each 1 seconds,

but i use i2c block monitor goes like this

pastedImage_5.png

it gives me a lots of message, i think something is wrong,,

does somebody have same experience like me ?

1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
Beta tester First comment on KBA 1000 replies posted

Hi,

That is my favorite configuration!

I've uploaded some sample projects of mine,

could you down load and take a look at them? 😉

https://community.cypress.com/thread/42060

https://community.cypress.com/thread/42500

https://community.cypress.com/thread/37142

https://community.cypress.com/thread/35411

moto

P.S. BTW, I recommend you to use "\r\n" instead of "\r\t"

View solution in original post

0 Likes
2 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
Beta tester First comment on KBA 1000 replies posted

Hi,

That is my favorite configuration!

I've uploaded some sample projects of mine,

could you down load and take a look at them? 😉

https://community.cypress.com/thread/42060

https://community.cypress.com/thread/42500

https://community.cypress.com/thread/37142

https://community.cypress.com/thread/35411

moto

P.S. BTW, I recommend you to use "\r\n" instead of "\r\t"

0 Likes

oh friends, Thank you again for tour reply

i solve my problem , that i didn't write UART_Init ();

Thank you very much again

0 Likes