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

PSoC™ 5, 3 & 1 Forum Discussions

Anonymous
Not applicable

Below ref  code as psoc 101 video series

#include "project.h"

int main(void)

{

  

  uint8 compare =0 ;

    uint8 i2cbuf[1];

          i2cbuf[0] = 0 ;

   CyGlobalIntEnable; /* Enable global interrupts. */

   PWM_1_Start();

   EZI2C_1_Start();

   EZI2C_1_SetBuffer1(1,1,i2cbuf);

        for(;;)

       {

         if ( compare !=  i2cbuf[0])

                {

                    compare = i2cbuf[0];

                    PWM_1_WriteCompare(compare);

                }

     

        }

}

/* [] END OF FILE */

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

Try setting the sub address size to 16 bits in EZscsi configuration.

Next time can you please post 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
Anonymous
Not applicable

Thanks !! Please find the attached

Regards,

Basil

0 Likes

Hi Basil,

In your attached project, the slave address seems to be 4. Please check. I have attached an image, where BCP is used to write data.

Thanks,
Shanmathi

0 Likes