Not sure if this goes here or in the USB forum but since it's part of the PSoC 4xxx prototype boards I decided to post it in here:
Someone in a forum asked for a cheap and easy USB to I2C Dev Kit, so I suggested using the break off USB Serial part of the CY8CKIT-049.
As my example I used an RTC clock based on the PCF8563 chip from NXP
So first I open the Cypress USB-Serial Configuration Utility after plugin in the board to my PC USB port, and selected my USB-Serial (Single Channel) target and clicked on Connect:
I left the USB configuration alone, but you can change the VID/PID manufacturer and product strings etc, also left the IO levels to CMOS (you can select TTL) and clicked on the SCB tab:
Next I selected the mode to be I2C and clicked Configure
Note that you can set the notification LEDs to use GPIO pins to drive transmit and receive individual LEDs or a single one for both tx/rx
Selected 400KHz and set it to be in Master mode and ok.
I added two 2.2K Ohm pull-up resistors as required for 400Kbps
Altered the I2cmaster example that came with the USB-Serial Software Development Kit
I'll include the code at the end of the post.
I did probe the SCL and SDA to make sure I was reading/writing the right data:
And it worked great:
So that little chip that we use for communicating with the boot loader has other uses, it can also do UART of course, and SPI.
Here is the code (Windoes based):
IMG_20150307_165117.jpg 93.0 K