Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Manually driving pins which are also used for I2C

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Manually driving pins which are also used for I2C
Moderator:
ANCY

Post Reply
Follow this topic



Manually driving pins which are also used for I2C

KennyMillar posted on 08 Nov 2011 3:49 PM PST
Top Contributor
25 Forum Posts

 A device I am working requires that I can manually drive the same 2 lines that are connected to an I2C Fixed Function Block.

I have a fixed function I2C Slave block connected to a 2-pin Bidirectional 'Pins' component.

The device it is connected to sends a message by I2C then goes into a passive state, tri-states it's two lines and waits for a specific signal shape on the 2 lines.

I have attached a picture of the scehmatic from Psoc Creator.

In order to communicate with this device, my PSoC 5 design has the I2C Slave block as described above, and when the special message is received I want to be able to drive the 2 lines which are used for SCL and SDA in a specific sequence.

I see that there are APIs generated for the 2 pins, and for the pin block, but when I use the generated API's I do not see any output on the pins - they seem to be constantly driven  high, even if I do: RPC_PINS_Write(0x00);

I tried connecting a MUX but the fitter gave an error saying there were multiple drivers on the line. Probably becuase the pins are bi-directional.

Is there anyway to drive the SCL and SDA lines directly? Can I change my schematic in some way that the I2C will work, then I can disable it and drive the lines directly?

 




Re: Manually driving pins which are also used for I2C

Gautam Das posted on 09 Nov 2011 09:12 PM PST
Cypress Employee
742 Forum Posts

Hi KennyMiller,

 

Using of MUX would not have worked in this case as the I2C pins are bidirectional whereas digital MUX terminals are unidirectional (from input to output only, depending upon the select lines chosen).



Re: Manually driving pins which are also used for I2C

Gautam Das posted on 10 Nov 2011 10:13 PM PST
Cypress Employee
742 Forum Posts

The Bypass Register PRT_BYP for a Port is used to determine if the output is from the data output register or internal sources such as digital global bus.

 

If the bit is set to '1', then digital system interconnect (DSI) drives the corresponding port pin.

If set to '0', then the Port Logic Data Register drives the corresponding port pin.

 

The drive mode should be set to "Strong Drive" when used as output. The code snap shot is as shown below. The pins are toggled in this example.

 

 



Re: Manually driving pins which are also used for I2C

Gautam Das posted on 10 Nov 2011 10:16 PM PST
Cypress Employee
742 Forum Posts

The sample project is attached along with this comment.



Re: Manually driving pins which are also used for I2C

KennyMillar posted on 13 Nov 2011 03:08 PM PST
Top Contributor
25 Forum Posts

 Thank you, dasq, that was very helpful.

-Kenny



Re: Manually driving pins which are also used for I2C

Gautam Das posted on 14 Nov 2011 10:36 PM PST
Cypress Employee
742 Forum Posts

You're welcome 



Re: Manually driving pins which are also used for I2C

PSoC Lover posted on 13 Dec 2012 09:27 PM PST
Member
8 Forum Posts

 Hi Dasg,

Could you tell me why you are setting it into strong mode here? Can't we use it as an output pin in open drain configuration itself?

 



Re: Manually driving pins which are also used for I2C

Gautam Das posted on 18 Dec 2012 10:31 PM PST
Cypress Employee
742 Forum Posts

Hi PSoC Lover,

 

Yes, you can use the pins in Open drain Drive Low / High configuration too.

In the code snippet above, I assumed that KennyMillar wants to be able to drive the pins both High and Low.

 

If open drain configuration is used, then Pull-up or Pull-down resistors should be used depending upon whether the pin are in open drain drive low or drive high configuration.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20