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):
Thank you *VERY* much for posting your experiences here and sharing them with us. What realy satisfied me was your last picture that showed me that not only my "PSoC bench" looks a bit like the Laokoon Group but others as well (although the wires are thinner)
I thought I shared because you can configure the PSoC4200 to have an I2C slave, so you can use the snap off board to communicate with the PSoC4200 via I2C or if you need higher speeds then use SPI
You can make custom programs with the USB-Serial Software Development Kit that supports not only Windows, but also Android, Linux and OSX.
So if you have a cool design based on the CY8CKIT-049 that needs to interact with the PC other than the COM port, or even via the COM port but with a dedicated program with graphics and everything, that little break off board is there for you 🙂
BTW the RTC module is running great, only lost one second in one day versus the PC that lost 5 seconds.
I did synchronized them both at the same time, well the PC first then the RTC based on the PC time.
A small tip: you can save some of the precious sram when you write
char * const weekday =
This will allocate the strings in flash.
Thanks, but the code runs on the PC.
That's the beauty of that USB-Serial bridge, you can program the PSoC4 to deal with the hardware and communicate it back to the PC/Laptop/Tablet/etc via I2C/SPI/UART for the GUI via that break-off module hooked into your system that has plenty of resources.
If I am reading your Rigol screenshot correctly you have ~ 2V of
undershoot, would be a good idea to address that issue with
either diode clamps or layout.
When I reset my scope, which doesn't happen often, it changes the multipliers for both channels to x1 and I have x10 probes.
Since I mainly use only CH1 I forgot to set CH2 (blue) to x10, so the 500mV is really 5V.
I should have taken better care for an image I was going to post. Also I should have use the ground springs to get rid off all that ringing that shows on the capture.