Does the Toolstick Base Adapter support Capacitive Sense Profiler with CPT112S/CPT007B devices?
Yes, you can connect the base adapter and CPTxxxx device through C2 interface.
Take the CPT112S STK as example, the connection is depict as below:
The schematic of the ToolStick Base Adapter is available in this document (page 5).
Attached to this article is a python 3 script to generate the I2C command arrays for a CP2114-B02 device.
This script interprets the following commands to construct the command byte-array.
In addition to these commands, the command list must begin with one of the following sequence identifiers:
Note - only one sequence can be generated at a time with this script. If all three sequences are needed, they will need to be generated individually, then appended together into one large byte array.
Here is an example image of the script running:
The left panel is the 'input' field, where commands are typed. The right panel is the 'output' field, where the byte array is generated. The byte array is refreshed any time return/enter are pressed in the input field.
The bottom panel is for any errors that may arise.
As an example, this is the input text required to generate a configuration for the CS42L55 codec:
RESET_SEQUENCE setGPIO(0, 4) delay_us(250) delay_us(250) delay_us(250) delay_us(250) setGPIO(1, 4) delay_us(1) write_stop(0x94, [0x00, 0x99]) write_stop(0x94, [0x2E, 0x30]) write_stop(0x94, [0xB2, 0x07, 0xFD, 0xF8, 0xDC, 0xF8, 0x6C]) write_stop(0x94, [0x3A, 0xF8]) write_stop(0x94, [0xBC, 0xD3, 0x23, 0x81, 0x46]) write_stop(0x94, [0x00, 0x00]) write_stop(0x94, [0x03, 0x0A]) write_stop(0x94, [0x84, 0x02, 0x09]) write_stop(0x94, [0x06, 0x20]) write_stop(0x94, [0x2A, 0x00]) write_stop(0x94, [0x9A, 0xC4, 0xC4, 0xC4, 0xC4]) write_stop(0x94, [0x02, 0x08]) delay_ms(75) write_stop(0x94, [0x9A, 0x7A, 0x00, 0x00])
This generates the following binary array:
F9 6E 00 47 04 64 FA 64 FA 64 FA 64 FA 47 84 64 01 57 03 94 00 99 50 57 03 94 2E 30 50 57 08 94 B2 07 FD F8 DC F8 6C 50 57 03 94 3A F8 50 57 06 94 BC D3 23 81 46 50 57 03 94 00 00 50 57 03 94 03 0A 50 57 04 94 84 02 09 50 57 03 94 06 20 50 57 03 94 2A 00 50 57 06 94 9A C4 C4 C4 C4 50 57 03 94 02 08 50 44 4B 57 05 94 9A 7A 00 00 50 00
Syntax errors will be displayed in the bottom panel:
Note, the first version of this script, attached to the article, had bugs that created invalid outputs. The fixed script is attached as cp2114_b02_commandGenerator_FIXED.zip. In this version the escape key is used to evaluate the input and generate the output.
How to measure the power consumption of CPT112S with energy profiler ？
Sometimes we need to monitor the power consumption of CPT112S simply. The energy profiler in Simplicity Studio is a practical tool for energy consumption measurement, however, the CPT112S does not support energy profiler.
In fact, we can use an EFM8 or EFM32 STK and makes it working under low power mode to minimize the effect on the final result, such as EM4. And then power the CPT112S board with VMCU of the STK board.
For example, use the EFM32ZG STK to measure the power consumption of CPT112S, the power consumption can be monitored within energy profiler as below.
This method also can be applied to other device in need.
Is it possible to use the CP2112 to communicate with multiple I2C slaves?
Yes. CP2112 supports to communicate with multiple I2C slave devices with different slave address. User can use specify the slave address in Data Read and Data Write reports.
Please refer to AN495 for more details on CP2112 low-level HID interface specification.
Silicon Labs also provides CP2112 Windows interface DLL to communicate with CP2112, referring to AN496 if needed.
Recommend downloading the CP2112 Software Package from link below and then install it to get all CP2112 documents.
The CP2112 is a highly-integrated HID USB-to-SMBus Bridge providing a simple solution for controlling SMBus slave devices. It uses the standard USB HID device class, which is natively supported by most operating systems. The windows applications can communicate with the CP2112 through a Windows DLL, which is provided by Silicon Labs.
As we all known, the USB HID interface transfer HID reports with interrupt pipe. And the USB controller are required to support maximum data payload sizes from 0 to 64 bytes for full-speed interrupt endpoints. The default setting for CP2112 usb controller is 64 bytes.
After initiating a read request to the desired salve device through HidSmbus_ReadRequest(), the application will call HidSmbus_ForceReadResponse() to read data in a polled mode (suppose autoReadRespond is disabled), the read process will be scheduled by the PC usb host.
The following figure illustrated the usb bus data transfer after calling HidSmbus_ForceReadResponse() in the experiment, the number of bytes to read is 512. From the captured usb bus data, the host will issue IN token within SOF 392 and 393, but the next IN token be issued until SOF 400. From the experiment result, the IN token interval is not a constant since it be controlled by the usb host, and the complexity of the usb network will affect it.