Go Down

Topic: noob help Arduino freezes accessing RTC when LCD shield is installed (Read 635 times) previous topic - next topic

cfallen

Ok brand new to Arduino. I hook up a DS1307RTC direct to arduino and run the example DS1307RTC settime and read time sketches and they work fine. (I am using these to rule out issues with my own sketch) I install a SainSmart Keypad Shield 1602 LCD Module and the arduino freezes. it appears to freeze on any call to twi.c that has a wait for TWI to become ready.

example in twi_writeTo()
  while(TWI_READY != twi_state)
{
    continue;
}

twi_state never goes to ready.

I read all the documentation I could find on the LCD/Keypad and it does not use any i2c functionality and used A0 for the keypad and digital pins for all else.

any help appreciated.


pylon

Try measuring the voltage between the GND and 5V pins once without the LCD module and once with the module installed. My guess is that in the second case the voltage is significantly below 5V. If the voltage drops the DS1307 goes into a no-communication state, if it drops further it changes to battery backup.

Have you tried to run it with an external power supply?

cfallen

measured voltage with LCD shield and have 5.09VDC. Tried with external power supply and get same same. Freezes first time twi_writeTo is called as it waits for I2c bus to become ready but bus never becomes ready.

Oh and RTC is Tiny RTC I2c module if that helps at all. Could not find a schematic on.

pylon

Post the sketch you're experimenting with. Are you calling the wire.c functions directly?

floresta

Quote
it appears to freeze on any call to twi.c that has a wait for TWI to become ready.

I assume that you when you are having problems you are making your RTC connections to the I2C pins on the LCD shield.  I would investigate the connections between the Arduino and the shield and make sure that there is continuity.

Quote
Oh and RTC is Tiny RTC I2c module if that helps at all. Could not find a schematic on.

You can find a link to a schematic here: --> http://www.hobbyist.co.nz/?q=real_time_clock

Don

Go Up