Quantcast
Channel: Total Phase Blog
Viewing all articles
Browse latest Browse all 822

How Do I Create a Clock Duty Cycle that is “Outside the Spec” for an I2C Device?

$
0
0

Question from the Customer:

I am using the Promira Serial Platform with the I2C Active - Level 1 Application. When using this and SDA line, the clock duty cycle is about 30%. Is there a way to increase serial clock duty cycle for this I2C device? I ideally want it at 50%. Here’s what it looks like on the scope. Channel 1 is the clock at 30% duty and channel 2 is data at 50% duty. Example of I2C duty cycle

How can I get a 50% SCL duty cycle?

Response from Technical Support:

Thanks for your question! The 30% low duty cycle is intentional - it conforms to I2C specifications.  It is also important for sampling data, as it provides enough time for data changes to take place.  With the current version of Promira firmware, the duty cycle cannot be modified - however, we do have a solution for you.

To Specify the SCL Duty Cycle, You Can Use API Software and a GPIO Pin

Using the Promira API Software , here are the suggested API commands to use to switch the selected GPIO pin to create a 50% duty cycle.

ps_queue_gpio_set(queue, STATE0)
ps_queue_delay_ms(queue, on_time_in_ms)
ps_queue_gpio_set(queue, STATE1)
ps_queue_delay_ms(queue, off_time_in_ms)

For the target duty cycle of 50%, on_time_in_ms = off_time_in_ms. The STATE0 and STATE1 parameters are set in terms of bitmasks of the available GPIOs. For more information about API commands, please refer to the API Documentation section of the Promira Serial Platform I2C/SPI Active User Manual.

Here are some factors to consider:

The switching speed of the GPIO pins depends on the time taken to execute the lines of the script. Additionally, the OK may add delay due to internal overhead. The Promira platform also has latency caused by the Ethernet/USB link between the computer and the Promira platform.

We hope this answers your question. Additional resources that you may find helpful include the following:

More questions? Other projects? You can also contact us at sales@totalphase.com, or request a demo that applies to your application, as well as ask questions about the Promira Serial Platform and other Total Phase products.

Request a Demo


Viewing all articles
Browse latest Browse all 822

Trending Articles