Skip to content
New issue

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

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

Already on GitHub? # to your account

Question about wiring #3

Open
Patriboom opened this issue Jan 17, 2022 · 1 comment
Open

Question about wiring #3

Patriboom opened this issue Jan 17, 2022 · 1 comment

Comments

@Patriboom
Copy link

Patriboom commented Jan 17, 2022

Hello,

thanks for your code.

I try to figure out the wiring, because some pins on my pico are already connected.
In your code we read:
ds = ds1302.DS1302(Pin(5),Pin(18),Pin(19))

Which are pins 5, 18 et 19 ?
5 is GP2 / SPI0-SCK OR GP3/SPI0-Tx OR GP5 ?
18 is gnd OR I2C SDA/SPI-SCK/GP14 OR GP18 ?
19 is I2C SDA/SPI-SCK/GP14 OR I2C SCL/SPI-TX/GP15 OR GP19 ?

I've tried with the following wiring:

Pico ==>>> UTC
GND -> GND
3.3V -> VCC
I2C0-SDA (pin 1) -> DAT
I2C0-SCL (pin 2) -> CLK
GP4 (pin 6) -> RST

with no success.

Thanks for you help.

@Patriboom
Copy link
Author

Here answer to my question about the connction

image

With the follow code:

from machine import Pin
import ds1302

ds = ds1302.DS1302(Pin(10),Pin(11),Pin(12))

ds.date_time([2022, 2, 8, 3, 14, 23, 1, 0]) # set datetime.

hre = ds.date_time() # returns the current datetime.
print(hre)
print(ds.hour()) # returns hour.
print(ds.second()) # set second to 10.

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

No branches or pull requests

1 participant