T3.5 LCD and RTC on I2C - lock up

Status
Not open for further replies.
Aren't i2c devices among those tend to power up slower than the Teensy? And warm start versus power on shows that up - maybe why the battery power version acts better.

Perhaps make setup() start like this with added delay()?
Code:
void setup()
{
  // START SERIAL FOR DEBUGGING

  Serial.begin(9600);
[B]  delay(1000); // Less delay may work - if this is the issue it should be time in excess ...[/B]
// ...

Tried the following :
- Reduce the speed all the way down to 24MHz
-Bring in delay in start up immediately after Serial.begin(9600);
-Shift the LCD init ahead of RTC init.
-Bring in delay between the LCD and RTC init.

And yet the issue remains... after each of above change you try powering up and it looks like you have killed the issue and just then it locks up. Anyway the RESET button is of no use when such a lock up happens ... which is very surprising. Only power cycling helps start code.

the final Setup() looks like this :

Code:
void setup()
{
  // START SERIAL FOR DEBUGGING

  Serial.begin(9600);
  delay(1000); 

   Wire.begin();

   // START THE LCD INTERFACE
  lcd.begin(16, 2);
  lcd.setBacklightPin(3, POSITIVE);
  lcd.setBacklight(HIGH);
  lcd.clear();
  lcd.print(F( " IIC CHECK OUT. "));

  delay(1000); 

  Wire.beginTransmission(DS3231_I2C_ADDRESS);
  Wire.write(0xE);                            // Address the Control Register
  Wire.write(0x00);                           // Write 0x0 to control Register
  Wire.endTransmission();
  Wire.beginTransmission(DS3231_I2C_ADDRESS);
  Wire.write(0xF);                            // Address the Status register
  Wire.write(0x00);                           // Write 0x0 to Status Register
  Wire.endTransmission();

  //setDS3231time(00,30,12,7,9,12,17);       // Uncomment, enter right date &time , download once. 
}
 
I am waiting on the LCD to arrive before I look into this issue.

I still really wish you would have been clearer about exactly which LCD you were really using. I ended up buying the wrong one, because you gave the wrong info. Hopefully it will be enough. If not, buying a 2nd LCD will only delay things even further.
 
I am waiting on the LCD to arrive before I look into this issue.

I still really wish you would have been clearer about exactly which LCD you were really using. I ended up buying the wrong one, because you gave the wrong info. Hopefully it will be enough. If not, buying a 2nd LCD will only delay things even further.

The one you ordered is perfect. So please don't buy any more LCDs. The end result is the same whether its a 4 L x 20C or 2L x 16C module. I have tried both.
( After I sent you the EBay link for the 4Lx20C one, I simply wanted to check the behaviour with the 2Lx16C one, which I had available on hand. Otherwise my final code requires ONLY the 4Lx20C one)
 
I've put the 9 clock bus reset from i2c_t3 into Wire. I also put in a couple other checks for lost bus arbitration learned from this old thread, but those are unlikely to be the problem here.

Please give these files a try. They go into hardware/teensy/avr/libraries/Wire.
 

Attachments

  • WireKinetis.cpp
    24.5 KB · Views: 65
  • WireKinetis.h
    10.1 KB · Views: 68
FWIW, I still don't have that LCD. Looks like it should arrive later this week. For now, I tested with this hardware.

DSC_0863_web.jpg

file.png
 
@MogaRaghu - Are you still watching this thread? Can you confirm if the fix (message #30, and now also in TD 1.41-beta1) resolves the problem when using your hardware?

The 20x4 LCD arrived here yesterday. I'm still waiting on the RTC module. Tracking info says it is somewhere in the postal system between Georgia and Oregon. It's likely to arrive this weekend or early next week.

Even if you're not responding to this thread, I'll probably wire these 2 up to a Teensy and check. If you are still here, and if the fix works, please let me know? That could save me some time from needlessly retesting, which is time I can use to help others.
 
For a final followup on this thread, I connected the LCD and RTC modules today to a Teensy 3.5 and ran the code from message #16.

I was able to reproduce the problem using Teensyduino 1.40.

Version 1.41-beta1 seems to fully fix the problem. In fact, I got the hardware into the locked up state with 1.40, then I switched to 1.41-beta1 and the first upload was able to recover the hardware from the locked up state left by uploading from 1.40.

Looks like this problem is fully solved.

DSC_0869_web.jpg
(click for full size)
 
Status
Not open for further replies.
Back
Top