Can I program the CPTxxxx devices without using Simplicity Xpress Configurator?
Answer
It is possible to program the CPTxxxx devices without using the [Program Device] function of Simplicity Xpress Configurator, however at this time there are no tools or specifications for generating the configuration .hex file other than using the Xpress Configurator GUI. You must enter your desired device parameters in the Xpress Configurator GUI and then click [Program To Device] in the GUI window (with or without a device connected). This will generate the desired .hex file in your project folder (see the following image).
Once you have generated the .hex file for the device you can use Simplicity Studio Flash Programmer to program the device with that hex file (using a TS adapter or UDA programmer). This process is the same as for programming any EFM8 or C8051 device using Flash Programmer. You do not need to erase the device - simply select the hex file and click [Program]. This procedure might be helpful for streamlining the production programming of a large number of CPT devices.
Attached to this article is an Excel spreadsheet describing all bytefields within the CP2102N's configuration array. This array is used to program the device using the CP210x_SetConfig command and retrieved by the CP210x_GetConfig command in the CP210x_Manufacturing.dll.
This table lists the following attributes for each entry in the array:
Property ID - the ID used internally by Xpress Configurator for this field
Label - the "User Friendly" label that is usually displayed in the Xpress Configurator UI
Length - the length of the field in bytes or bits
Offset - the offset of the field from the beginning of the configuration structure
Default Value - the default value of the field
For example, here is the first entry in the table:
Property ID
Label
Length
Offset
Default Value
cp2102n.configSize
Config Size
2 byte(s)
0
0x02A6
Any user settable properties are marked with the label "USER". Other properties are grayed-out, and should be left at their default values.
What is the behavior of the CP210x in RS485 mode when sending a line break? How does the transceiver enable pin behave?
Answer
When GPIO.2 is configured for alternate function (RS-485 transceiver enable), the pin is activated when either data or a line break is transmitted. It cannot be configured to enable only on data transmission, or only on line break.
Are there any restrictions on using all 4 ports of the CP2108 in RS485 mode?
Answer
There is a bug in revision B02 of the CP2108 that occurs when using the DE signal of RS485 from ports 0 and 1 at the same time, or ports 2 and 3 at the same time. The bug causes the DE signal to sometimes be deasserted during transmission. The problem can be avoided by not using channel 0 and 1 in RS485 mode, and not using channel 2 and 3 in RS485 mode.
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.
write(slaveAddress, data) - writes an array of data to the i2c slave with the address slaveAddress, without issuing an I2C stop command at the end of the transaction
write_stop(slaveAddress, data) - writes an array of data to the i2c slave with the address slaveAddress, issuing an I2C stop command at the end of the transaction
stop() - issues an I2C stop command
delay_ms(delay) - delays the next command by delay milliseconds
delay_us(delay) - delays the next command by delay microseconds
reenumerate() - immediately reenumerates the CP2112 device
setGPIO(state, gpioNum) - sets the gpio gpioNum to state, where 1 = high, 0 = low
In addition to these commands, the command list must begin with one of the following sequence identifiers:
RESET_SEQUENCE - identifies this sequence of commands to be issued after reset
SUSPEND_SEQUENCE - identifies this sequence of commands to be issued before entering suspend mode
ACTIVE_SEQUENCE - identifies this sequence of commands to be issued when exiting suspend mode into active mode
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:
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.
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.
write(slaveAddress, data) - writes an array of data to the i2c slave with the address slaveAddress, without issuing an I2C stop command at the end of the transaction
write_stop(slaveAddress, data) - writes an array of data to the i2c slave with the address slaveAddress, issuing an I2C stop command at the end of the transaction
stop() - issues an I2C stop command
delay_ms(delay) - delays the next command by delay milliseconds
delay_us(delay) - delays the next command by delay microseconds
reenumerate() - immediately reenumerates the CP2112 device
setGPIO(state, gpioNum) - sets the gpio gpioNum to state, where 1 = high, 0 = low
In addition to these commands, the command list must begin with one of the following sequence identifiers:
RESET_SEQUENCE - identifies this sequence of commands to be issued after reset
SUSPEND_SEQUENCE - identifies this sequence of commands to be issued before entering suspend mode
ACTIVE_SEQUENCE - identifies this sequence of commands to be issued when exiting suspend mode into active mode
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:
Attached to this article is a python 3 script to generate the I2C command arrays for a CP2114-B01 device, interfacing with a codec with 8-bit registers.
This script interprets the following commands to construct the command byte-array.
write(register, data) - writes a byte of data to the codec's register over I2C
delay_ms(delay) - delays the next command by delay milliseconds
delay_us(delay) - delays the next command by delay microseconds
reenumerate() - immediately reenumerates the CP2112 device
setGPIO(state, gpioNum) - sets the gpio gpioNum to state, where 1 = high, 0 = low
The commands may also start with one of the following tags:
SUSPEND_SEQUENCE - specifies that this is the start of the sequence of I2C commands that will be issued when the device enters suspend mode
ACTIVE_SEQUENCE - specifies that this is the start of the sequence of I2C commands that will be issued when the device wakes from suspend mode into active mode
If no tag begins the sequence, the device defaults to using this string as the initialization sequence of commands to be after reset, as long as this is the first sequence after the 30-byte configuration string.
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, with the reset sequence being first.
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 reset configuration for the CS42L55 codec:
Attached to this article is a python 3 script to generate the I2C command arrays for a CP2114-B01 device, interfacing with a codec with 16-bit registers.
This script interprets the following commands to construct the command byte-array.
write(register, valueMSB, valueLSB) - writes two byte of data, MSB first, to the codec's register over I2C
delay_ms(delay) - delays the next command by delay milliseconds
delay_us(delay) - delays the next command by delay microseconds
reenumerate() - immediately reenumerates the CP2112 device
setGPIO(state, gpioNum) - sets the gpio gpioNum to state, where 1 = high, 0 = low
The commands may also start with one of the following tags:
SUSPEND_SEQUENCE - specifies that this is the start of the sequence of I2C commands that will be issued when the device enters suspend mode
ACTIVE_SEQUENCE - specifies that this is the start of the sequence of I2C commands that will be issued when the device wakes from suspend mode into active mode
If no tag begins the sequence, the device defaults to using this string as the initialization sequence of commands to be after reset, as long as this is the first sequence after the 30-byte configuration string.
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, with the reset sequence being first.
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 reset configuration for the WM8523 codec:
How to measure the power consumption of CPT112S with energy profiler ?
Answer
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.
Interface Knowledge Base
Programming Options for CPTxxxx devices
CP2102N SetConfig / GetConfig Array Structure
CP2102N-MINI-EK vs CP2104-MINI-EK size and footprint
RS485 transceiver enable during line break
CP2108_E104 - RS485 DE signal not constantly asserted
CP2114 B02 I2C Command Array Generator
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:
This generates the following binary array:
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.
CP2114 B02 I2C Command Array Generator
CP2114 B01 8-bit Codec Command Array Generator
CP2114 B01 16-bit Codec Command Array Generator
Measure the power consumption of CPT112S
Question
How to measure the power consumption of CPT112S with energy profiler ?
Answer
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.