AMPS 0 Posted March 21, 2013 Share Posted March 21, 2013 I am having RTC DS1307 I have used Energia IDE for programming.The code is working fine.I am facing one difficulties. As soon as i remove sda and scl pin from microcontroller it stop reading vlaues I tried same code in arduino . when i disconnect it reads default values as 0.0.0(hour.min.sec) how to check RTC working or not for MSP430G2 . is there any way to check RTC reading the values or not Quote Link to post Share on other sites
chibiace 46 Posted March 21, 2013 Share Posted March 21, 2013 msp430 is 3.3v, ds1307 is minimum 4.5 volts, i believe you can connect the VCC of the ds1307 to 5v and the i2c pullups to 3.3v and all gnds together but dont trust me on that. look up on google how to use ds1307 with 3.3v perhaps Quote Link to post Share on other sites
energia 485 Posted March 21, 2013 Share Posted March 21, 2013 If I understand correctly then reading from the DS1307 is working fine and it prints the time. But as soon as you remove the SDA/SCL lines the code hangs and stops printing the time? Is that correct? Can you post the Sketch you used? I vaguely remember that if you try to read from I2C when there is not device present on the bus the I2C bus can indeed hang altogether. I'll give it a try.. Quote Link to post Share on other sites
energia 485 Posted March 21, 2013 Share Posted March 21, 2013 The USCI block gets into a funny state when SDA/SCL are floating (i.e nothing connected). The User Manual is pretty explicit about pullups on the I2C lines: "Both SDA and SCL are bidirectional, and must be connected to a positive supply voltage using a pullup resistor". In your case, I would not worry about nothing being printed when you remove the device from the I2C bus. If you really want to have it execute normally then you can add a 10k pullup to the SDA and SCL lines. Be careful with the 5v (TTL) since the MSP430 is a 3.3v (CMOS) device. 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.