multiple use of GPIO

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

cross mob
chmoc_1567941
Level 4
Level 4

hi,

   

i want to implement two task on same pin like 8 pin which are use for a,b,c,d,e,f,g,dp of seven segment and also use for digital input of 8 pushbutton.

   

how can i implement it in psoc-1???

0 Likes
1 Solution
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello Chirag,

   

 

   

I understand that you want to change the PSOC GPIO pin from being an output pin to drive LED, to being an input pin to sense push buttons. You can do this by setting the port's drive mode register.

   

 

   

You should refer to the PSoC1 Technical Reference Manual.

   

 

   

Drive mode has three bits. So each port has three registers to control the GPIO mode for each of its eight lines. SO you will have PRT0DM0, PRT0DM1 and PRT0DM2. For an output DM[2:0] should be 001 and for input DM[2:0] should be 010. For further information, you can do a text search in the Technical Reference Manual for "Drive Mode".

View solution in original post

0 Likes
2 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Psoc 1 is old and not supported any longer.  My I suggest that you use the CY8CKIT-059 Psoc 5LP or the CY8CKIT-043 PSOC® 4 M-SERIES PROTOTYPING KIT. Both of these are current designs and are priced at $10.00 US.  Then you should be able to do what you want with the same GPIO pins. Just make the Pin Bidirectional and it should do what you need. 

0 Likes
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello Chirag,

   

 

   

I understand that you want to change the PSOC GPIO pin from being an output pin to drive LED, to being an input pin to sense push buttons. You can do this by setting the port's drive mode register.

   

 

   

You should refer to the PSoC1 Technical Reference Manual.

   

 

   

Drive mode has three bits. So each port has three registers to control the GPIO mode for each of its eight lines. SO you will have PRT0DM0, PRT0DM1 and PRT0DM2. For an output DM[2:0] should be 001 and for input DM[2:0] should be 010. For further information, you can do a text search in the Technical Reference Manual for "Drive Mode".

0 Likes