Test & Measurement


Debugging smartcards using a logic analyser

12 June 2013 Test & Measurement

Figure 1. An assortment of smartcards.
Figure 1. An assortment of smartcards.

A smartcard, chip card, or integrated circuit card (ICC), is any pocket-sized card with embedded integrated circuits which can process data.

This implies that it can receive input which is processed – by way of the ICC applications – and delivered as an output.

There are two broad categories of ICCs: memory cards contain only non-volatile memory storage components and perhaps some specific security logic, while microprocessor cards contain volatile memory and microprocessor components. The card is made of plastic, generally PVC, but sometimes ABS. It may embed a hologram to avoid counterfeiting.

Figure 2. Connections to a smartcard reader.
Figure 2. Connections to a smartcard reader.

Using smartcards is also a form of strong security authentication for single sign-on within large companies and organisations.

Table 1 describes the contacts of a smartcard and Figure 2 shows a typical smartcard reader which is sold on the market.

Table 1. Smartcard connections.
Table 1. Smartcard connections.

Measurement of ISO 7816 signals with a logic analyser

Figure 3. Protocol interpreter interface for smartcard ISO 7816 protocol.
Figure 3. Protocol interpreter interface for smartcard ISO 7816 protocol.

There are eight contacts on the smartcard in total. It is necessary to connect only three of them (clock, ground and I/O) to the Zeroplus logic analyser when measuring. All Zeroplus logic analysers come with 30 to 60 free protocol interpreters; one of these is the ISO 7816 protocol for communicating with smartcards. The captured waveform on a Zeroplus LA is displayed in Figure 3.

The signal structure of ISO 7816 is similar to that of RS-232C, the difference being that ISO 7816 relies on the clock to synchronise the data while RS-232C uses the baud rate of its signal to synchronise the data. ISO 7816 takes the 16 bits of clock as one unit to start sampling data – see Figure 4.

Figure 4. Analysis of the clock start bit and preamble.
Figure 4. Analysis of the clock start bit and preamble.

As shown in Figure 5, after the clock signal after the start bit has generated 16 cycles (1 ETU), it is time to look for the data; the data packet is analysed in the same way.

Figure 5. Analysis of the whole ISO 7816 packet.
Figure 5. Analysis of the whole ISO 7816 packet.

The format of the signal packet consists of the Start (1 bit), Data (8 bits), Parity Check (1 bit) and Stop (2 bits). Each bit on the data line needs to appear for 16 clock cycles (1 ETU) on the clock line, and the transmission direction of the data is fixed, which is LSB to MSB.

Setting up any protocol interpreters for the Zeroplus LA is made very simple by an intuitive user interface and context-specific menus. Only four properties in two categories need to be specified:

Pin assignment: Setting channel DATA and CLK;

Protocol analyser property: Set the periods of the clock as 1 bit in the ISO 7816 signal. The default is 16 periods, and the maximum can be set as 2048 periods.

Figure 6: Setting up the protocol analyser for ISO 7816 UART in the Zeroplus logic analyser software interface.
Figure 6: Setting up the protocol analyser for ISO 7816 UART in the Zeroplus logic analyser software interface.

Figure 6 displays a screenshot of how to configure the interpreter for the ISO 1786 protocol.

Conclusion

The bottom line for the engineer or the manager is that using a logic analyser with a built-in protocol interpreter for the specific serial bus they are working on, like the Zeroplus logic analysers, will save a lot of time, very quickly paying for the cost of the analyser.

Gone are the days when an engineer can afford to sit for hours decoding digital busses on an oscilloscope. That is simply unproductive when there are logic analysers that can do that job in seconds and are affordable for the individual and small company. It simply does not make financial sense to debug today’s complex serial busses using yesterday’s methods.

As with all our other products at K Measure, we tell our new customers to bring it back for a guaranteed, no-questions-asked refund if the tool they buy does not save them time or cannot do what they expected. We have not had a single customer using that privilege in the full five years we have been selling Zeroplus’ logic analysers.

For more information contact K Measure, +27 (0)87 230 0134, [email protected], www.kmeasure.co.za



Credit(s)



Share this article:
Share via emailShare via LinkedInPrint this page

Further reading:

Single channel, programmable PSU
Electrocomp Express Test & Measurement
Rohde & Schwarz’ NGC101 is a NGC100-series power supply with a wide range of functions that make them ideal for use in development labs and industrial environments.

Read more...
Next-gen LineScan camera
Eagle Africa Technology Test & Measurement
New Imaging Technologies has launched the new LiSaSWIR, its next-generation SWIR LineScan camera and sensor.

Read more...
Ultra-portable spectrum analyser
Vepac Electronics Test & Measurement
The PXN-400Z from Harogic is a handheld spectrum analyser covering a frequency range of 9 kHz to 40 GHz with a 100 MHz analysis bandwidth.

Read more...
Why your next oscilloscope should be PC-based
Comtest Test & Measurement
For decades, traditional benchtop oscilloscopes have been a cornerstone of engineering, offering reliability, precision, and familiarity. However, as technology evolves, so do the tools we rely on.

Read more...
Versatile 3-in-1 instrument
Vepac Electronics Test & Measurement
The ARB Rider AWG-2000 is the cost-effective and powerful two or four channel arbitrary function generator and two or four channel arbitrary waveform generator with advanced sequencer functionality.

Read more...
Analyser and voltmeter capability added to portable instruments
Tamashi Technology Investments Test & Measurement
Anritsu Company had added Vector Network Analyzer and Vector Voltmeter measurements to their industry standard Site Master instruments.

Read more...
Marktech’s latest LEDs and photodiodes
NuVision Electronics Test & Measurement
Designed for precision sensing and emission tasks, Marktech’s optoelectronic lineup serves medical, industrial, aerospace, and environmental markets.

Read more...
MEMS air quality sensor
Future Electronics Test & Measurement
Bosch Sensortec’s BME690 is the latest-generation gas sensor that combines advanced monitoring capabilities with innovative artificial intelligence functionality.

Read more...
Telemetry retrofit for sustainable resource management
CST Electronics Test & Measurement
AquaMeter is a cost-effective secure telemetry retrofit that can easily be added to hundreds of millions of legacy mechanical water meters.

Read more...
True-RMS clamp meter measures 2500 A
Comtest Test & Measurement
The Fluke 376 FC True-RMS Clamp Meter with iFlex is the most advanced troubleshooting tool for industrial and commercial electricians.

Read more...









While every effort has been made to ensure the accuracy of the information contained herein, the publisher and its agents cannot be held responsible for any errors contained, or any loss incurred as a result. Articles published do not necessarily reflect the views of the publishers. The editor reserves the right to alter or cut copy. Articles submitted are deemed to have been cleared for publication. Advertisements and company contact details are published as provided by the advertiser. Technews Publishing (Pty) Ltd cannot be held responsible for the accuracy or veracity of supplied material.




© Technews Publishing (Pty) Ltd | All Rights Reserved