Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not set / display time with HW_MODEL_D #1

Open
vargham opened this issue Feb 8, 2018 · 12 comments
Open

Could not set / display time with HW_MODEL_D #1

vargham opened this issue Feb 8, 2018 · 12 comments

Comments

@vargham
Copy link
Owner

vargham commented Feb 8, 2018

Temperature and ligth measurement are working. Display is OK. Button 1 and 2 are working.

Time setting and display is not working. There is a 1F 7F constant display instead of time.

time_display_send

@zerog2k
Copy link

zerog2k commented Feb 9, 2018

Is it working with the changes you made?

@vargham
Copy link
Owner Author

vargham commented Feb 10, 2018

Everything is fine, except the clock.

@zerog2k
Copy link

zerog2k commented Feb 10, 2018

I’m wondering if the data and clock lines of ds1302 have external pull-up resistors on them? I recall some issue where we had to play with the pin mode registers to get pull-up (if so might check data sheet on this. )

@vargham
Copy link
Owner Author

vargham commented Feb 12, 2018

RTC data IO has 7k6 pull-up.

@vargham
Copy link
Owner Author

vargham commented Feb 12, 2018

Changed DS1302's CE to open-drain output

    //M1 M0
    // 0 0 Bidirectional
    // 0 1 Push-Pull
    // 1 0 Input
    // 1 1 Open-drain
    //          IO CE CK
    P1M1 = 0b00000010;
    P1M0 = 0b00000010;

Constant 1F 7F has been changed to constant 00 00, but still could not set time.

@zerog2k
Copy link

zerog2k commented Feb 13, 2018

  1. Did the clock work with the stock firmware before flashing to this custom one?
  2. Datasheet says ds1302 signal pins have internal 40k pulldown, so if there are no pullups on CE & CLK you may want to try setting pinmode to push-pull, and on IO since it has pullup, open-drain (or quasi-bidirectional).
    Do you have access to a scope or logic analyzer to see what is happening on the ds1302 signal lines?

@vargham
Copy link
Owner Author

vargham commented Mar 12, 2018

  1. Yes, the original firmware worked.
  2. Changed pin mode and everything is the same.
  3. I will check it with logic analyzer.

@vargham
Copy link
Owner Author

vargham commented Mar 13, 2018

I checked. CE and CLK is always low. Only IO is changing.

@vargham
Copy link
Owner Author

vargham commented Mar 13, 2018

OK, I fixed.

  1. All DS1302 pins set to bidirectional.
  2. #if defined HW_MODEL_D does not work at the DS section of hwconfig, so the wrong pins have been used. Just commented out to test. I will clean that part.

@zerog2k
Copy link

zerog2k commented Apr 13, 2018

Curious if you had to explicitly set P1M0 and P1M1 registers to 0. I understand from datasheet that this should be the default, and I don't recall where we were setting these otherwise.

@Madhava-04
Copy link

I also get this error 1F 7F. Please help me by sending Hex file because I dont know how to compile. I have YD-020 model kit as per attached file
yd-020 clock

@pctong
Copy link

pctong commented Jul 23, 2020

Here is a link to the STC15F204EA new firmware for Madhava-04 to try on your new model. the only difference is your light sensor is on P1.3 but my ZM-907AA is on P1.5. If your test is ok, I can recompiled the firmware for P1.3
https://github.com/pctong/STC15F204EA-clock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants