7 Replies Latest reply on Feb 28, 2019 10:56 PM by LinglingG_46

    psoc i/o pin connected to microcontroller output pin

    algic_2726006

      I have an i/o pin of the PSOC 5LP connected to a microcontroller output pin:

       

      1. Imagine that I want to set the pin of the PSOC as if it was "physically" disconnected to the microcontroller output pin. What would be the best way configuration for the PSOC pin?

       

      2. And in case I want to prevent a shortcut when configuring by mistake the PSOC5 pin as output (with potentially different voltage than the microcontroller output pin), what could be done to prevent damage? I was thinking in using 200ohm resistor in between the pins instead of a direct connection, but this could have some disadvantages like a limitation of the speed, right? any better ideas?

       

      Thanks in advance

        • 1. Re: psoc i/o pin connected to microcontroller output pin
          ScottA_91

          So I'm not clear what's going on here.

           

          Let me try and draw this out:

          2019-02-20_9-10-47.png

           

          Now if I understand you P[y] is a digital input and P[z] is a digital output correct?

           

          You're worried about misconfiguring the PSoC5 LP and driving out P[y] at a different voltage than what Chip X can handle correct?

           

          Well there is on the PSoC pins a signal for output enable.  If you tie that to 0 in your design, it shouldn't be possible for the PSoC to drive out anything.  (Although running both chips at the same voltage is probably a better choice.)

           

          Additionally, if you want to physically disconnect the P[y] and P[z] connection, you'll need some outside logic such as a reed relay or something similar.  If instead you just want a logical disconnect, put a control register on your schematic, hook the input to an AND gate, drive that into a status and read the status rather than the pin.  (Write 1 to the control to read, write 0 to disable reading.)

          • 2. Re: psoc i/o pin connected to microcontroller output pin
            BoTa_264741

            algior,

            if both chips are resides on the same PCB, and operate at same voltage level (e.g. 5V both), then direct connection is OK. If there is voltage difference (say, 5V and 3V), then SIO pins can handle this also. In any case, PSoC can't tolerate input signal outside of [-0.7, +5.5V] (check TRM for exact values).

             

            If ChipX resides on other PCB or is a remote device, consider using a digital isolator (many types available) to prevent pin damage and proper operation.

            /odissey1

            • 3. Re: psoc i/o pin connected to microcontroller output pin
              algic_2726006

              Thanks for the answer (and drawing) scott,

              I did not explained clearly. P[y] is a digital input/output and P[z] is also a digital input/output. P[z] is a pin from a a microcontroller that can source/sink up to 40 mA.

               

              The conflict could be when configuring both pins (P[y] and P[z]) as outputs: in this situation I would like to prevent any damage. Is direct connection safe enough or would this produce a potential damage? In this case what would be the best options to connect the pins?

              • 4. Re: psoc i/o pin connected to microcontroller output pin
                LinglingG_46

                You should avoid to let the two pins output at the same time.

                If you let the two pins output at the same time, It will have a potential damage, but what will happen, we should analysis the drive mode and voltage of the pins.

                1 of 1 people found this helpful
                • 5. Re: psoc i/o pin connected to microcontroller output pin
                  algic_2726006

                  Hi Lingling, you are right! but is there any way to do the connection of both pins "safe" ie: adding a "small" resistor in between two?:

                   

                  For example, the GPIO of the PSOC can source 4 mA and sink 8 mA.

                  5V/4mA=1250 ohm

                  If I put a 1250 ohm resistor between P[y] and P[z], then there will be no damage in case of setting as outputs (one pin to high [ie:5V] and the other to low [ground]). But what would be the disadvantages of this? This would limit the data transmission speed when using one pin as output and the other of input (this is, in the right way). I guess I should measure how much is this loss in speed.

                   

                  Some PMOD modules use a 200ohm resistor to protect the microcontrollers/fpgas...

                   

                  Of course, I could use a SIO pin on the PSOC, which can drive/sink 25mA. In this case the resistor would be lower 5V/25mA=200ohm. This would improve speed... but how much? Any one has any experience on this?

                   

                  Some PMOD modules use a 200ohm resistor to protect the microcontrollers/fpgas, which is exactly the same value I just calculated for 25mA.

                   

                  Any other better solution? I would like to be able to work at a maximum speed of 50Mhz.

                  • 6. Re: psoc i/o pin connected to microcontroller output pin
                    ScottA_91

                    Well, provided the other chip supports it, you could set the pin to be open drain, drives low, and tie the line high via resistor.

                     

                    Something like:

                    2019-02-21_9-46-28.png

                     

                    Where the pin is doing this:

                    2019-02-21_9-43-06.png

                     

                    I think that would do what you want; however, it depends on Chip X having a way to configure the state of the pins.  Someone with more experience than me can probably give you a resistor value to use

                    1 of 1 people found this helpful
                    • 7. Re: psoc i/o pin connected to microcontroller output pin
                      LinglingG_46

                      1:

                       

                      You should avoid to let the two pins output at the same time.

                      If you let the two pins output at the same time, It will have a potential damage, but what will happen, we should analysis the drive mode and voltage of the pins.

                       

                      2: Set the pin drive mode with Open drain mode like the Scott says.

                      1 of 1 people found this helpful