AURIX Bidirectional Pin

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeS
Level 1
Level 1
First like given First question asked Welcome!

Hello, 

A pin with bidirectional functionality is needed for our Project with AURIX TC38x but P32.0 and P32.1 have already been used. Is there anyother option, can anyone suggest a solution?

This bidirectional Pin can be used as below:

--> Output : µC gives a signal to the device for start of the sequencer.

--> Input: The device triggers the µC if the device is ready for transmission by SPI.

Thank you in advance!

Best Regards 

0 Likes
1 Solution
ThNo
Level 4
Level 4
First like given 25 sign-ins 5 solutions authored

Hi @DeS,

Basically the status of any port pin can always be read/polled via the Pn_IN registers (even if the port is configured to be an output).

For bi-directional use (i.e. allowing an external circuitry to drive a low value w/o electrical contention) the output has to be configured to use Open-drain characteristics (also the external device should also use an open-drain characteristics).
=> Thus either TriCore or the external device could drive the output low w/o contention on the respective output stages of the ports.

Drawbacks of this approach:
Only bare GPIO functionality for input (i.e. no IRQ capability) and thus TriCore would require polling of the input status.

Potential mitigations:

  • Use of 2 pins
    One could be programmed as input with an alternate function to allow IRQs.
    Output would still require to be Open-drain (to avoid contention on the output stages of TriCore and external device)
    Setting of the output by TriCore would/could also trigger IRQ -> need to be handled in SW.
  • Dynamic reprogramming of port between “Input pull-up with a specific function” and “Output open-drain”:
    • When a signal needs to be driven low by the TriCore, port would need to be reprogrammed to “Output open-drain” and the GPIO output = low would be applied.
    • When there is no signal driven by the TriCore, port would need to be reprogrammed to “Input pull-up” (and assigned specific input functionality).
      Thereby it would be possible to trigger an IRQ by an external signal (and polling could be avoided).

BR,
ThNo

View solution in original post

3 Replies
Jeremy_Z
Moderator
Moderator
Moderator
1000 replies posted 250 sign-ins 100 likes received

Hi @DeS 
1) Is there any other option, can anyone suggest a solution?
-- I'd recommend you assign two pins to implement the above input and output functions respectively.
BR,
Jeremy

0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored

Any GPIO pin on TC38x can be used bidirectional. For such case the pin can be set the pin to output open drain.

0 Likes
ThNo
Level 4
Level 4
First like given 25 sign-ins 5 solutions authored

Hi @DeS,

Basically the status of any port pin can always be read/polled via the Pn_IN registers (even if the port is configured to be an output).

For bi-directional use (i.e. allowing an external circuitry to drive a low value w/o electrical contention) the output has to be configured to use Open-drain characteristics (also the external device should also use an open-drain characteristics).
=> Thus either TriCore or the external device could drive the output low w/o contention on the respective output stages of the ports.

Drawbacks of this approach:
Only bare GPIO functionality for input (i.e. no IRQ capability) and thus TriCore would require polling of the input status.

Potential mitigations:

  • Use of 2 pins
    One could be programmed as input with an alternate function to allow IRQs.
    Output would still require to be Open-drain (to avoid contention on the output stages of TriCore and external device)
    Setting of the output by TriCore would/could also trigger IRQ -> need to be handled in SW.
  • Dynamic reprogramming of port between “Input pull-up with a specific function” and “Output open-drain”:
    • When a signal needs to be driven low by the TriCore, port would need to be reprogrammed to “Output open-drain” and the GPIO output = low would be applied.
    • When there is no signal driven by the TriCore, port would need to be reprogrammed to “Input pull-up” (and assigned specific input functionality).
      Thereby it would be possible to trigger an IRQ by an external signal (and polling could be avoided).

BR,
ThNo