68
CY3274 Cypress High Voltage Programmable PLC Development Kit Guide, Doc. # 001-53598 Rev. *G
Code Examples
5.3.6
I
2
C Host Example
An example algorithm of a host trying to tell the CY8CPLC20 message (I
2
C address 0x01) to send a
PLC message would be (Note that the I
2
C address is shifted left by one bit):
1. Send {0x02, 0x06, 0x81} which writes the value 0x81 to the PLT_Memory_Array[0x06] to send a
one-byte message
2. Send {0x03, 0x69} which reads from the PLT_Memory_Array[0x69] to read the status of
transmission
3. Read one byte of data
4. If the received byte contains an event update of the transmission, it is done. Otherwise, repeat
step 2.
5.3.7
Evaluating the Example Project on Hardware with PLC Control Panel GUI
Program 2 PLC CY3274 DVKs with the project developed in the
you can directly use the “CY3274_PLC_Control_Panel” project present in the Firmware folder of the
CY3274 kit installation location). You can use the same steps in
for programming the boards.
On the PLC DVKs, to connect the CY8CPLC20 device to the PC, a CY3240 Cypress USB-I2C
bridge can be connected to the 5-pin I
2
C header, as shown in
.
Figure 5-15. I
2
C Hardware Connection
After this, please follow the steps mentioned in
PLC Control Panel Quick Start on page 27
to test the
working of the boards using the PLC Control Panel GUI.