Posts Tagged Spectrum Analyzer

Spectrum analyzer development with ChipKit

Chipkit with 74595's connected to PLO2

Now that I know that trying to use the BusPirate with the 74595’s is basically a non-starter, I’ve moved on to using the ChipKit.  The ChipKit is a arduino-like board with a Microchip PIC32 micro controller.  The PIC32 is, as the name would imply, a 32 bit processor, running at 80 MHz.  That’s pretty impressive, if you ask me.  It has a boot loader and software package that makes it more or less compatible with arduino code.  I really like that I can just hack something together without all the setting up SFRs (Special Function Registers, or the bane of embedded device programmers existence).

Anyway, I’ve developed a simple “sketch” (program in arduino terminology) that accepts serial commands and executes SPI transfers using a set of pins through the 74595’s.  You can kinda see what’s happening in the logic analyzer trace above.  The top three traces are the SPI commands to the PLO module.  The middle two are the serial in and out of the chip kit.  The bottom three are the SPI commands to the 74595’s.  I had to zoom out far enough that you can’t see what the serial or bottom SPI contents are, but it’s basically “$,s,A,B,C,L,DDD…” where A, B, and C are the pins for SPI Chip Select, Clock and Data, L is the length of the transfer in bytes and DDD… is the contents of the transfer.  Currently, the limiting factor is the serial communication (by that I mean UART, not SPI), but I’m only using 9600 baud in this example.  The ChipKit uses an FT232R USB-Serial converter that is good into the megabaud.  In the future I’ll experiment with higher baud rates.

That’s basically, all.  I just wanted to post and say that it works.  By the way, the PLO module happily accepted its commands and tuned to 1024 MHz.  🙂

, , , , ,

No Comments

Buspirate and shift registers (a tale against publication bias)

As with most “publications,” if you can call a blog post a publication, you’re much more likely to read about what works than what doesn’t.  This is not that kind of post.

Experiment setup 

For background, I’m still working on my spectrum analyzer.  I don’t really like the current control board setup, and the windows only, BASIC software.  I’m investigating other options for replacing those components.  I’m thinking about using the 74595 shift registers to expand the number of control lines that I can control.

74595 architectural diagram (from the fairchild data sheet)

The basic idea of the 74595 is that it’s a shift register with an extra set of output registers.  The advantage is that you can load it “behind the scenes,” then apply the output glitch-free at once.  Essentially, you can treat it like a SPI peripheral.  Load the pin values serially, then you can use the CS with the RCLK pin to load the output registers.

Schematic for 74595 based port multiplication

The schematic I used is included above.  The basic model is that these devices can chain together.  The serial data (delayed by 8 clock cycles) appears on QH*.  This way, if we want 32 pins, we can chain 4 together.  Load 32 bits of data onto the SPI bus and pulse the CS pin high.  Hey presto, Bob’s your uncle, you’ve got data.

The risk of this approach is that every operation on any of those pins takes 32 clock periods on the SPI bus.  If the bus is clocked slowly, it can be a major problem.  I had assumed that, because I can use a 4 MHz clock with the bus pirate, it would be alright.  However, I hadn’t anticipated the additional overhead that the bus pirate adds by using the serial port of a PC.  Even using the binary scripting mode, you have to use 4 serial bytes for one 8-bit SPI transfer.  The problem really stems from the inconsistent and bursty nature of the serial interface.

Logic analyzer capture

The bottom three traces on the above logic analyzer capture are the SPI commands to the registers.  The top three are the SPI out from some of the register pins.  Every change in the states of the top three requires a full load of the shift register.  A SPI transfer out of the register requires 3 * bits + 2.  The coefficient 3 is due to the expense of raising the clock pin, changing the data pin, and lowering the clock pin.  The extra 2 is from raising and lowering the CS pin.  Notice that it takes 1/3 of a second to execute a 40 bit SPI transfer.  To load a PLL requires several 21 bit loads, so it’s about the same.  This is unacceptable.  That’s the moral of the story.  The bus pirate simply can’t execute fast SPI commands through a shift register.  Now you know. 🙂

, , ,

1 Comment

Softrock Ensemble VHF tuning

This post has a specific audience in mind, so unless you have, or are interested in a Softrock Ensemble VHF receiver, you’ll be bored. You’ve been warned 🙂 There are a few radio bands that are interesting near the ham 2 meter band.  NOAA weather satellites send images using APT at and around 137 Mhz and there are weather broadcasts at 162.5.  There was a question on the mailing list for the Softrock about whether it could be tuned to receive signals in all of these bands without re-tuning.  This post is simply documenting my experimentation with the front end.  I’m sampling the signal using an oscilloscope probe with the 10x setting and inserting the signal from the tracking generator connected to the antenna port.  It’s not really possible to measure the precise insertion loss absolutely, so I’ll measure it relative to the baseline of front end tuned for 2 meters.

Tuned for 2 meters

To begin the testing, I tuned as best I can to the 2M band.  The filter shape isn’t as flat as I would like, but it’s the best I could do.

Tuned for NOAA APT transmissions

It was a little easier to tune the front end for NOAA APT transmissions.  I got a better filter shape, and about 5 dB better average insertion loss.

Tuned for weather radio

Tuning for weather radio wasn’t that bad either.  The average insertion loss is about equal to what I got for 2 meters.

Compromise tuning

Finally, if you’re interesting in receiving signals from throughout the band, it’s possible strike a compromise.  You’re just about always going to get a peaked response, so I placed the lower peak at 137 Mhz and the upper at 165.  The 2 meter ham band is somewhere in the middle.  The peaks at 137 and 165 are 5-10 dB below the baseline.  The 2 meter band is a little worse at about 20 dB below the baseline.  So, it’s possible to get a somewhat broadband response at the fronted at the expense of some signal strength.  It may be possible to mitigate some of this if you use a low noise preamplifier.

, , , , , , , ,

No Comments

SKY65116 Amplifier

Amplifier breakout board

I’ve finally gotten around to assembling a breakout board for the Skyworks SKY65116 UHF amplifier.  It’s really amazing how the state of the art in RF ICs has advanced.  They can still be on the expensive side ($6 at digikey), but still relatively cheap when you consider the cost of all the support parts that it takes to build an amplifier from a RF transistor.  This particular amplifier has a 50 ohm input and output, and 35dB of gain.  It works from 390Mhz to 500Mhz, which means its perfect for the 70cm ham band.  The breakout board is stupid simple, copied directly from the evaluation board schematic in the datasheet,  but I’ll include schematic and design files anyway.

Source for the amplifier test

This is the video transmitter from my first person video experiments.  The performance was pretty terrible, even after I tested it using different receive antennas.  I’ve even purchased a receive-side amplifier to try, but haven’t done anything with it yet.  Anyway, the transmitter had a built-in antenna, so I wasn’t sure how I was going to add an amplifier.  I ended up assuming that the output would be roughly compatible with an 50 ohm load.  I unsoldered the antenna and installed a bit of thin coax to the antenna port.  I scratched off some of the solder mask on either side of the board near the antenna port to make sure I had a solid electrical and mechanical ground connection.  The transmitter is pretty crappy, and the prices you can find online are COMPLETELY RIDICULOUS!  I wouldn’t pay more than $20 for it.  I think that’s about what I paid, it was on clearance.

Amplifier test configuration

Testing configuration

This image is the testing configuration I used.  The camera, power board and transmitter are in the top of the image, and are exactly as I used them for first person video.  The added coax can be seen going into the amplifier on the left.  Coming out of the amplifier is the cable going to the oscilloscope or spectrum analyzer.  The amplifier wasn’t inline all the time, though.  I measured the output power from the transmitter at about 25mV into 50 ohms using the oscilloscope.  Using Minicircuits’ handy table that comes out to be about .01 mW, or -19 dBm. A measurement from a spectrum analyzer verifies the -19 dBm measurement from the o’scope (see below for image).

NTSC modulated spectrum (click for source)

I’ve attached a very nice graphic from wikipedia that describes the components of modulated NTSC video.  There is something happening here that isn’t obvious, so I’ll explain it.  In the spectrum analyzer image, below, you’ll notice that I’ve labeled the luminance and chrominance carriers.  The luminance carrier is really the main carrier for the entire signal.  It comes from black and white TV era.  There are significant DC components in NTSC video, so this carrier is very important.  Notice, in the graphic above, that the luma carrier is 1.25 Mhz above the lower edge of the band.  This is because NTSC video uses what’s called VSB, or vestigial side band, which means that the lower half of the signal is attenuated.  This reduces the spectrum necessary to transmit video.  The choice was made to include the carrier and 1 Mhz with of lower sideband while removing the rest.  Later, when color TV was added, they needed a way to encode color.  This is done by adding another carrier and encoding hue and saturation by modulating the phase and amplitude of this carrier.  All this is explained at length, and probably much better, in the wikipedia article on NTSC.

Source spectrum

In the spectrum image I’ve included above, it’s clear that the little transmitter uses AM rather than VSB.  You can tell because AM modulated signals are always symmetrical with respect to the carrier.  If it was VSB, the spectrum on the left side of the carrier would be suppressed.  You may notice that the left and right side don’t look 100% alike.  This is because it takes time for the analyzer to sweep the band (it does this 30 times a second), and it will be analyzing the spectrum of a different part of the image as it scans.

Source signal through unpowered amplifier

Well, that was an unexpected tangent!  Back to the amplifier…  In the above image I have the amplifier in the signal path from the source to the analyzer.  It’s disconnected from any power.  I’m a little off on the “-60 dBm” text, it’s closer to -64 dBm.  I was interested in seeing how much RF would leak through an unpowered amp.  It appears that the amp provides a little more than 40 dB of forward isolation between the input and output when it’s unpowered.

Amplifier powered on

Finally, this is the spectrum when the amplifier is powered on.  I had to install 40 dB of attenuation on the analyzer to capture this image.  The peak of the carrier is almost 5 dB lower than the top line, so it’s about 36 dB stronger than the input.  This is inline with expectation, as the amp specifies +35 dB gain.  The resulting signal is +15 dBm, which is a modest 32 mW of power.  The hope is that through a better antenna and some amplification I can get better performance from the video link.

A word about the legal implications.  Ham radio people are notoriously concerned with the rules of everything they do, so I feel obligated to mention them.  In the U.S., at least, 434 Mhz is a commonly used ATV (amateur T.V., or “fast scan TV”) frequency.  There is some concern due to the proximity to the  “satellite only” frequency band of 435 Mhz to 438 Mhz.  This means that the carrier is sometimes shifted to 433.92 Mhz, as this transmitter is.  Some of the sidebands still end up in the satellite only band, but with much lower power.  Because this amplifier only outputs +15 dBm I’m very unlikely to upset anyone with its use, though I should think about adding an overlay with my call sign to the video at this power level.  Maybe I’ll have a new 8-bit microcontroller project…

eagle files

gerber files

, , , , , , , , ,

4 Comments

New spectrum analyzer page

I’ve decided to move spectrum analyzer posts onto their own page.  I’ve been getting complaints from approx. 25% of my readership (hi, Katie) that I’m crossing the line to “too nerdy”.  So, I’ll let you opt-in to hearing about it.  The page is available under the title banner, near the “about” and “thesis” page.  I’ll write sub pages for each module.  Unfortunately, I don’t think there’s a way to make an RSS feed of changes to this page, so if you’re interested you’ll just have to check in occasionally.  I’ll also post when it’s all done, so there is that to look forward to.  Anyway, that’s all.  🙂

, , , , , ,

2 Comments