I2C SPI USB CAN eSPI Cable Testing View All Quick Start Guides User Manuals Software Downloads Knowledge Base Videos Case Studies App Notes White Papers Sales Support About Us
Products Blog Sales Support Contact Search
For Greater Control and Signal Integrity, can I2C and GPIO Modes Be Applied Simultaneously?
Rena Ayeras

Image by Naveen Kaushan from Pixabay

Question from the Customer:

I plan to use the Aardvark I2C/SPI Host Adapter in I2C mode to communicate with a system. The Aardvark adapter will be the I2C controller. After initializing the target power and I2C pull-ups, I want to make sure that both the SCL and SDA signals go high before initiating a transaction. I need this condition to be able to detect a problem, such as a prior read that was incomplete or a failure of the target system.

My concern is switching from I2C mode to GPIO mode. I assume the Aardvark adapter will disconnect the I2C pull-up resisters, causing an invalid read to occur. I was thinking if I could use the GPIO pull-up resistors, that could solve that potential problem. However, the problem I foresee is signal glitches being read as false data when alternating modes.

After the startup, I will need to use GPIO to send an interrupt to initiate a service function.

To ensure signal integrity, what are your recommendations for this setup? The I2C bus speed will be 400kHz.

Response from Technical Support:

Thanks for your question! In the case of verifying specific signal levels, switching to GPIO is necessary, however, there should be no problem with false signals from signal level glitches. After powering up, GPIO signals are available without you needing to switch modes. Details are provided in the following sections.

Pull-Up Resistors and Switching Modes

I2C pull-up resistors are independent of the selected mode of the Aardvark adapter. We expect the pull-ups will be maintained when you do switch modes. To be sure, you can confirm the stability with a scope.

Note: The Aardvark adapter waits for lines to go to idle state and stabilize before initiating any transfer.

Available GPIO Pins in I2C Mode

The Aardvark I2C/SPI Host Adapter can actively support one mode at a time, I2C or SPI, or fully function as GPIO. When I2C or SPI mode is used, the pins that are dedicated for the other mode are available as GPIO pins. With this feature, you could send an interrupt signal without having to alternate I2C and GPIO modes.

For more information, please refer to General Purpose IO in the Control Center Serial Software Manual.

Aardvark Host Adapter Cables and Signal Rate

Regarding the 400kHz frequency, the cable provided with the Aardvark adapter, as well as the frequently used 10-Pin Split Cable, are both 5”/12.7cm long. Both cables are optimized to work with I2C signals at that rate. Longer cables could cause signal degradation, but the above-mentioned cables will work for your setup.

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

If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.