This post is a continuation of the one at the link below:
Right now, we are trying to figure out how to communicate with the CP2114-B02's I2C module from using USB HID access on the PC-side.
The program we are working on is coded in C# and uses the USBLibDotNet library for USB communications between the PC and the IC. We have been referencing AN434 for the details on the HID protocol but so far have had no success writing to the device once we connect to it. Before I go into the details of our code problems, is there any example code available which shows how to connect to the CP2114-B02 to send I2C data?
Any help would be great, as we've been racking our brains on this one for a few days.
Forgot the link to the first post. Here it is:
As far as I know Silabs don't have application example on PC side to demonstrate the I2C function of CP2114-B02.
1. Be sure your I2C chip is out of reset.
On my board RSTn pin of slave I2C chip is connected to GPIO.0 of CP2114.
So I need to configure GPIO.0 as "GPIO output push-pull" using CP2110_4 Device Customization Utility, then set GPIO.0=1 using HID command "0x45 0x00 0x01 0x00 0x01".
2. You can verify your HID commands to CP2114 using SimpleHIDWrite.
In SimpleHIDWrite app use "GetFeature" / "SetFeature" buttons.
Thank you for the feedback. Here's the response from my engineer who is testing this:
1. First of all you must select your device from the list in the upper windows.
2. Write data in edit boxes in HEX format without 0x prefix.
3. For GET commands press "Get Feature" button, for SET - "Set Feature"
4. SimpleHIDWrite answer string format:
"RD/sf ReportID Data1 .... DataN"
RD - read (GetFeature), sf - SetFeature
ReportID - used ReportID
Data1 - DataN - data to/from CP2114
5. reportIDs 0x7D and 0x7E are available only for CP2114-B02.
See attached file. Is ther B02 revision on CP2114 USB-to-I2S Bridge EVB Rev1.1 dev board?
The command that I am sending is 0x41, 0x01. In the ReportID box, I type in 42. In the first box below the RerportID box, I type in 1 (These are the command in hex). When I press the write button, in the output box, I get a WRITE ERROR.
I tried this with the numbers converted to decimal and the output is the same. Is there anything that I am not doing correct?
Why do you type 42 in ReportId box?
1. Get UART status
ReportID = 41, data = any, GetFeature
2. Set UART enable
ReportID = 41, data = 01, SetFeature
3. Set UART disable
ReportID = 41, data = 00, SetFeature
I am the engineer directly working on the project.
I have looked over your posts and I am not able to set/get the UART configuration. Concerning the I2C, the part number from the chip is: CP2114B0L01E so it looks like it cannot do the I2C communications from the command (that is how I am understanding you post. I would need the CP2114-B02)
However, I am able to set the features for the UART. I first send it the report ID 41 to enable to UART, and the report ID 50 in order to setup the UART, and afterward, I try sending some test data through by sending the report ID 01 with data A2. With the 50 command, I am getting an error Data Error
I currently have nothing connected to the UART and I am scoping on the TX pin of the device.
Concerning the I2C, the part number from the chip is: CP2114B0L01E so it looks like it cannot do the I2C communications from the command (that is how I am understanding you post. I would need the CP2114-B02)
I don't know what is CP2114B0L01E. If it's B01 revision then it supports only I2C commands for read/write chip registers. See forum post CP2114-I2C-command-format.
However, I am able to set the features for the UART. I first send it the report ID 41 to enable to UART, and the report ID 50 in order to setup the UART, and afterward, I try sending some test data through by sending the report ID 01 with data A2. With the 50 command, I am getting an error Data Error.
Sorry, I don't work with UART and I can't help you. Check the number of parameters for command 50.
Have you seen HidUartExample?
I used one of the commands in the chip and I can confirm that the chip is the B-01.
It is unfortunate to hear that you have not worked with the UART. However, thank you for your help on the other aspects of the project. I have looked over the HIDUART example and they are using the DLL that I am not able to use in C#. So, I pretty much have to use a USB library and communicate with the CP device outlined in AN434.
I now have a standard that I am using in order to make sure that all commands are working properly.
Thank you for all of your assistance.