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
How Can I Get the Promira Serial Platform GPIO Signals to Perform as Needed?
Rena Ayeras

Question from the Customer:

Extracting large data files are no longer a struggle with the right tools

Image by kalhh from Pixabay

I inherited a project that uses the Promira Serial Platform with the SPI Active Level 1 and Level 2 applications. I’m doing my best to learn this device. I could use some assistance, mostly with the GPIO pins.

So far, I have communicated with the Promira platform using static ip and lights.py. I can see the lights on the I2C/SPI Activity Board blinking, and the command line returns “Bitrate set to -13 kz”. I assume the device is working, but other than running this sample of Promira Software API with the board, I am not getting results.

For example, I tried running another script, gpio.py:

  1. Setting GPIO0 to logic low
  2. Read the GPIO1 line as logic high
  3. Read the GPIO2 line as logic high (passive pull-up)
  4. Calling ps_gpio_change for 2 seconds - but the GPIO inputs did not change.

When running this, I put the scope on pin 1 (GPIO_0). I see similar behavior as with my code. It goes low when the dev_open is called, but I see no other effect.

 I wrote some python code to control a GPIO. I put a scope on the GPIO signal line, and here are the results:

  1. Initially the line is low.
  2. After the dev_open() call, the line goes high, then it pulses low then high again.

I think the pulse I am seeing is just a result of the dev_open call, not from the ps_app_configure. If I insert an infinite loop right after dev_open, I see the exact same behavior (the pulse low then high). To some level I can communicate with the Promira platform, but the behavior and results are not what I expect.

I feel like I’m playing tug of war. How can I get this to work?

Response from Technical Support:

Thank you for your question! The purpose of the lights.py API code is flashing the LEDs attached to a Philips PCA9554D I/O port expander as found on the I2C/SPI Activity Board. From your results with that setup, it looks like your Promira platform is working. We will go over how the GPIO pins work and provide guidelines about programming and verifying the GPIO signals.

Hardware Aspects of Promira GPIO Pins

The Promira platform pins are open drain and have internal pull-up. Here are the values of the GPIO pins:

  • GPIO00 / GPIO01 signal pull-up: 560 OHM.
  • GPIOs 02, 03, 04, 05, 06, 07, 08, 15 have stronger pull-ups: signals from power up and beyond have 2.2K pull-up.
  • GPIOs 13, 14 signals from power up and beyond: 1.5K pull-up.
  • GPIOs 09, 10, 11, 12 signals have weak pull-ups.
Note: The Promira platform GPIO00 / GPIO01 signal pull-up cannot be configured: enabled or disabled.

Using the Promira Platform with Target Devices

When the Promira platform is connected to Control Center Serial Software, configured for GPIO input, and the target device does not drive the Promira platform, GPIO00 reads 1. In this case, the GPIO00 pull-up creates the 1. In the Promira platform enabling or disabling the I2C signal pull-up, it does not affect the GPIO00 / GPIO01 signal. This signal always has a pull-up, which is a separate resistor from the I2C signal pull-up resistor.

With all that in mind, when the Promira platform is connected to Control Center Serial Software and configured to GPIO input, we recommend making sure the target device drives the Promira platform,. That way, the GPIO00 signal reads accordingly.

Controlling GPIO with API

The GPIO.py script performs simple GPIO tests with a single Promira platform. You can verify results with an oscilloscope or a multimeter.

The ps_gpio_direction  script uses the direction_mask argument. This mask must be reflected in the last 16bits. For example, to enable GPIO00 and GPIO03, the mask is 0x01 | 0x08 (00000001 and 00001000). In the bit mask format, GPIO00 is the LSB to GPIO15 to MSB (16th LSB bit). The bit masks are as follows:

  • GPIO00 - 0x0001
  • GPIO01 - 0x0002
  • GPIO02 - 0x0004
  • GPIO03 - 0x0008
  • GPIO04 - 0x0010
  • GPIO05 - 0x0020
  • GPIO06 - 0x0040
  • GPIO07 - 0x0080
  • GPIO08 - 0x0100
  • GPIO09 - 0x0200
  • GPIO10 - 0x0400
  • GPIO11 - 0x0800
  • GPIO12 - 0x1000
  • GPIO13 - 0x2000
  • GPIO14 - 0x4000
  • GPIO15 - 0x8000

With these masks, you can run some simple scripts to test and verify GPIO pin activity.

We hope this answers your question. 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.