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

cross mob
jdr
Level 1
Level 1
First reply posted First question asked First like given

Hello,

I'd like to wire Raspberry PI UART pins directly to UART pins of cy8ckit-059. Raspberry says PI has UART voltage 3V3 and connecting 5V may cause damage to GPIO. I would like to know what voltage level is present on cy8ckit-059 12_6 and 12_7 pins and if it's safe to connect it directly to Raspberry.  I supply power through USB connector (5V).

Thank you,

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

jdr,

 is correct about the Trick about using the SIO pins (port 12) as a voltage level shifter.

He provides a link to the "Tricks and Tips".  The specific "trick" is listed in Section 2 of the AppNote.

I've modified the UART example code to use port pins P12[5] for Tx and P12[4] for Rx from the CY8CKIT-059 board.

Using the level-shifting "trick", the Tx pin only has a top voltage of 3.3V and the Rx pin switches the input logic level at 3.3V/2.

With this project, you don't need external resistors to do the level shifting, you just need the PSoC5 kit powered to 5V and the Tx and Rx pins are level-shifted to 3.3V to talk to the Pi.

All you need to do is connect the PSoC Tx to the Pi Rx and the PSoC Rx to the Pi Tx.  On the Pi, you need to call up a Terminal program with 115.2Kbps 8N1.

Once you're happy with the results, you can use this UART example as a starting point for your PSoC coding.

 

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

4 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @jdr ,

The voltage levels for the GPIO on the 059 kit are 5V and they may damage your Raspberry Pi if used.
One solution would be for you to break out the board and provide 3.3V regulated Supply to the board via the VDD pin as mentioned in the kit guide.

AlenAn14_0-1639979401544.png

 

The other would be to use a voltage divider between the Raspberry Pi pins and the 059 kit pins to reduce the voltage to 3.3V.

Hope this helps.
Regards
Alen

BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

Under typical GPIO configuration, KIT-059 GPIO's would output 5V when the kit is powered from host USB port.  Yes, this will damage RaspPi port pins. 

The good news is, P12.6 and P12.7 can also be configured as SIO.  This means, the input and output voltage can be programmed.  See AN60580.
AN60580 - SIO Tips and Tricks in PSoC® 3 / PSoC 5LP (infineon.com)

Before connecting RaspPi to KIT-059, you should test the SIO output to ensure you've configured it correctly.  Use the usual GPIO function calls to set and clear the SIO configured port pin (5 seconds logic 1 and 5 seconds logic 0) and observe the output with a volt meter (assuming you have access to one).  If you still see 5V, go back and read the app notes.

An alternative to Allen's suggestion of using a resistor divider, is to use a voltage level translator chip in the CMOS family such as CD4050 and 74HC4050.  These can be powered from 3.3V and tolerate 5V on their inputs.

Good luck with your project.

lock attach
Attachments are accessible only for community members.
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

jdr,

 is correct about the Trick about using the SIO pins (port 12) as a voltage level shifter.

He provides a link to the "Tricks and Tips".  The specific "trick" is listed in Section 2 of the AppNote.

I've modified the UART example code to use port pins P12[5] for Tx and P12[4] for Rx from the CY8CKIT-059 board.

Using the level-shifting "trick", the Tx pin only has a top voltage of 3.3V and the Rx pin switches the input logic level at 3.3V/2.

With this project, you don't need external resistors to do the level shifting, you just need the PSoC5 kit powered to 5V and the Tx and Rx pins are level-shifted to 3.3V to talk to the Pi.

All you need to do is connect the PSoC Tx to the Pi Rx and the PSoC Rx to the Pi Tx.  On the Pi, you need to call up a Terminal program with 115.2Kbps 8N1.

Once you're happy with the results, you can use this UART example as a starting point for your PSoC coding.

 

Len
"Engineering is an Art. The Art of Compromise."
jdr
Level 1
Level 1
First reply posted First question asked First like given

Thank you all, awesome answers. 

0 Likes