This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28386D: Questions about how to use GPIO inputs as triggers.

Part Number: TMS320F28386D
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi. I have a question about how to use the rising edge of the signal entering the GPIO input pin as a trigger.

An external clock signal is being entered into the GPIO. I have to read some data for each rising edge of the signal entering the GPIO input pin and store it in the array.

The array size is 1024, so it has to happen 1024 times. Each process should be over before the next rising edge.

The period of the signal entering the input pin is 160ns.

When the trigger occurs, the behavior is simple as follows:

dataArray[dataIndex] = (GpioDataRegs.GPCDAT.all >> 16) & 0xFFF; // 7 cycle
dataIndex++; // 2 cycle

I tried the interrupt trigger method, but it takes 40 cycles (200ns). Therefore, this method is not available.

At the heart of my question, the process of detecting the rising edge of the GPIO input pin and processing the data should not exceed 160ns.

Any way is fine, can you tell me how to detect the rising edge of GPIO signal?

Thank you.

  • Hello,

    An external clock signal is being entered into the GPIO. I have to read some data for each rising edge of the signal entering the GPIO input pin and store it in the array.

    The array size is 1024, so it has to happen 1024 times. Each process should be over before the next rising edge.

    The period of the signal entering the input pin is 160ns.

    Out of curiosity, what sort of communication is this? Is it a specific protocol like I2C or SCI, or is it something custom for your application? If it's custom then you can refer to my below response, otherwise I would recommend using one of the peripherals available on the device itself.

    At the heart of my question, the process of detecting the rising edge of the GPIO input pin and processing the data should not exceed 160ns.

    Any way is fine, can you tell me how to detect the rising edge of GPIO signal?

    Based on your application, you could use the CLB as a method of doing this. The CLB has input filtering which allows the specific rising or falling edge to act as a trigger which can be used to read in the bits serially using the CLB counter. There are some examples showing how to use the serializer (clb_ex22_serializer) and how to create a serial port with the CLB (clb_ex31_tdm_serial_port) in the C2000Ware SDK: C2000Ware_5_01_00_00\driverlib\f2838x\examples\c28x\clb.

  • Thank you for your response.

    Out of curiosity, what sort of communication is this?

    Looking back, I think the question was difficult. I'm sorry for my lack of English.

    An external signal with a period of 160 ns is being entered into the GPIO1 pin, and another signal with the same period is connected to the 12 pins of the GPIO C port.

    I would like to store the pin state of the GPIOC port in the array at the rising edge of the signal input to the GPIO1 pin. (for this reason, dataArray[dataIndex] = (GpioDataRegs.GPCDAT.all> 16) & 0xFFF;)

    Since the system clock is 200 MHz (5ns), the whole process must not exceed 30 cycles maximum to process in 160ns. Is the process I'm talking about possible?

    Thank you.

  • Hello,

    I would like to store the pin state of the GPIOC port in the array at the rising edge of the signal input to the GPIO1 pin. (for this reason, dataArray[dataIndex] = (GpioDataRegs.GPCDAT.all> 16) & 0xFFF;)

    Since the system clock is 200 MHz (5ns), the whole process must not exceed 30 cycles maximum to process in 160ns. Is the process I'm talking about possible?

    If you're trying to read the entire GPIO C port and not just a single pin, then I think what you have is correct.

    If you want to reduce the time it takes for detecting the rising edge, you could still use the CLB to just route that pin as an input, filter for a rising edge detection, and use the HLC to issue an interrupt as soon as that edge is detected. Then, within the CLB interrupt you could read the GPIO pins in whatever fashion you wanted. This is the best solution for a real-time system to prevent delays caused by just polling the pin.

    I've attached a SysConfig file that lays out the basic configuration for doing something like this:

    GPIO_CLB_Trigger.syscfg

  • Thank you for your response, I will try as your advice.