Register

Si4703 FM tuner and I2C

8 posts in this topic

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,

Share this post


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/.

Register likes this

Share this post


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....

Share this post


Link to post
Share on other sites

Hi!

I'm using energia e18 version.

I changed 2 values but not work. Please send me your project or/and hex? 

What did I do wrong?

twi_wire_h.thumb.png.2973881196e48d6a3f1244ebf4a01405.png

 

energia.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now