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

Will it work with DS3231? #24

Open
DerPicknicker opened this issue Jul 20, 2023 · 8 comments
Open

Will it work with DS3231? #24

DerPicknicker opened this issue Jul 20, 2023 · 8 comments

Comments

@DerPicknicker
Copy link

Hi,

you also have a DS3231 Library do you know it's working together with the ssd1306 OLED? I also created another issue here but I am sure that the issue belongs to the lib (I used different I2C Ports)

So Could you test this for me or give me a hint how to combine the OLED with an DS3231?

Thank you in advance

@nopnop2002
Copy link
Owner

nopnop2002 commented Jul 20, 2023

The problem isn't the library, it's the usage of the library.

The UncleRus library has the ability to safely use multiple i2c devices.

You need to fully understand the specifications of the UncleRus library.

If you use other i2c devices at the same time as the UncleRus library, you will need to modify your i2c driver installation.

The easiest way is to use ssd1306 from spi.

This will completely separate the DS3231 and ssd1306.

@DerPicknicker
Copy link
Author

Hi @nopnop2002 ,

thank you for the detailed explanation. SPI would be a good choice but I don't have the pins for it. I2C is a must thing. Is there any way that you can make the display driver working with the uncle Russ or with your Ds3232 library you have in your GitHub account? I already use different Ports and not the same Hardware at the same time. The espS3 has two i2c ports so it should be possible to use one Rtc and one display with the s3. This would be really great.

Is it possible to make it working using the 2 ports of the s3? I tried that already but it doesn't seem to work. I guess it will be easier to make the Rtc and the display independent.

Many thanks and best regards

@nopnop2002
Copy link
Owner

nopnop2002 commented Jul 21, 2023

I feel that if you use two sets of i2c GPIO and change this, it will work.

https://github.com/nopnop2002/esp-idf-ssd1306/blob/master/components/ssd1306/ssd1306_i2c.c#L13

@DerPicknicker
Copy link
Author

Hi again,

I guess I already tried that.... I can double check it later. But I am to 90% sure that I changed it to 1 and let the Rtc to 0. This is why I am so curious.

@DerPicknicker
Copy link
Author

@nopnop2002 ..

I checked now the Code again and as I said. The Code uses different I2C Ports:
Init the DS3231:
image
and the I2C Port for the OLED Display:
image

And yes I tried it vice versa..... Do you have any Idea how to get this via I2C working?

@nopnop2002
Copy link
Owner

nopnop2002 commented Jul 24, 2023

works fine.

    SSD1306_t dev2;
    i2c_master_init(&dev2, CONFIG_SDA_GPIO, CONFIG_SCL_GPIO, CONFIG_RESET_GPIO);
    ssd1306_init(&dev2, 128, 64);
    ssd1306_clear_screen(&dev2, false);
    ssd1306_contrast(&dev2, 0xff);

    i2c_dev_t dev;
    memset(&dev, 0, sizeof(i2c_dev_t));

    //ESP_ERROR_CHECK(ds3231_init_desc(&dev, 0, CONFIG_EXAMPLE_I2C_MASTER_SDA, CONFIG_EXAMPLE_I2C_MASTER_SCL));
    ESP_ERROR_CHECK(ds3231_init_desc(&dev, 1, CONFIG_EXAMPLE_I2C_MASTER_SDA, CONFIG_EXAMPLE_I2C_MASTER_SCL));

@DerPicknicker
Copy link
Author

I will try it tomorrow

@nopnop2002
Copy link
Owner

The latest version allows you to specify the I2C port from the menu.
config-i2c-port

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

2 participants