drive mode

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

cross mob
rosac_297156
Level 1
Level 1
5 replies posted Welcome! First question asked
        i read many post and documents about this, but i still have problem to change drive mode in Runtime. i write PRT0DM0 | = 0x01; PRT0DM1 | = 0x01; PRT0DM2 & =~0x01; for pull-Up but it doesn't change. the only way to set pull-up or pull-down is from chip page. pins are not connected to digital block and interrupt are disabled during the operation Any ideas?   
0 Likes
10 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Post your project -

   

 

   

    

   

         

   

 

   

“File”                                                           Designer

   

“Archive Project”

   

 

   

 

   

This may help -

   

 

   

    

   

         

   

    

   

         

   

http://www.cypress.com/?rID=2900     AN2094 - PSoC® 1 - Getting Started with GPIO

   

 

   

In the routing inspector is the pin connected to the input or output global buss ?

   

 

   

Are you trying to connect a pin under SW to a buss ? If so you would use PRTxGS.

   

 

   

Look at the Register TRM and Architectural TREM fopr more info.

   

 

   

Regards, Dana.

0 Likes
rosac_297156
Level 1
Level 1
5 replies posted Welcome! First question asked
        pins are not connected to digital block or bus and this is not done from sw   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Maybe I am confused of what you are trying to accomplish.

   

 

   

If pins are totally unconnected to anything or the internal routing.....?

   

 

   

Regards, Dana.

0 Likes
rosac_297156
Level 1
Level 1
5 replies posted Welcome! First question asked
        pins are nconnected, just inputs read with RD register   
0 Likes
rosac_297156
Level 1
Level 1
5 replies posted Welcome! First question asked
        seems that with pullup or pull down need to set initial value too, but is not possible to set it by code...only the DR is available to have a signal, but at the end i have the output ON and is no possible to use as input   
0 Likes
Anonymous
Not applicable
        One of my old project needs to change the output mode and has no issue doing that. what is the output circuit and how do you test if the output changed to what you want?   
0 Likes
rosac_297156
Level 1
Level 1
5 replies posted Welcome! First question asked
        yes, but in this case i need to change input...when "initialvalue" in chip is set to 1 i have a voltage vlaue output about 1,8V from pin and i can read GND or VCC in input with 1K resistor because this voltage value is in the middle from high and low status. if i write RD register i have 2,9V (output on) and is possible to read low input only with ground directly connected   
0 Likes
Anonymous
Not applicable

1. If you want to have a input, why not use the Hiz input?

   

2. If you want to use the pin as input with pull down or pull up. While I didn't do it beofre, I would think try the following 

   

a.. set the mode as input first from the desinger,

   

b. then set the mode to pull up with your software and

   

c..also set the FET of the other size off. 

   

For example you want to use a pull up, you set the mode to pull up and then set the output to high, then FET on the low set would be OFF, you should now have a internal resitor(~5k6) to VCC. however remember that the voltage on the pin would seems like having a voltage divider, unless your signal has a low impedance.

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

Don't forget if you have mixed I/O in the port, and do read modify writes

   

to port, to use shadow registers, discussed here -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=2900     AN2094 - PSoC® 1 - Getting Started with GPIO

   

 

   

 

   

    

   

          

   

https://www.youtube.com/watch?v=tei6q5M3C0g       Shadow Registers

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Do you want to use the input as digital input or analog input?

0 Likes