Register 3 Posted February 4, 2014 Share Posted February 4, 2014 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, Quote Link to post Share on other sites
energia 485 Posted February 5, 2014 Share Posted February 5, 2014 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 1 Quote Link to post Share on other sites
Register 3 Posted February 5, 2014 Author Share Posted February 5, 2014 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.... Quote Link to post Share on other sites
energia 485 Posted February 5, 2014 Share Posted February 5, 2014 Happy to hear that you got it working! I will expose these variables in the next release so that the default can be overridden. Register 1 Quote Link to post Share on other sites
Register 3 Posted February 6, 2014 Author Share Posted February 6, 2014 Ok, thanks. Quote Link to post Share on other sites
tirex 0 Posted August 17, 2017 Share Posted August 17, 2017 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? Quote Link to post Share on other sites
tirex 0 Posted September 27, 2017 Share Posted September 27, 2017 Ok. İt's works E11 version. Quote Link to post Share on other sites
Rei Vilo 695 Posted September 29, 2017 Share Posted September 29, 2017 Energia 11 builds a more compact code than release 18, especially for the very limited G2453 with 512 bytes of RAM. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.