Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 35 of 35

Thread: T3.5 LCD and RTC on I2C - lock up

  1. #26
    Quote Originally Posted by defragster View Post
    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);
      delay(1000); // Less delay may work - if this is the issue it should be time in excess ...
    // ...
    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. 
    }

  2. #27
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    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.

  3. #28
    Quote Originally Posted by PaulStoffregen View Post
    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)

  4. #29
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,599
    have you tried i2c_t3.h to see if it behaves the same?

  5. #30
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    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.
    Attached Files Attached Files

  6. #31
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    FWIW, I still don't have that LCD. Looks like it should arrive later this week. For now, I tested with this hardware.

    Click image for larger version. 

Name:	DSC_0863_web.jpg 
Views:	20 
Size:	171.5 KB 
ID:	12247

    Click image for larger version. 

Name:	file.png 
Views:	23 
Size:	53.8 KB 
ID:	12248

  7. #32
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,478
    Quote Originally Posted by PaulStoffregen View Post
    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.
    OK, i tested my DS3231 with your Wire lib update and it fixes the reprogram hang as described in my post #18

  8. #33
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    @MogaRaghu - Do the files from message #30 solve some or all of the problems you experienced?

  9. #34
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    @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.

  10. #35
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    17,624
    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.

    Click image for larger version. 

Name:	DSC_0869_web.jpg 
Views:	23 
Size:	176.5 KB 
ID:	12344
    (click for full size)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •