3 Replies Latest reply on Aug 9, 2017 2:48 PM by epr_1639216

    Using GPIO pin as a one bit control register

      I have noticed that a pin configured as output with hardware connection, strong drive, can be driven from the hardware and read by the firmware, which I think could be used as a one bit status register.  

         

      I wonder if something similar can be done for a 1-bit control register.    Is the digital side aware of the status of an output pin updated by the firmware?  Would it work configuring the pin as bidirectional, with only the input connected to hardware, and use it from the firmware as output, strong drive?

         

      Tony

        • 1. Re: Using GPIO pin as a one bit control register

          I would expect this to be possible, but I've never tried it so I don't know for sure :)

             

          You can definitely route the digital signals internally, and software can control the digital components; Thus, I would expect it to work like you asked.

          • 2. Re: Using GPIO pin as a one bit control register

            I had some time to try what I wondered in my post and it did not seem to work.    There may be another combination of settings that works.   I think with the control registers being a limited resource, it would be nice to be able to do this, in particular when you only need one or two bits.   If the fitter could split/share bits in a control register, it would be less of an issue, but that does not seem to be the case.   For example, the ISP component in bidir mode appears to use a single bit control register.    I was working on a design that added logic around it, and needed a couple more bits.   It would have been nice to use a segment of the same register, but there does not seem to be possible.    I am sure there must be some tricks somewhere in the huge pile of PSoC things I do not know...   

            • 3. Re: Using GPIO pin as a one bit control register

              Hmmm, that's a bummer :(

                 

              Well, something to find out in the future :)