Dec 032010
 

With a reciever that lets you tune to radio stations in the 76-100MHz range, power requirements of only 3.3V at 11mA, and an I2C control interface, the AR1010 FM radio module from Airoha is one cool chip.  Intrigued by this little FM reciever, I picked up a Sparkfun AR1010 Breakout Board to give it a try.  I plan on designing a small FM radio using this module and an AVR microcontroller.  First, though, I decided to use my trusty Bus Pirate to get acquainted with the chip.  The following are the steps I took to use the Bus Pirate and Sparkfun AR1010 Breakout Board to listen to a local rock station, 95.5 KLAQ, here in El Paso.

Testing Circuit

I built the testing circuit on a breadboard by connecting the Bus Pirate’s I2C interface, +3.3V, and ground to the AR1010 breakout board.  Since the breakout board contains the required I2C pull-up resistors and decoupling capacitors, the Bus Pirate can be connected directly to it, no other components are required.  I also connected the stereo output of the AR1010 to an audio jack.  According to the AR1010 datasheet, the module’s output signal is around 100mV.  A bit weak for my headphones, so I connected the audio jack to a simple headphone amplifier.

The testing setup.

Initializing the AR1010′s registers

After the testing circuit was setup, the AR1010 registers needed to be initialized.  I acquired the initial register values from different sources and through some experimentation.  Those shown below worked well for my module. I went through the following commands in the Bus Pirate terminal to initialize the AR1010 registers:

I set the Bus Pirate to I2C mode.

First, I turned on the Bus Pirate's power supplies. Then did an I2C address scan to confirm that the AR1010 could be seen by the Bus Pirate. Finally, I began initializing the AR1010 registers.

Continued to set all the registers to their initial values. (Only up to register 4 is shown)

Initial register values for the AR1010

Tuning to a station

Tuning the AR1010 is a three step process that involves some binary math.  First I found the channel number for my desired frequency using the following formula:

Channel = (Frequency (MHz) * 10) – 690

Applied to 95.5MHz it gave me 265 or 0×109.

Next, I set the channel register of the AR1010. To get the appropriate value,  I  applied ‘OR’ to the channel value and 0xD000 (I got 0xD000 from some source code I found on the web):

0×109 | 0xD000 = 0xD109

Writing to the channel register. (Tune bit 'OFF')

Finally, in step three, I set the tune bit ‘ON’ by doing:

( 0xD109 | (1>>9) ) >> 8

This gave me 0xD309 which is the value I wrote to register 2 of the AR1010 and then I was able to hear some rock music on 95.5 FM.

Writing to the channel register. (Tune bit 'ON')

Closing thoughts

You might be asking, “Why not set the channel register directly with the tune bit ‘ON’?”

I tried and it didn”t work. Tuning to a station involves writing to the channel register twice–once with the tune bit ‘OFF’ and once with the tune bit ‘ON’. This was a source of confusion in the beginning, but after following this rule I was able to tune to any station I wanted. In the end, controlling the AR1010 with the Bus Pirate was straightforward. Next, I plan on experimenting with the Bus Pirate’s binmode, Python, and the AR1010.

  2 Responses to “Testing the AR1010 FM module with a Bus Pirate”

  1. Hello, great tutorial. My bus pirate cannot find my ar1010 breakout board. All connections are correct and just like yours. If I do not turn the power supplies on, a command of (1) finds a bunch of addresses (but I’m sure its not the ar1010 because without power supplies on its not getting power.) When I turn the power supplies on and do a scan, it shows nothing, just a blank line. I really need help!

  2. It sounds like you might be using an older Bus Pirate firmware version. For the demo I used a Bus Pirate with v5.7 firmware . With the power supplies off, the i2c address search macro returns: Warning: *Short or no pull-up.

    I believe the older v3.0 firmware returned a bunch of addresses if used in “Software” I2C mode and nothing was connected (power supplies off). Firmware older than that contains a bug in the I2C implementation. So I suggest you upgrade the firmware if this is the case. The newer one is more stable and has more options.

    Other than that, I can only point you to the folks at the Dangerous Prototypes forums who are much more knowledgeable at debugging problems than I am.

 Leave a Reply

(required)

(required)


− 2 = one

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">