Ph: 10701360

More ChipKit spectrum analyzer progress

February 1st, 2012 No comments

Modifications to the ADC

I’ve been able to make solid progress on the spectrum analyzer tonight.  I’ve continued using the ChipKit, I’m fairly happy with it at the moment.  As I mentioned in the last post, I’ve increased the baud rate on the serial port to 115200 baud.  That seems to be the point where the SPI bus speed and the serial port speed are about matched.  There’s still plenty of room to increase it, however.

I’ve been progressing in the project by adding one module at a time, and testing as best I can.  I’ve got PLO2 (mostly) working, and DDS1 seems to be rock-solid.  I’m able to command it to any frequency I want between almost 0 Hz up to 20 MHz.  Tonight, I added the ADC to the list of modules that seem to be working.  To accomplish this, I had to make two modifications to the ADC.  The first was to change it to work with a 3.3v DC supply.  This change was trivial, it’s the same as the modification to run off of the power from the PDM.  You just remove the old voltage regulator and replace it with a bit of wire.  This is necessary because, if it’s powered with 5 volts, the minimum voltage required to mark a digital ’1′ is 3.8 volts.  The PIC32 in the chip kit is powered by 3.3 volts, so there’s no way that’s going to happen.  In reality, it’s probably going to work, but it’s likely going to give you a headache.  Finally, I removed the two transistors that were on the outputs of each ADC.  They were there to provide stronger output drivers (the ADCs can only drive their outputs with 500uA).  The parallel port requires a pretty healthy amount of current on the status lines.  Because it’s being connected directly to a micro controller, these drivers aren’t necessary.  Not only that, but they were acting as it they were damaged.  With them gone, everything seems to work great!

Now that the ADC and a DDS works, I can begin to use it as a spectrum analyzer… even if it’s only for a very small range of frequencies.  For example, I can make a plot of the filter used with the “squarer” in the DDS:

DDS1 squarer response

It’s not immediately clear whether this plot makes any sense, I’m hoping that I can get someone in the panel of experts to weigh in on it.  It’s reasonable clear that there is a pass band centered around 10.7 MHz, which is what I want.  I’m not sure what to think about those steep slopes and the large spike of to the right.  None of this may matter, as the DDS will never be tuned out there anyway.  It could even be that a harmonic of the DDS output is getting through the passband when it’s tuned there.  I really have no idea.

The plot below is from the final resolution bandwidth filter (RBW) that’s used to set the resolution of the analyzer as a whole.  I got this filter from one of the MSA experts (thanks, Sam), and I know it performs better than this.  Again, I’m wondering if it has this shape due to some quality of the DDS output, or some other factor.

Shape (maybe) of my final resolution bandwidth filter

Ultimately, I think these graphs are great, and very encouraging.  Even if they’re a bit confusing, it’s nice to be able to put something up on the screen.  You might be wondering how I produced them?  Well, that’s the embarrassing bit.  My cheesy analyzer program (which is really just a way to test the suite of classes I’ve written for communicating with the modules) will spit out text that can be used as a CSV (comma separated values) file that can be read by Excel or Numbers.  I used Numbers to create these plots.  I think they’re log-scale plots, because the log detector module produces logarithmically increasing voltage given increasing input power, thus I used linear scaling on the Y axis.  The Y axis is the raw value from the ADC, and the X axis is the frequency.

Update:

I got an email back from Scotty about the graphs I got from my DDS sweeps.  The first plot, of the DDS squarer, is normal.  The reason it has that shape is best explained in the context of the schematic of that part.

DDS Squarer (section of the schematic from scotty's webpage)

Trace the signal from “OUTA,” it goes through matching network (I think!), then a crystal filter (XF1), and a logic inverter.  Basically, the inverter will “snap” on or off once the sine wave from the filter passes a threshold voltage.  Once the signal is attenuated to a certain level by the crystal filter, the inverter will no longer trigger.  This is the reason for the sharp skirts on either sides of the passband.

Scotty also thinks that the response plot from the RBW filter is indicative of a mismatched input or output.  I’m pretty sure it isn’t the actual filter, so I’m going to look into other sources of impedance mismatch.

Update 2:

Not only did Sam agree that the shape of the RBW filter is likely due to the impedance mismatch between the source and the filter, but that I could probably help the situation with an attenuator.  I inserted one (with a DC blocking capacitor) between the DDS source and the filter, the plotted it again.

Second plot of the filter shape

My only concern now is that the filter bandwidth looks much much wider than I expected.  I don’t know what the cause of this is.  Because I really have no calibration, I don’t know how the “counts” in the ADC map to dBs of signal.  Typically, filters are defined by the points to the right and left of the center that are 3dB “down” from the center level.  However, I may be able to glean some knowledge from the datasheet.

RSSI voltage vs. input power level (from the Analog devices datasheet)

The slope is ROUGHLY(!) a half a volt per 20dB.  I’ll do a better calibration when the code is there, but for now let’s just continue on.  Once we know what the slope is, we need to map the counts on the ADC output to volts.  I’ve converted the ADC to use 3.3volt power, and it’s a 16 bit device, so there are 65,536 counts (numbers) spanning 3.3 volts, or 19859 counts per volt.  In my spreadsheet, I just made a new column that performs this conversion.  Finally, because it looks like 2 volts maps to about 10dB.  So, I added another column to the spreadsheet, this time subtracting 2 from the volts, divide by .5 and multiply by 20.

Unfortunately, it’s not easy to see where the 3dB points are.  Looking at the raw data, I can see that the maximum value is -13.0 dB, so the 3dB points are where -16.0 dB is crossed on each side.  On the low side, it’s 10.6989, and on the high side, it’s 10.701360.  The resulting 3dB bandwidth is .002 MHz, or 2 kHz.  This is exactly the published value.  I guess this means that it was a very successful experiment.

 

Spectrum analyzer development with ChipKit

January 23rd, 2012 No comments

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.  :)

Tags:

Buspirate and shift registers (a tale against publication bias)

January 20th, 2012 No comments

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

Read more…

Tags:

USB to RF Transceiver prototype complete!

December 18th, 2011 No comments

Collection of transceivers

This is just a post to point you over to my new Transceiver page.  I took the work that I did on the MRF49XA transceiver, and added an Atmel AVR USB micro controller.  I prototyped is using the AT90USBKey development kit, and designed a custom PCB that includes the transceiver and an AT90USB162.

"Component side" of the USB transceiver

I wanted to design the board such that all the “guts” were on the “back” side of the PCB.  The photo above shows the transceiver circuit (surrounded by a strip of track that you can use to solder a “fence” or “can” to manage RF interference), and the AT90USB162 micro controller.  This can be replaced by and 2 series USB micro controller, like the ATMega32U2 or the AT90USB82.  I recommend using the ATMeta32U2, though the first run of boards have the AT90USB162.  I’ve also included a dedicated 3.3v voltage regulator, because the built-in regulator inside the AVR doesn’t have a clearly marked current capacity, and I didn’t want to risk it.  I’ve also included every spare pin from the AVR that was practical.

The "top" side of the board

The other side of the board contains all the user facing parts.  This includes the status LEDs, the SMA connector, USB port, and the boot loader and reset buttons.  My grand idea here was that I could mount a piece of plastic to the component side to protect them, while having access to all the bits I need to use.  In hindsight, this means that it’s a “double-sided load” which is harder to manufacture.  I ended up having to learn a new technique to solder the USB port.  Notice that the can of the USB port covers the pads?  It’s very difficult to solder those on.  It helps to “tin” the pads first, then set the USB port on top of them.  Luckily, the USB port has little plastic pins that keep it aligned.  When you’re pressing down on it, just hit it edges of the pads with the soldering iron, and it should solder just fine.  When that’s finished, solder the mounting tabs on the sides.

Also, the buttons I bought aren’t “process compatible” which means that you can’t wash the board with them installed.  To deal with this, I reflow solder the entire board, then put them in my new ultrasonic jewelry cleaner with time isopropyl alcohol and brush them with a toothbrush, finally rinse off the alcohol and dry with compressed air.  Once the board is cleaned, then I solder on the buttons.

Lessons (mostly) learned?  Think about how you would assemble something when you’re designing it!!  Building the board this way adds 15-20 minutes of assemble time.  Bummer.

PDFs of the transceiver PCB artwork.  Sorry it’s so ugly, the “high quality” rendering in Gerbv doesn’t work in mac os anymore. transceiver-top transceiver-bottom

Component side artwork

User side artwork

Also, here is are the gerber and eagle design files: Design files.

Work on the software is ongoing.  Click on the transceiver’s main page (link at the top) for updates.  Enjoy!

Tags:

DFU-Programmer tips & tricks

November 19th, 2011 No comments

I recently got a Atmel AT90USBKey to play around with.  I’m going to use it to prototype a USB controller for the MRF49XA transceiver I made a while ago.  That post is still in progress, but I had trouble getting started with DFU-Programmer on the mac, so I thought I’d make a post about those problems so it may help others having the same trouble.  I know that I found next-to-nothing when I was googling for it. Read more…

Helical Quad Antenna for Weather Satellites

October 23rd, 2011 2 comments

Finished and installed antenna!

It didn’t take long after my first successful attempt at receiving weather satellite broadcasts for me to realize that I would need a much better antenna.  I had been using a 1/4 wave whip with a 4-wire ground plane.  There performance out of this antenna was poor.  I read up on QFH (Quadrifiliar Helix antennas) from many of the high quality posts from around the world.  I took what I could from these implementations, and did my best with the supplies I had available.

Read more…

Homebrew bubble counter

October 19th, 2011 11 comments

Counting bubbles during secondary fermentation

For a while now, my friends and I have been brewing beer at my house.  I was inspired by an old Sparkfun tutorial about a bubble logger for Nate’s terrible wine.  I figured that while logging bubbles is interesting and all, wouldn’t it be more useful to have real-time information on the fermentation process?  I basically copied the optical gate method of counting bubbles, added a sensitive pressure sensor, and an AVR development board (Yes, Arwen, that’s your old TekBots board! :) ).  Read more…

Receiving weather satellite images with Softrock

October 19th, 2011 15 comments

One of my first NOAA APT satellite images! (click to learn more)

The National Oceanic and Atmospheric Administration (NOAA) manages a few satellites in low earth orbit.  There are three actively transmitting APT signals at the moment, NOAA15, 17, and 18.  Each of these satellites passes overhead a few times a day.  I’ve been interested in learning how to receive their signals for a while now, and I’ve finally succeeded!

Read more…

Softrock Ensemble VHF tuning

September 16th, 2011 No comments

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


Read more…
Tags:

SKY65116 Amplifier

September 15th, 2011 1 comment

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. Read more…


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser