AR1000- Not able to tune to a band

I was trying to integrate the AR1000 FM receiver break-out board with a BeagleBoard (running Android OS). I use i2c for communication. I am able to initialize the registers with the values given in the sample program and get a static sound once the registers are initialized.

When I try to tune to a particular station (say 97.3) by writing to register R2, the value gets written to R2. When I try to read R13 (Status register) after this, I can see that the channel values are still zero. The status bit becomes non zero though.

I am attaching my connection diagram, output from my program and relevant parts of the program below. Any help is appreciated.

=======================================================

INITIAL STATUS AFTER INITIALIZATION (R13) - 0x0223

VALUES IN ALL THE REGISTERS AFTER INITIALIZATION -

0x00: 0xFFFF

0x01: 0x5B15

0x02: 0xF4B9

0x03: 0x8012

0x04: 0x0400

0x05: 0x28AA

0x06: 0x4400

0x07: 0x1EE7

0x08: 0x7141

0x09: 0x007D

0x0A: 0x82CE

0x0B: 0x4F55

0x0C: 0x970C

0x0D: 0xB845

0x0E: 0xFC2D

0x0F: 0x8097

0x10: 0x04A1

0x11: 0xDF6A

0x12: 0x0000

0x13: 0x0223

0x14: 0x0000

0x15: 0x0000

0x16: 0x0000

0x17: 0x0000

0x18: 0x0000

0x19: 0x0000

0x1A: 0x0000

0x1B: 0xB165

0x1C: 0x1010

VALUES IN ALL THE REGISTERS AFTER TUNING TO 97.3 -

0x00: 0xFFFF

0x01: 0x5B15

0x02: 0x031B

0x03: 0xA012

0x04: 0x0400

0x05: 0x28AA

0x06: 0x4400

0x07: 0x1EE7

0x08: 0x7141

0x09: 0x007D

0x0A: 0x82CE

0x0B: 0x4F55

0x0C: 0x970C

0x0D: 0xB845

0x0E: 0xFC2D

0x0F: 0x8097

0x10: 0x04A1

0x11: 0xDF6A

0x12: 0x0000

0x13: 0x0223

0x14: 0x0000

0x15: 0x0000

0x16: 0x0000

0x17: 0x0000

0x18: 0x0000

0x19: 0x0000

0x1A: 0x0000

0x1B: 0xB165

0x1C: 0x1010

STATUS AFTER TUNING (R13) - 0x0223

MY PROGRAM TO TUNE TO 97.3 -

void ar1000_tuneto(uint16_t freq_kHz)

{

uint16_t channel, temp, temp2,temp3;

AR1000_TUNE_OFF;

//Set Channel

channel = freq_kHz - 690;

temp = ar1000_read(2); //Read

temp &= 0xFE00; //Mask

temp |= channel;

ar1000_write(2, temp); //Write

//Enable tune bit

AR1000_TUNE_ON;

//Wait for tune to stabilize (STC flag)

temp = 0;

printf(“\n Wait till tune to stabilize”);

while(temp == 0)

{

temp = ar1000_read(ADDR_STATUS) & MASK_STC;

printf(“!”);

}

printf(“\n Tuning Over!!”);

Got it working :slight_smile:

The problem was with I2C write and read. MSB and LSB were getting swapped while writing to the control registers.