I2C master and slave for CY8CKIT-145-40XX

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.
YoIs_1298666
Level 5
Level 5
250 sign-ins 100 replies posted 100 sign-ins

Hello,

This is the sample code for I2C master and slave.

You can program the I2C master in CY8C4045AZI-S413 and program the I2C slave in CYBLE-022001-00.

The ASCII code typed with the PC terminal software is set in i2cOutBuffer [1] and echoed back to the PC at the same time.

The value of i2cOutBuffer [1] -i2cOutBuffer [4] is sent from PSoC4000S (CY8C4045AZI-S413) to EZ-BLE PRoC module (CYBLE-022001-00) using I2C communication.Then, the value of i2cOutBuffer [1]: bit0 is set to the LED12 connected to the EZ-BLE PRoC module.

The value of i2cOutBuffer [1] -i2cOutBuffer [4] sent to the EZ-BLE PRoC module is received by i2cInBuffer [0] -i2cInBuffer [3] of PSoC4000S using I2C communication.

The value of i2cInBuffer [0]: bit0 is set to LED4, i2cInBuffer [0]: bit1 is set to LED5, i2cInBuffer [0]: bit2 is set to LED6, and i2cInBuffer [0]: bit3 is set to LED7 connected to PSoC4000S.

Try typing the ASCII codes in order.

0 1 2 3 4 5 6 7 8 9 : ; < = > ?

After operation, we recommend erasing the flash of CYBLE-022001-00 with PSoC Programer.

Best regards,

Yocchi

0 Likes
0 Replies