Jump to content
43oh

Si4703 FM tuner and I2C


Recommended Posts

Hi ,

 

I'm trying to run a Si4703 FM eval board from Sparkfun on an 2553 (launchpad). The device work fine on Arduino. I'm using the sketch provided by Sparkfun (there).

I change pin assignment as

int resetPin = P1_4;
int SDIO = P1_7; //SDA/A4 on Arduino
int SCLK = P1_6; //SCL/A5 on Arduino

Add pull ups to SDA and SCLK but with no result the code loop on this line in si4703_readRegisters function

while(Wire.available() < 32) ;

available return only 16.

 

I'm new to SPI so don't know how to resolve this.

 

Thanks,

Link to post
Share on other sites

The good thing is that you are talking to the chip since Wire.available() returns 16. Now the problem is with the buffer size of I2C on the 2553 only being 16. The reason for such a small buffer size is that the smallest msp430 supported in Energia, the MSP430G2231 only has 128 bytes of RAM. Since you are on a 2553 you can increase this buffer size without running into issues. Change the buffer size to 32 in both Wire.h and twi.h and you should be up and running. These files can be found in hardware/msp430/cores/msp430/.

Link to post
Share on other sites

Thank you so much!!!! What a relief! ;-)

As a lazy guy (average computer man) I stopped half the way in my process to pin point the real problem, should have taken a look at those 16 bin so that there was the first half part of what should been have returned and subsequently ask the right question: why only 16bit!

So I have to modify energia file isn't an cleaner way to do it, like asking with wire the first 16bits then the other 16bits?

 

Edit:

There's a ifndef for TWI_BUFFER_LENGTH, but not for wire  BUFFER_LENGTH

 

Edit 2:

Change the 2 values and it work perfectly....

Link to post
Share on other sites
  • 3 years later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...