cancel
Showing results for 
Search instead for 
Did you mean: 

Knowledge Base Articles

Using I 2C Pin with LVTTL Logic Input in PSoC® 4 – KBA223289

Employee

Using I 2C Pin with LVTTL Logic Input in PSoC® 4 – KBA223289

Version: **

Translation - Japanese: PSoC®4でI 2CピンをLVTTLロジック入力で使用する – KBA223289 - Community Translated (JA)

Question:

Is it possible to have the input of I2C with LVTTL logic instead of CMOS logic in the PSoC 4 device?

Answer:

It is possible even though it is not direct. You must do this through a register write rather than any component settings modification. Refer to section "7.3.1 Digital Input Buffer" in the PSoC 4 Architecture TRM for information on the register that chooses the threshold between CMOS or LVTTL. The register name is GPIO_PRTx_PC. The PORT_VTRIP_SEL bit (GPIO_PRTx_PC[24]) decides the mode.

Note that this setting is for a Full Port. This means all the pins of that port will have the same threshold.

We can set this bit of the I2C port to 1 to make it LVTTL. We can use the CY_GET_REG32 macro to set only that bit.

This can be done with one extra line of code.

CY_SET_REG32(CYREG_GPIO_PRT3_PC, CY_GET_REG32(CYREG_GPIO_PRT3_PC)|0x01000000);

This is assuming Port 3 pins are used for I2C. The register name should be changed according to the use case.

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎Mar 16, 2018 01:40 AM
Updated by:
 
Contributors