2026-05-31
The asker is integrating a Nuvoton MCU with the NXP TDA8035 smart card interface IC. They've stitched together reference code from Nuvoton, MCUXpresso, and Arduino, but the card never returns an ATR (Answer To Reset) — the very first byte sequence a card emits after activation. Without an ATR, no further ISO 7816-3 communication is possible.
Why this is interesting: The ATR failure mode is deceptively rich. The TDA8035 is an analog front-end that does level shifting, VCC sequencing, clock generation, and ISO 7816 activation/deactivation timing for you — but only if you drive its control lines in the right order and your UART-style I/O is configured correctly for the bizarre half-duplex, open-drain, inverse-convention world of smart cards. There are at least a dozen places for a beginner to go wrong silently.
A debugging flow chart, in priority order:
CMDVCC (active low) starts this; check that PWR/OFF is deasserted and PRES (card detect) reads inserted.XTAL/CLKDIV), RST go high after the warm-up, and then I/O transitioning. If CLK isn't toggling, no card will ever respond.F=372, D=1 initially, giving an etu of 372/f_clk. At 3.5712 MHz that's ~9600 baud, 8 data bits, even parity, 2 stop bits, half-duplex, open-drain. Forgetting parity or stop bits is the single most common cause of "no ATR."TS is either 0x3B (direct) or 0x3F (inverse). If you see garbage that looks bit-reversed and complemented, you're reading an inverse-convention card with direct decoding.Gotchas: Many TDA8035 dev boards omit the 1.8 µF VCC tank cap → unstable activation. The SAM_VCC level select pin must match the card class. And if the MCU's UART can't do 2 stop bits natively, you must emulate them or the card will see a framing error and never reply.
