Silicon ChipAt Last . . . An Affordable Logic Analyser - September 2009 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Low sunspot activity presages solar cooling
  4. Project: High-Quality Stereo Digital-To-Analog Converter, Pt.1 by Nicholas Vinen
  5. Project: Using A Wideband O₂ Sensor In Your Car, Pt.1 by John Clarke
  6. Feature: Introducing OLED Displays by Mauro Grassi
  7. Review: At Last . . . An Affordable Logic Analyser by Geoff Graham
  8. Feature: Pebble: PICAXE Electronic Bread Board Layout Emulator by Wayne Geary
  9. Project: Build A Simple Seismograph On A Protoboard by Stan Swan
  10. Project: Autodim Add-On For The 6-Digit GPS Clock by Jim Rowe
  11. Project: 3-Channel UHF Rolling-Code Remote Control, Pt.2 by John Clarke
  12. Vintage Radio: The Kellogg TRF receiver by Rodney Champness
  13. Book Store
  14. Advertising Index
  15. Outer Back Cover

This is only a preview of the September 2009 issue of Silicon Chip.

You can view 33 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "High-Quality Stereo Digital-To-Analog Converter, Pt.1":
  • 4-Output Universal Regulator PCB [18105151] (AUD $5.00)
  • High-Quality Stereo DAC Input PCB [01109091] (AUD $10.00)
  • High-Quality Stereo DAC main PCB [01109092] (AUD $10.00)
  • High-Quality Stereo DAC front panel PCB [01109093] (AUD $7.50)
  • ATmega48 programmed for the Stereo DAC [0110909A.HEX] (Programmed Microcontroller, AUD $15.00)
  • ATmega48 firmware and C source code for the Stereo DAC [0110909A.HEX] (Software, Free)
  • Stereo DAC Digital/Control board PCB pattern (PDF download) [01109091] (Free)
  • Stereo DAC Analog board PCB pattern (PDF download) [01109092] (Free)
  • Stereo DAC Switch board PCB pattern (PDF download) [01109093] (Free)
Articles in this series:
  • High-Quality Stereo Digital-To-Analog Converter, Pt.1 (September 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.1 (September 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.2 (October 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.2 (October 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.3 (November 2009)
  • High-Quality Stereo Digital-To-Analog Converter, Pt.3 (November 2009)
  • A Balanced Output Board for the Stereo DAC (January 2010)
  • A Balanced Output Board for the Stereo DAC (January 2010)
Items relevant to "Using A Wideband O₂ Sensor In Your Car, Pt.1":
  • PIC16F88-I/P programmed for the Wideband Oxygen Sensor Controller [0511009A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the Wideband Oxygen Sensor Controller [0511009A.HEX] (Software, Free)
  • Wideband Oxygen Sensor Controller PCB pattern (PDF download) [05110091] (Free)
Articles in this series:
  • Using A Wideband O₂ Sensor In Your Car, Pt.1 (September 2009)
  • Using A Wideband O₂ Sensor In Your Car, Pt.1 (September 2009)
  • Using A Wideband O₂ Sensor In Your Car, Pt.2 (October 2009)
  • Using A Wideband O₂ Sensor In Your Car, Pt.2 (October 2009)
Items relevant to "Autodim Add-On For The 6-Digit GPS Clock":
  • 6-Digit GPS Clock Autodim Add-On PCB [04208091] (AUD $5.00)
  • 6-Digit GPS Clock Driver PCB [07106091] (AUD $15.00)
  • 6-Digit GPS Clock Main PCB [04105091] (AUD $25.00)
  • PIC16F877A-I/P programmed for the 6-Digit GPS Clock [0410509E.HEX] (Programmed Microcontroller, AUD $20.00)
  • PIC16F877A firmware and source code for the 6-digit GPS Clock [0410509E.HEX] (Software, Free)
  • 6-Digit GPS Clock Autodim Add-On PCB pattern (PDF download) [04208091] (Free)
Items relevant to "3-Channel UHF Rolling-Code Remote Control, Pt.2":
  • PIC16F88-I/P programmed for the 3-Channel Rolling Code UHF Remote Control Transmitter [1500809A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88-I/P programmed for the 3-Channel Rolling Code UHF Remote Control Receiver [1500809B.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88 firmware and source code for the 3-Channel UHF Rolling Code Remote Control [1500809A/B.HEX] (Software, Free)
  • 3-Channel UHF Rolling Code Remote Control Transmitter PCB pattern (PDF download) [15008091] (Free)
  • 3-Channel UHF Rolling Code Remote Control Receiver PCB pattern (PDF download) [15008092] (Free)
  • 3-Channel UHF Rolling Code Remote Control Receiver front panel artwork (PDF download) (Free)
  • 3-Channel UHF Rolling Code Remote Control Transmitter front panel artwork (PDF download) (Free)
Articles in this series:
  • A 3-Channel UHF Rolling-Code Remote Control, Pt.1 (August 2009)
  • A 3-Channel UHF Rolling-Code Remote Control, Pt.1 (August 2009)
  • 3-Channel UHF Rolling-Code Remote Control, Pt.2 (September 2009)
  • 3-Channel UHF Rolling-Code Remote Control, Pt.2 (September 2009)

Purchase a printed copy of this issue for $10.00.

At Last... Review by Geoff Graham An AFFORDABLE Logic Analyser If you ever yearned for a logic analyser you will know how expensive they can be, with professional units costing $5,000 or more. The good news is that a new crop of more affordable devices is becoming available and a good example of these is the Logic, from US company Saleae. It costs just US$149 and even after Australian dollar conversion that price is very attractive. 40  Silicon Chip siliconchip.com.au Fig.1: this screen shot shows a typical capture without analysing the data streams. You can type your own labels to identify the signals into the boxes on the left. The buttons down the left let you select the trigger conditions. Logic can monitor eight signals. Each input is supplied with gripping type probes to hold onto IC pins. The colours used for the wires matches the colours used in the software to identify the inputs. W hat do you get for your money? Logic has eight channels that can record millions of samples at up to 24MHz. You also get a software package that includes decoders for I2C, SPI, serial (eg, RS232) and other data streams. It communicates with your computer via USB and it uses your computer to do the analysis and display. Logic analysers If you are new to digital circuits then you may not know just what a logic analyser is and why you might need one. Simply put, a logic analyser is like a multi-channel oscilloscope that displays logic levels (ie, high voltage or low voltage) rather than tracing the actual voltage. So why not just use an oscilloscope? Because a logic analyser is optimised for investigating digital circuits, it has multiple channels, making it easy to measure timing differences and it can decode the data streams that are transmitted and received. Let’s say that you are developing a circuit which uses a microcontroller and a chip that communicates via SPI (Serial Peripheral Interface). Many chips use SPI to communicate, including memories, displays, accelerometers and sensors. You dutifully read the data sheets, build a prototype, write the code and… it does not work. Hmm... what next? SPI uses four data lines to communicate. These are chip enable, clock, data in and data out. So you pull out your oscilloscope and check the various lines and observe “something” on each line. The first problem is that the signal is fleeting. There might be a burst of data when the program initialises but then nothing. With most oscilloscopes you need a repetitive signal to keep the trace on the screen long enough for you to see what is going on. Another issue is that most oscilloscopes are restricted to two inputs and while they can show you parameters such as the pulse rise time, clock speed and voltages, they say nothing about the data being transmitted on the lines. So, while you see something, you are not sure what it means. This is where the logic analyser comes in. It has multiple channels so that you can simultaneously watch all four data lines. It will store the trace data in its memory so that you can catch that brief burst of data and it will decode the data so that you can see just what is being sent. If you look at Fig.2, the top four lines show a captured SPI communication. The top line is Enable, the next is Fig.2: this is the same logic trace shown above with two of the analysers turned on. The upper four traces represent an SPI interchange while traces 6 and 7 are a decoded I2C stream. The software shows the value of the data byte in a coloured bubble. siliconchip.com.au September 2009  41 Fig.3: this screen shot shows the Logic software with the cursor pointing to part of a trace. In the bottom right hand corner you can see the related measurements. For example, the width of the pulse is a little over 29 S. the clock, then data in and finally data out. The coloured bubbles show the value of the data being sent. So now you can ask yourself, is this data stream correct? Does the timing match the data sheet? Is this what I was expecting? Because a logic analyser will capture the whole conversation, you can scroll back and forth through the data at your leisure – from the first initialisation through to the end. data directly down the USB interface to the computer. Your computer saves this data stream in memory and when the capture is complete, displays the result. Using your computer to do most of the processing is one of the secrets behind the low price. Having only eight input lines is one aspect where the Logic does restrict you. For example, many displays have an 8-bit bus and six control lines and it would be nice to monitor them all. Expensive logic analysers with 32 bits of input can do this and offer other frills such as being able to set the threshold voltage on the inputs. Logic Performance Despite its confusing name, Logic has a lot going for it. For a start, it has been designed with a sense of aesthetic values. The entire device is embedded in a small block of what looks like solid aluminium engraved with the product name. At one end is the USB connector and at the other end a 9-pin connector for the eight inputs and ground. The software is slick, with translucent effects that mimic the look and feel of Vista. The analyser works by grabbing the current logic level on its eight input lines and pumping that Because Logic has minimal buffering, its performance is very dependent on the speed of the USB interface. With a modern, fast computer and little traffic on other USB ports you should be able to capture data at the maximum of 24Mbits/sec. This speed is not guaranteed however and if the USB interface cannot keep up, the analyser will drop back to slower speeds. At 24Mbits/sec the analyser will sample the input lines Fig.4: logic analysers are good for showing the relationship between different signals. In this case the software has calculated that the difference between the falling edges of D1 and D3 (marked with timing markers T1 and T2) is 1.875μS. Sometimes knowing a detail like that can make the difference between getting a circuit to work or not. 42  Silicon Chip siliconchip.com.au every 42 nanoseconds. In practice, this means that you can use it to analyse circuits that are being clocked up to 15MHz or so. This covers most microcontrollers that hobbyists are likely to use. Even fast chips like the PIC18F2550 can only toggle their outputs at a maximum of 12MHz. Having said that, there are faster chips out there, like the new 32-bit series from Microchip that can toggle their outputs at 80MHz. Because your computer is used to store the captured data you can record a very large number of samples. This is a great plus and something that is not available in a standard logic analyser which generally has a limited amount of internal memory. As an example, with a capture speed of 12MHz this device can capture up to 82 seconds of data (50 million samples). This means that you can set the analyser to trigger at power on and capture everything that happens for the next 90 seconds. This is invaluable if you want to investigate an event that only happens once and a long time after power up. Compare that with an oscilloscope that can only show you something that happened a few thousandths of a second after the trigger point. Logic will also capture the activity on its inputs immediately before the trigger, so you can go backwards in time to see what led up to the trigger. Fig.5: a handy feature is that you can select from a wide range of sampling speeds and sample sizes. Because the software uses your computer’s hard disk to save the data it can record a considerable number of samples. Software Because Logic leaves most of the complex processing to your computer, the software and its usability become quite important. This is an area where the cheaper manufacturers often fall behind; they may produce good hardware at a good price but frequently the software is a disappointment. Not so with the Logic. The software is full featured and easy to use. The screenshots show you what the software looks like. In keeping with the careful design of the product the colour coding of the labels matches the colour of the wires in the probes. You can also type in your own labels to identify the signals. Sampling speed and depth is selected by buttons across the top while triggering is selected by the buttons down the left. The trigger conditions are quite flexible and allow you to trigger on a combination of high/low levels as well as rising/falling edges on all inputs. You can easily zoom in to see details or out to see the whole picture. You can also quickly scroll forwards and back through time by clicking and swiping your mouse sideways. Parameters such as pulse width, frequency and duty cycle can be read by pointing with the mouse. You can also drag and position two markers to make accurate timing measurements. Menu functions allow you to export and import the data in various formats. You can also save the data and later reopen it. This allows you to work with the captured data just as if you were still connected to the circuit under test. Analysers The software has the ability to decode a number of common protocols used for communications between “intelligent” components. These include I2C, SPI, serial siliconchip.com.au (eg, RS232) and one-wire protocols. This shows just how good a value this device is. Many brand-name logic analysers make you pay hundreds of dollars for the software module to decode just a couple of these protocols – and that is more than the complete price of this logic analyser including the hardware. Using the analysers is reasonably simple; you just specify what signals are on what inputs, select some options and the software will draw an overlay over the display showing the values of the data transmitted/received. You can also use a number of analysers to track multiple communications simultaneously. If you would like to test the program and the analysers before committing you can download the software from the manufacturer (address below) and run it in simulation mode. At the moment it is available for Windows only but Macintosh and Linux versions are reportedly in development. Summing up Having access to a logic analyser can save you untold hours of frustration when debugging digital circuits. And Logic is just the tool to save you that frustration. It is fast, easy to use and does the job without any fuss. As you might expect, it does have some weak points. Eight bits of input is rather limiting, it is dependent on the speed of your USB and it is missing some nice points that a more expensive logic analyser would have. For US$149 (less than $AU190 at press time) you cannot hold these points against the Logic. It is great value and will do 95% of what a hobbyist would need. If you are working with digital circuits you should have a logic analyser and if you are on a limited budget then this little gadget is recommended. Logic is available from the manufacturer, Saleae at www. saleae.com or from SparkFun at www.sparkfun.com SC September 2009  43