cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

MiKO_283856
Contributor

Hi,

   

I'd like to interface the UART Tx output of a 4200 PSoC4 running on a 3.3V bus to a device fed with a 5V PS.  I don't want to use a level translator.

   

Is there a way to reconfigure the Tx pin as an Open Drain (and reverse the logic) as the pin is chosen by the fitter, so I have no direct access to its configuration.

   

May be changing the corresponding registers  by software?

   

 

   

Michel 

0 Likes
Reply
11 Replies
odissey1
Honored Contributor II
        For interfacing 3.3V and 5V digital levels you can use SIO pins as described in Cypress AN60580 http://www.cypress.com/documentation/application-notes/an60580-sio-tips-and-tricks-psoc-3-psoc-5lp?s... But I would try to connect them directly first - it might work (add some resistors in series for protection) odissey1   
0 Likes
Reply
JoMe_264151
Expert II

You can access the pin (and re-program it) using its pin-component in the generated sources.

   

 

   

Bob

0 Likes
Reply
Anonymous
Not applicable

PSoC 4 does not have SIO pins. PSoC 4M   have pins which are over-voltage tolerant, specifically useful for I2C as you need now.

   

If you are using SCB UART, then the pins are hidden in the component and you cannot change the drive mode of the component. But you have some level of flexliblity to assign the SCB pin. By default, the drive level will be Open Drain drive low.

   

If you are using UDB UART, then the pins will be populated out in topdesign. You can change the drive mode.

   

In either case, if you use an external  pull up with 5V, it will back power PSoC.

   

-Keerthi

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

If you are using SCB UART, then the pins are hidden in the component and you cannot change the

   

drive mode of the component.

   

 

   

Question, are you sure thru reg writes you cannot change the pin parameters ? I would

   

assume the component assigns the parameters at startup of the module and then moves on

   

to its other functionality.

   

 

   

Regards, Dana.

0 Likes
Reply
Anonymous
Not applicable

In my project I want to drive circuit which tolerate lower voltage. And I would like to change Tx pin to resistor pull up. It's possible to do it with UART by directly driving into Port register. But at startup original config is wirtten, which damage the circuit before I change pin configuration.

   

Is there a example Project which use unconfigured SCB block which turns it in custom UART?

0 Likes
Reply
Anonymous
Not applicable

On the other hand unconfigured SCB uses much more resources. It seems really akward to turn into unconfigured SCB for such tiny change

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

Route the pin back into the part on another pin, and then back out thru a

   

gate/mux to a pin you config per your requirements. Kind of a waste of 2

   

pins, but if you have them one solution.

   

 

   

Regards, Dana.

0 Likes
Reply
JoMe_264151
Expert II

You will find a file named UART_tx.h where some functions are defined to access the Tx pin (whichever that is)

   

Check/search for "Drive Modes" and you will see the prototypes and constants to set the pin's mode.

   

 

   

Bob

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

When you start UART the component initializes pins, so for that time until

   

you update pins you have the drive mode you are trying to avoid that you

   

state will cause damage. So that's not a solution unless the affected downstream

   

device can handle improper drive for some length of time.

   

 

   

That's the issue you stated earlier ?

   

 

   

Regards, Dana.

0 Likes
Reply
MiKO_283856
Contributor

Hi to all, many thx for the proposed solutions.

   

I should say I have given up and finally used a lever translator (ADG330x in my case), PCB had room for.

   

However reading your comments it seems there is no straightforward or easy workaround to this problem.

   

Michel

0 Likes
Reply
ETRO_SSN583
Esteemed Contributor

A translator is the best approach. The principle problem(s) are twofold,

   

the 5V side trying to overdrive the 3V side, and 3V side not meeting

   

good noise margin at logic "1" into 5V side. The former can be solved

   

with a series R, at expense of speed, but that does nothing for the latter

   

problem.

   

 

   

An approach with an Open Drain out and pullup also suffers from logic

   

"1" noise margin on 5V side, all due to protection diodes on 3V side.

   

 

   

You can google level translation, there are a number of approaches.

   

 

   

Translator best answer.

   

 

   

Regards, Dana.

0 Likes
Reply