I am using the Aardvark I2C/SPI Host Adapter. For my application, I need to adjust the I2C Master Clock Duty Cycle from 30% to 50%. How can I adjust the duty cycle?
Response from Technical Support:Thanks for your question! The Aardvark adapter operates within the I2C specification, including the clock (SCLK); the duty cycle cannot be changed. However, a GPIO signal pin can be programmed with API commands to create the desired duty cycle.
For this application, we strongly recommend using the Promira Serial Platform with an I2C Active Level x Application (Level 1, Level 2). There are speed limitations for generating a clock pulse, which are described below.
There are latencies that apply to both the Aardvark adapter and the Promira platform:
Using the Promira API Software, we recommend these API commands to create a 50% duty cycle. The GPIO signal is switched on and off.
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.
Although programming with the Aardvark adapter is not recommended, an example is provided should the slower clock rate work for some applications.
The GPIO values are set using bit-masks in the aa_gpio_set(). The delay function can be replaced with aa_sleep_ms(). However, high frequencies of several hundred KHz cannot be achieved with the GPIO switching speed.
For more information, please refer to the API Documentation section of the Aardvark I2C/SPI Host Adapter User Manual.
For an easy comparison, here’s a table that summarizes the features of I2C/SPI Total Phase tools.
Additional resources that you may find helpful include the following:
For information about specific applications:
We hope this answers your question. Looking for more information? You can contact us and request a demo that applies to your application, as well as ask about Total Phase products.