I am realising ISO7816-3 SmartCard interface with level translator. I am using MCU LPC54608 and TXB0104 as level translator. Power level on smart card - 3.0V (Class B), voltage level on MCU - 3.3V. In future also need support Class A (5.0V) and Class C (1.8V). In MCU side I/O pin have pull-up resistor 100k, in SmartCard side pull-up 100k too.
I correct receive ATR, oscillograme of it (clock frequency 2MHz):
But, if I try to send data to interface, I see this (data byte 0xAA):
I see, that data transmited, but translator switch from 1 to 0 and locked in this state.
If I didn't setup "Smart Card Interface Enable" bit in SCICTRL register, I have this oscillograme:
Thus levels sets ok.
Also, in experiments with SC0IO pin (P0.20) in GPIO-mode, I made a state transition table:
So I conclude, that SC0IO in SmartCard mode work as Open-Drain. But open-drain pins (and L-Z pin-switching) - features of I2C or iButton interfaces, in ISO7816-3 this did not use!
Without TXB0104 and speed setup TA=0x96 (clock frequency 5MHz, etu value is 16) and pull up 100k, I have this oscillograme on transmit:
This confirms, that IO pin work in Open-Drain mode.
Questions:
SmartCard interface initialization example in attach.
If compare documentation on LPC11U and LPC54xxx familys, then we can see:
We see, that in LPC11Uxx SCIO pin (USART TXD) work as open-drain. In LPC54xxx this information didn't present. But my issue show that in LPC54xxx SCIO work as open-drain too.
It fact very important for choosing level translator.
Hello,
Please check below image, 20 Kohm resistors are recommended. For push-pull output you can change OD bit in IOCON registers. Here you will change pen-drain output or push-pull output.
Regarding the level translator, I am not expert in this matter so I recommend you to create a different question with a detail description in the community space below.
Best regards,
Felipe
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
This code:
// Program IOCON register to select the SCIn_IO function.
IOCON_PinMuxSet(IOCON, PORT_NUM__SMART_CARD_IO, PIN_NUM__SMART_CARD_IO,
IOCON_FUNC5 | /* Pin is configured as SCI0_IO */
IOCON_MODE_INACT | /* No addition pin function */
IOCON_DIGITAL_EN | /* Enables digital function */
IOCON_INPFILT_OFF | /* Input filter disabled */
IOCON_OPENDRAIN_EN /* TEST TEST TEST */
); /* I/O as SCIO */
and this:
// Program IOCON register to select the SCIn_IO function.
IOCON_PinMuxSet(IOCON, PORT_NUM__SMART_CARD_IO, PIN_NUM__SMART_CARD_IO,
IOCON_FUNC5 | /* Pin is configured as SCI0_IO */
IOCON_MODE_INACT | /* No addition pin function */
IOCON_DIGITAL_EN | /* Enables digital function */
IOCON_INPFILT_OFF | /* Input filter disabled */
); /* I/O as SCIO */
no effect, in SC-interface mode always Open-Drain mode! As I understand, in IOCON-mode FUNC5, OD-bit didn't actual .
In You picture 20k pull-up sets on SCLK. My question about SCIO-line.