Direct pin access while connected to schematic symbol?

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

cross mob
Anonymous
Not applicable

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.

0 Likes
2 Replies
Anonymous
Not applicable

 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. PRTBYP controls whether the GPIO pin takes its output level from the DSI or the port's data register PRTDR.

   

 

   

If the schematic symbol for the pin is already set up correctly you should not need to fiddle with the PRTDM (drive mode) or PRTBIE (bidirectional control) registers. Write the logic level you want to put on the pin to the correct bit in PRTDM and flip PRTDR bit to '0'. When you're done and want the peripheral to take over again, set the PRTDM 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.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

This might be of assitance -

   

 

   

    

   

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

   

 

   

Regards, Dana.

0 Likes