-1

I recently purcahsed an si4703, from sparkfun

https://www.sparkfun.com/products/11083

I got it soldered to some headers and now I am not getting anything to work on it, my wire diagram is as follows

enter image description here

( I know the FM module pictured is different but its ultimately wired up the same I think)

And I am just trying to run the out of box example code modified to my Arduino Mega board

#include <SparkFunSi4703.h>
#include <Wire.h>

int resetPin = 35;
int SDIO = A15;
int SCLK = A14;

Si4703_Breakout radio(resetPin, SDIO, SCLK);
int channel;
int volume;
char rdsBuffer[10];

void setup()
{
  Serial.begin(9600);
  Serial.println("\n\nSi4703_Breakout Test Sketch");
  Serial.println("==========================="); 
  Serial.println("a b     Favourite stations");
  Serial.println("+ -     Volume (max 15)");
  Serial.println("u d     Seek up / down");
  Serial.println("r       Listen for RDS Data (15 sec timeout)");
  Serial.println("Send me a command letter.");

  radio.powerOn();
  radio.setVolume(0);
}

void loop()
{
  Serial.println("looping");
  if (Serial.available())
  {
    char ch = Serial.read();
    if (ch == 'u')
    {
      channel = radio.seekUp();
      displayInfo();
    }
    else if (ch == 'd')
    {
      channel = radio.seekDown();
      displayInfo();
    }
    else if (ch == '+')
    {
      volume ++;
      if (volume == 16) volume = 15;
      radio.setVolume(volume);
      displayInfo();
    }
    else if (ch == '-')
    {
      volume --;
      if (volume < 0) volume = 0;
      radio.setVolume(volume);
      displayInfo();
    }
    else if (ch == 'a')
    {
      channel = 930; // Rock FM
      radio.setChannel(channel);
      displayInfo();
    }
    else if (ch == 'b')
    {
      channel = 1067; // BBC R4
      radio.setChannel(channel);
      displayInfo();
    }
    else if (ch == 'r')
    {
      Serial.println("RDS listening");
      radio.readRDS(rdsBuffer, 15000);
      Serial.print("RDS heard:");
      Serial.println(rdsBuffer);     
    }
  }
}

void displayInfo()
{
   Serial.print("Channel:"); Serial.print(channel);
   Serial.print(" Volume:"); Serial.println(volume);
}

However I do not think it is ever getting to the actual loop, it seems to get stuck on the code radio.powerOn() and then does nothing after that, what can I do to make this work?

  • Welcome to Arduino StackExchange! But could you please add an actual picture of your wiring instead of that image? – Avamander Mar 26 '16 at 23:21
1

According to your hookup image, you have connected I2c pins to A14 and A15, I2c on Mega is on pins 20 and 21 , clearly marked SDA and SCL.

Also note that this module can ba powered by 5V but is only 3.3V tolerant on the input pins, you should use a level converter.

| improve this answer | |
  • Thank you so much, It worked, why on an UNO board in the hookup guide does it say to use Analog ports A4 and A5, is it because the Mega offers something the UNO does not? Just would like to know the reasoning as to why it works, thanks – Chris James Champeau Mar 22 '16 at 6:26
  • 1
    The AtMega328p and the AtMega2560 are wery different in many ways and the pinout and what hardware features are available on which pin is also different, while they are made to be as similar looking as possible this might often lead to your little snafu. – Hans Neve Mar 22 '16 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.