20 Band Audio Spectrum Analyzer
February 26th, 2011

Audio Spectrum Analyzer V2.1

I’ve been pretty busy lately working on the latest spectrum analyzer V2.1. Its available in the online shop if you are interested in getting one. Here are some videos bellow with the new blue LED’s and with a half green/half red display.

You need to a flashplayer enabled browser to view this YouTube video You need to a flashplayer enabled browser to view this YouTube video

I have also been working on the new expansion board pictured bellow. The Expansion Board was created to help you create bigger custom displays for the Spectrum Analyzer. The Expansion Board works by switching the signals from the spectrum analyzer with the help of high current MOSFET transistors thus giving you the possibility to output higher voltages and currents for your custom setup. You can read more about it on the forum.

spectrum_analyzer_expansion_board

There is also a new assembly guide for the audio spectrum analyzer V2.1 that will be helpful to those that get the kit unassembled.

February 6th, 2011

XMEGA Xprotolab Review

Xmega xprotolab gabotronic

When Gabriel Anzziani from gabotronics.com asked me if I would like to do a review of the XMEGA Xprotolab I said yes because although these small devices cannot replace a real tool in an electronics lab, they often serve as development boards for the devices used on them. The Xprotolab is a miniature mixed signal oscilloscope and waveform generator packed in a DIP module which makes it great for breadboards. It has a nice set of features for such a small device:

for oscilloscope mode:

  • 2 Analog Channels, 8 Digital Channels
  • Maximum Sampling rate: 2MSPS
  • Analog Bandwidth: 320kHz
  • Resolution: 8bits
  • Input Impedance: 1MΩ
  • Buffer size per channel: 256
  • Max. Input Voltage: +/- 10V

for arbitrary waveform generator:

  • 1 Analog Channel
  • Maximum conversion rate: 1MSPS
  • Analog Bandwidth: 44.1kHz
  • Resolution: 8bits
  • Low output impedance
  • Buffer size: 256
  • Max. Output Voltage: +/- 2V

The hardware is based on a ATXMEGA32A4 coupled with a Graphic OLED display 128×64 pixels and a TL064 quad op-amp for the analog side. What is not mentioned on the product page is that it also has FFT, Meter mode with voltage and frequency, X-Y mode and a logic analyzer. Sound nice but lets put it to the test and see how it performs.

First thing I wanted to test on the xprotolab is the meter mode; I think for beginners who build breadboard circuits it will be a very useful feature because you could use your multimeter to check some voltage or current while you use the xprotolab to check another voltage or frequency. Every electronics lab should have at least 2 meters to serve this purpose but if you’re a beginner its most likely you only have one. I must tell you that Gabriel was very helpful when I discovered some bugs in the firmware and he corrected them within hours. Unfortunately it is a work in progress and I could find other bugs even after upgrading. The firmware version used during tests is 0.95.

So to start testing I placed the xprotolab on a mini breadboard and supplied power at 5V. First thing to notice is the OLED display which is a very good choice for this application and provides nice & crisp display with good contras. The menu is not difficult, it takes about 10 mins to get used to it and learn what each menu/key press does. After switching to meter mode (VDC) I applied a 3.3V voltage through a 10k series resistor to CH1 and CH2. With both channels connected to the same signal at the same time CH1 was reporting 3.22V and CH2 3.28V while my multimeter was reporting 3.24V so CH1 was off by -0.02 compared to the multimeter while CH2 was off by +0.04. A slight offset between channels can be noticed ~0.06V. The firmware has an offset compensation feature which can be accessed by holding key 4 during power on.

xprotolab meter mode CH1 and CH2

After entering the offset menu it will ask you to ground all inputs and press start. I did that.. it acquired the new offset values and I continued using into meter mode to see how it affected the results. Connected to the same signal as earlier CH1 was now showing 3.19 V which is off with -0.03 compared to the multimeter but the surprise is that CH2 is not taking any measurements, its just stuck after the offset compensation. As you can see the values are pretty close to what the multimeter was reporting and really a 0.02 offset is not a big deal in most applications, but the software has a bug that’s preventing CH2 from taking measurements after the offset compensation. To fix this I just re-flashed the EEPROM and CH2 started working on meter mode again.

Next I tried the frequency measurement. I used a signal generator with a sine wave and the xprotolab was able to detect frequency down to 10Hz and up to 500KHz which is pretty good for a device so small and inexpensive. Next I tried the VPP meter mode which was able to detect values on a sine wave up to 100KHz, any frequency higher and the measurement got all weird.

Next test was on scope mode, and I was able to get a clean and accurate reading on CH1, up to 100KHz sine wave. Anything higher than 100KHz caused false readings and I could notice the amplitude going down.
I also did tests with square and triangle wave shapes and the results were the same. I did not have enough time to review the other features like the arbitrary waveform generator or the logic analyzer but I’m sure I’ll use it somewhere in a future project cause if you remember I wrote a post about how nice is to have a logic analyzer when debugging. There is one feature I felt it was missing from it though , the value of the frequency printed on the screen while taking scope measurements.(later edit: Gabriel pointed out that this feature exists and he was right, I somehow missed it. You have the option of activating and locking the cursors and this will show the frequency on the screen as 1/deltaT but I feel the position its not the best as it overlaps with the represented signal).  This is a feature commonly found on all modern scopes, and although you have the options of controlling two cursors from the menu its easier to just have the value on the screen without having to use the cursors.

To conclude the Xprotolab is a small and cheap device which besides the features enumerated above doubles as a development board with schematics and source code offered on the product page. To me its clearly visible that someone has put allot of work into this project and is using every bit of processing power from the ATXMEGA32A4 to crunch the numbers.

January 3rd, 2011

Chip and Pin is broken

You need to a flashplayer enabled browser to view this YouTube video
The truth is banks often lie to us to protect their interests. People like Omar Choudary and projects like the SmartCard Detective show us just how much is being hidden from us. If you ever find yourself victim of credit card fraud this might help you to recover your loss. It’s outrageous that even though they know about the loop hole they’re not doing anything to fix it and on top of that if you’re a victim they don’t give you your money back because “EMV is infallible”.

you can read about the EMV interceptor in Omar Choudary’s thesis: The Smart Card Detective - a hand-held EMV interceptor and you can check for more info and source files on his project page.

December 14th, 2010

Logic Analyzer on PicKit2

Pretty much every time I tried to work with some sort of digital interface I run into some kind of trouble where a logic analyzer would have saved me hours of blind debugging and posting to various forums. Same thing happened when I decided to try the TMP121 temperature sensor from TI which has an SPI interface. It was the first time I worked with SPI on a pic32 and as expected nothing worked for the first try. The code for setting the SPI interface and reading from it seemed correct, I took it from the “32 bit peripheral lib user guide” from Microchip.

 //configure SPI
OpenSPI1(SPI_MODE16_ON | SPI_SMP_ON | SPI_CKE_ON | MASTER_ENABLE_ON | CLK_POL_ACTIVE_HIGH | SEC_PRESCAL_8_1 | PRI_PRESCAL_16_1, SPI_ENABLE);
 
//start reading T1
mPORTEClearBits(BIT_0);		// pull CS low to prepare for reading
while(!DataRdySPI1());
T1 = ReadSPI1();		// read 16 bit word
mPORTESetBits(BIT_0);		// pull CS high

So what else could be wrong ? Well at this point it could be a faulty sensor or incorrect use of the SPI interface maybe I wasn’t generating the clock correctly or maybe some wiring issue. This is the point where you need to have a logic analyzer. While I don’t have a proper logic analyzer I do have a PicKit2 and it can emulate a 3 channel, modest logic analyzer. I hooked up one of channels to the SCK pin and I noticed I wasn’t getting any clock signal. But why isn’t the clock being generated ? The answer came from the Microchip forums, the guys there pointed out that in order to generate the clock signal you have to issue a dummy write. By issuing a dummy write you start generating the clock and you can do the reading. So I added a new line to the code and tried again:

//configure SPI
OpenSPI1(SPI_MODE16_ON | SPI_SMP_ON | SPI_CKE_ON | MASTER_ENABLE_ON | CLK_POL_ACTIVE_HIGH | SEC_PRESCAL_8_1 | PRI_PRESCAL_16_1, SPI_ENABLE);
 
//start reading T1
mPORTEClearBits(BIT_0);		// pull CS low to prepare for reading
SPI1BUF = 0x00;			// this sends a 0x00 just to make the clock toggle in order to read
while(!DataRdySPI1());
T1 = ReadSPI1();		// read 16 bit word
mPORTESetBits(BIT_0);		// pull CS high

This time I also connected a second channel from the logic analyzer to the SDI pin on the pic32 (data in) and it worked :) , here is the capture:Capture of TMP121 output data on SPI bus

As you can see on channel 2 there are 16 clock cycles corresponding to the 16 bit word sent by the TMP121 and on channel 3 connected to SDI(data in on pic32) is the actual binary temperature. If we analyze the data on Ch3, for every falling SCK edge we get 0001101010100000 we can discard the first bit cause its the sign bit (0 = positive , 1 = negative) and plug the rest of the bits in a calculator just to check the data.

binary data in windows calculator

note: windows calc discards the leading 0's

Next we convert to decimal and we get a value of 6816.

decimal data in windows calculator

6816 is not quite the number that we were looking for, but remember the data is represented in two’s complement so we have to divide it by 256 to get the actual temperature in degrees C.

actual temperature in windows calculator

The result after division by 256 is 26.625 degrees C. This was the room temperature at the time of this test. From here on everything is simple, I know I’m getting the right data out of the sensor its just a matter of processing and using it. And here is a picture of the PCB I made for the TMP121 in SOT23-6 package. Probably one of the smallest PCB I made at home, 30×10 mm.

TMP121 temperature sensor PCB

Now I’m seriously thinking about getting the Logic Sniffer from Dangerous Prototypes, it’s a must have.

December 7th, 2010

Grace from Texas Instruments



I first heard of it from Ian, I’ve gotta say this opens allot of possibilities for people to work with the MSP430.

Grace is a graphical configuration tool for MSP430 developers for setting up integrated peripherals such as ADCs, OpAmps, Timers, Clocks, and other modules. This tool is a free and open source, eclipse-based plug-in for Code Composer Studio. The Grace Beta currently supports all MSP430 Value Line devices (MSP430G2xx) as well as the MSP430F2274 device.

I was thinking about starting some projects on the MSP430 in the near future and one big problem is that I would have to read allot of datasheets and other info to get me started, and there isn’t always time for that. Grace might solve that problem for you and allow you to skip the hard work. Let me know if you’ve tried it. I’m especially interested on how it can interact with one of their MSP430+RF SoC.



© 2007-2011 YourITronics | Any logo, trademark and project represented here are property of their respective owners | Wordpress | Privacy Policy    RSS