2
\$\begingroup\$

I am trying to implement the ISO 7816-3 protocol as can be found in the EMV Co. Book 1 using an ESP32 and MicroPython. However, I noticed that the default state of the I/O line is HIGH, and there's only a single I/O pin, which is two-way.

So, If both sides are listening, and sending a HIGH signal, how is either side supposed to detect a LOW signal? If one of the two switches the line from HIGH to LOW, there will still be 5v supplied to the line by the listening party.

Being a half duplex protocol is each party supposed to only output high at alternating cycles? Or is the idea to detect a current flow?

I feel like the answer to this is actually quite simple and I am missing something, possibly some hardware implementation detail that I am unaware of, but I couldn't find the answer in the interface requirements.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ The signal is pulled high by means of a pull-up resistor. Each device can pull the signal low by use of open drain or open collector transistor. \$\endgroup\$ Aug 20 '21 at 22:09
  • 2
    \$\begingroup\$ @MarkoBuršič Thank you very much! I had never heard of this single-wire two-way method; with a bit of digging in the MicroPython documentation I was able to set the I/O pin to open drain, and solve the issue. \$\endgroup\$
    – Iorpim
    Aug 20 '21 at 23:29
0
\$\begingroup\$

The lines are pulled high by the interface circuitry. The chip card or the transmitter can pull the line low when it wants to transmit. See page 11 of this datasheet: https://www.analog.com/en/products/ltc1755.html

\$\endgroup\$
0
\$\begingroup\$

The line is High "by default" aka a pull up resistor pulls the line high.

So the transmitter/receiver can pull the line low when they need to output LOW.

Implementation Example of I2C (TWI):

pullup image from here

If you dont see external resistors to such a system, it means that the MCUs can activate internal pull-up resistors on its own GPIOs and there is no need for external ones.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.