Sunday, March 6, 2011

Fix for IM-ME SpecAn Frequency Offset

Twitter never used to do much for me until I started playing around with the IM-ME. I didn't set up an account until I ran into a problem with the Bus Ninja code not being available from the author's site.  I saw that he had a Twitter account, so I set one up for myself and tweeted him.  I got an answer back in the matter of a few minutes that he'd fixed the problem.  Wow.

So when I found that my IM-ME spectrum analyzer had a frequency offset, I sent a tweet to the author wondering if he had a clue what was going on.  Turns out that he did.
Well, There's Your Problem
The spectrum analyzer was designed based on the author's IM-ME and its 26 MHz crystal oscillator.  Michael thought that my IM-ME might have a 27 MHz crystal, and he was bang on as the blurry picture above shows.  It is unlikely that the oscillator frequency can be determined at runtime, so you've just got to be aware of it.  You've got to tear the thing apart to get this code on the pager in the first place, so it would be a good idea to take note of the crystal frequency while you are in there.

Michael pointed me to where the code can be fixed.  Here are a few lines out of specan.c

/* the frequency setting is in units of 396.728515625 Hz */
u32 setting = (u32) (freq * .0025206154);

So it should be just a matter of scaling the constant above by the ratio of the frequency difference to fix the problem. Like so:

u32 setting = (u32) (freq * .0025206154 * 26.0 / 27.0);

No real idea why my IM-ME has a 27 MHz oscillator where others have 26 MHz. It might be a difference in the US vs UK models, or it might be a design change they made in a rev of the hardware.

I'm just psyched that my IM-ME is pimping a 4% overclock. Boo-ya.

No comments:

Post a Comment