E
E
Evgeny Zalivadny2020-10-14 00:06:50
Arduino
Evgeny Zalivadny, 2020-10-14 00:06:50

How to connect real time clock to Arduino analog pins?

The LCD Shield 1602 is put on top of the Arduino UNO. I connect to it through the LiquidCrystal library, its contacts occupy almost all digital pins, namely: d4 = 4, d5 = 5, d6 = 6, d7 = 7, rs = 8, en = 9 I apply voltage to the relay on pin 3. It turns out that only pin 2 remains free.

I want to hang up another real-time clock (there are DS1302 and DS1307), and they have 3 more pins in addition to power and ground (and maybe I’ll hang a buzzer in addition), but I don’t figure out how to do it?

Do I understand correctly that you need to use analog pins? If so, should they be set to output or input?

Thank you in advance!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
evgeniy_lm, 2020-10-15
@Nordihan

Do I understand correctly that you need to use analog pins?

Not quite, but almost. RTCs work on the I2C protocol, and in Arduino hardware I2C is output to pins A4, A5. Those. formally they can be analog inputs, but in your case they will have a different function

V
VT100, 2020-10-14
@VT100

If the connection diagram with the LCD and its sketch are "unchanged", then you can "share" the digital outputs between the LCD and the RTC. As long as the !EN line is set to "1", all other lines used for the exchange with the LCD can be used for other purposes.

G
Grigory Boev, 2020-10-14
@ProgrammerForever

There are many options
1) Take an IIC adapter for the display
2) Programmatically divide the clock and display operating time, as suggested above
3) "Analog" outputs are an additional functionality, they can also work as digital ones.

P
pfg21, 2020-10-14
@pfg21

no. take a percent with a large number of conclusions.
outputs are universal, put them in "digital" mode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question