cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6 MCU

JeHu_3414236
Contributor II

I want to use UART in smartcard mode which connects to another chip requiring a TX/RX pin and a clock pin.  How do I configure the clock pin to be output to the other chip?  PSoC Creator creates a rx_tx pin only.  Also the other chip supports T=0 and T=1 mode.  What mode does PSoC support?

0 Likes
1 Solution
Len_CONSULTRON
Honored Contributor II

JeHu,

The NXP datasheet gives you much of the necessary information.

pastedImage_0.png

By the example given in the datasheet, if you use CLK = 1.5MHz and Fi=372 (who knows where that comes from) and Di = 1 (again who knows) then your UART needs to be set to 4032 baud 8N1.

Len

Here's a circuit that should implement the physical protocol at 4032 baud (bps).   You have to come up with the SW for the protocol.

pastedImage_0.png

Attached is a Creator project.

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

View solution in original post

0 Likes
6 Replies
Len_CONSULTRON
Honored Contributor II

JeHu,

Do you have a smartcard interface spec to work with?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
JeHu_3414236
Contributor II

I am trying to duplicate the smartcard reader function from this document:

https://www.nxp.com/docs/en/application-note/AN4453.pdf

0 Likes
Len_CONSULTRON
Honored Contributor II

JeHu,

I looked at the NXP spec.  Sadly, they don't show the timing relationship of the CLK to I/O.

Looking over the document, I believe a two-wire SPI comm is a better fit.

You can set up the SCB to SPI with half-duplex (SPI_MOSI tied to SPI_MISO becomes I/O) and pass the SPI_CLK becomes CLK.

Since NXP did not specify the relationship of CLK to I/O timing, you'd have to empirically determine the CPOL of the SPI.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Ekta
Moderator
Moderator

Hello JeHu_3414236

In order to get a clock output from the PSoC, you can use a T Flipflop and provide it with a clock that is twice the required clock output.

Something like shown in the figure below:

pastedImage_0.png

In the above case you can route the PWM_Clk to a GPIO pin. Connect the clock input of the other chip to this GPIO to get the required clock.

Best Regards

Ekta

0 Likes
JeHu_3414236
Contributor II

Do I need to use the same clock for the other chip as input to the PSoC UART so both sides are synchronized?  If so how do I do it?  I can select the Enable Clock from Terminal option for UART to enable an input port but I don't know how to connect either Clock_1 or PWM_Clk to it.

0 Likes
Len_CONSULTRON
Honored Contributor II

JeHu,

The NXP datasheet gives you much of the necessary information.

pastedImage_0.png

By the example given in the datasheet, if you use CLK = 1.5MHz and Fi=372 (who knows where that comes from) and Di = 1 (again who knows) then your UART needs to be set to 4032 baud 8N1.

Len

Here's a circuit that should implement the physical protocol at 4032 baud (bps).   You have to come up with the SW for the protocol.

pastedImage_0.png

Attached is a Creator project.

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

View solution in original post

0 Likes
Top labels