hi,
i am tying to interface the bq32002 to msp430g2433 if some one help me with sample code it will be helpful, i tried a lot on web and TI website dint found it for USCI_B0. please help if any one have the sample code.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hi,
i am tying to interface the bq32002 to msp430g2433 if some one help me with sample code it will be helpful, i tried a lot on web and TI website dint found it for USCI_B0. please help if any one have the sample code.
Hi Rajendra,
As I mentioned in my post here: e2e.ti.com/.../1707373 I think that because the MSP430 appends the last bit of the slave address (the r/w bit) automatically, I think that instead of using 0xD0 and 0xD1 for your read/write slave addresses, you should instead just set the address in the UCB0I2CSA slave address register as 1101000b or 0x68 for both reads and writes. Can you try this?
I suspect that if you look at the output of your current code on a logic analyzer or oscilloscope you will see that it is probably sending the slave address incorrectly relative to the diagrams in the BQ32002 datasheet due to your setting to 0xD0 vs 0xD1.
In addition, I don't see that you divide down SMCLK at all - what is your SMCLK set to? If it is the default 1MHz that will be far too fast for I2C - I'd recommend putting some dividers on it using the bits in the USCI module for this purpose, UCB0BR0 and UCB0BR1. Finally, make sure that you have correctly sized external pullup resistors on the I2C lines between the two devices and that they have the same Vcc and GND. If you look at your waveforms on the oscilloscope and they have bad slew rise/time on them, you may need to change the size of your pullup resistors.
Regards,
Katie
thank you sir, finally i completed the code now my i2c is working properly i can send the data to bq32002 and also receive the data but now i am facing problem related to the clock i am getting the same data from bq32002 its not updating i have also set the stop bit in second sfr to 0 so it can start the oscillation but its not getting oscillated. please help how to enable the rtc oscillations so that it will update the time.
**Attention** This is a public forum