cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

luro_4844141
New Contributor

Hi,

I need to use the same pair of pins to either terminate them in a UART:rx/tx (P6.0/6.1) or to (disconnect them from the UART and) connect them to an internal HW block, let's say a multiplexer, and I need to change this in run time. Everything I read and all the examples that I have gone through (for instance this: https://community.cypress.com/t5/Knowledge-Base-Articles/Controlling-UART-Tx-and-Rx-Pins-through-Fir... ) are not exactly what I want to do.

In production this will be done in Modus Toolbox, but to start with can you please explain and provide an example for PSoC Creator?

Thank you

 

0 Likes
2 Replies
Aashita_Raj
Moderator
Moderator

Hi @luro_4844141 ,

Can you please refer to the GPIO cell architecture from the image below ? Each physical pin is routed to different peripherals through a multiplexer or a demultiplexer which can be configured through HSIOM_PRTx_PORT_SEL register, where 'x' refers to the port number.

GPIO_cell.PNG

You can read in details for this in the device architecture TRM here : https://www.cypress.com/documentation/technical-reference-manuals/psoc-6-mcu-psoc-62-architecture-te... .

Also, Each physical pin is associated with multiple alternate functions about which you can read in the device datasheet : https://www.cypress.com/documentation/datasheets/psoc-62-cy8c62x8-cy8c62xa-datasheet  , as shown in the image below -

Aashita_Raj_0-1618760301229.png

So, you can use HSIOM_PRTx_PORT_SEL to manipulate between different pins. You can read about HSIOM register in the device register TRM here : https://www.cypress.com/file/421411/download.

Also, We have similar community threads. Can you please refer them in order  to understand more about the implementation of your application ?

Solved: PSoC62 SCB Interface Swap - Cypress Developer Community

Solved: Regarding output voltage when PWM_stop is called. - Cypress Developer Community  

Hope this helps! Please let us know in case of further queries.

Best Regards,

Aashita

 

 

 

0 Likes
luro_4844141
New Contributor

Hi,

I understand the concept but still there is something that I am missing because I can't get it to work. I am uploading a demo PSoC Creator project with the intended feature I need.
1. The UART is initially configured on Pins 6.0/6.1 and the MUX/DeMUX on Pins 9.0/9.1
2. Then I want to leave the UART "floating" and connects pins 6.0/6.1 to the MUX/DeMUX instead. In this mode I don't want to read or write the MUX/DeMUX pins by the CPU, what I want is that any signal coming in from the DeMUX input pin is routed to the MUX output pin.
3. Then I want to revert to the original configuration, with UART on Pins 6.0/6.1 and MUX/Demux on 9.0/9.1.

Can you please look at the code (all the code is implemented in the "main_cm4.c") and write  the implementation for steps STEP 2, STEP 3 and STEP 4? (I am assuming that what I did on STEP 1 is correct and enough to restore the original configuration).

(Note: I am using CY8C6247BZI-D54)
Thank you!

0 Likes
Top labels