2 Replies Latest reply on Jun 11, 2014 10:28 AM by user_14586677

    Direct pin access while connected to schematic symbol?

    user_193124556

      If I have a pin connected to a schematic symbol (say a SPI Master block, for example), can I force the pin to a given state (high, low, tri-state) through software alone, or do I have to add a control register and mux to the schematic to do this?

         

       

         

      My use case is a SPI Master talking to an external component, and the component has some very specific setup requirements that are not SPI. I'd like to wiggle the SPI MOSI pin and then "give the pin back" to the SPI module for normal SPI communications once my external component has been initialized.

         

       

         

      I took a look through the pin datasheet and the resultant code generated, but I didn't see a way to do this. Adding a MUX and control register seems to be an awfully "heavy" way to do this.

        • 1. Re: Direct pin access while connected to schematic symbol?
          user_193124556

           Answering my own question (again):

             

           

             

          Looking at the Architecture TRM, Cypress gives a block diagram of the GPIO blocks. (section 19.2 on page 144 for the 5LP, for example). It specifically calls out the register names surrounding the MUX leading into the drive logic block. PRT[x]BYP controls whether the GPIO pin takes its output level from the DSI or the port's data register PRT[x]DR.

             

           

             

          If the schematic symbol for the pin is already set up correctly you should not need to fiddle with the PRT[x]DM (drive mode) or PRT[x]BIE (bidirectional control) registers. Write the logic level you want to put on the pin to the correct bit in PRT[x]DM and flip PRT[x]DR bit to '0'. When you're done and want the peripheral to take over again, set the PRT[x]DM bit to '1' so the pin takes its logic level from the DSI.

             

           

             

          The memory addresses for these registers is in the (very difficult to read) Register TRM.

          • 2. Re: Direct pin access while connected to schematic symbol?
            user_14586677

            This might be of assitance -

               

             

               

                

               

                      http://www.cypress.com/?rID=57571

               

             

               

            Regards, Dana.