Can I read time data from an RTC (Real-Time Clock) chip without a MCU? - Page 1
Forum section: electronics / general

author: Jurek_p
author_rank: Newbie
timestamp: July 21, 2023, 05:30:07 pm
content: I have an HD146818 (Motorola MC146818) integrated circuit, which is a real-time clock. I would like to build a simple clock on it, which will control an 8-segment display. I read the datasheet for this chip and it is not clear to me whether the chip can operate independently without a microprocessor. My assumption is that time information such as hours, minutes, and seconds, etc. are stored in the HD146818, and access to them, i.e. reading, is done through the address pins A0-A7 (pin 15 "high"), taking into account the appropriate configuration of other pins for data reading. I assume that I can decode the A0-A7 pins (from binary to BCD) and read the time. Is this possible?How can "I start it up"? Please advice me.https://datasheetspdf.com/pdf-file/555707/HitachiSemiconductor/HD146818/1Thanks Jurek

author: ataradov
author_rank: Super Contributor
timestamp: July 21, 2023, 05:44:07 pm
content: You read the data by writing the address of the register and then reading the value. It would be incredibly complicated circuit, essentially replicating an MCU.This is something $1 MCU can do for you, and it would even include an RTC, so you don't need this ancient chip.

author: Jurek_p
author_rank: Newbie
timestamp: July 21, 2023, 08:00:28 pm
content: Thanks Alex,I do not write a code (just yet:)) so I wondering if I could use an Analog Discovery 2 to use it as a write / read device? AD2 has 16 I/Os so I could write a pattern to startup the chip.Is it sounds possible? I just want to play with this ancient chip and get to know how it works.J

author: ataradov
author_rank: Super Contributor
timestamp: July 21, 2023, 08:17:57 pm
content: Yes, AD2 would work for this. Look at the figure 10, you need to connect the signals from the Bus Interface. AD2 can only do 3.3 V levels, so this RTC should be powered from 3.3 V as well. Setup AD2 to follow the timing diagrams.

author: Jurek_p
author_rank: Newbie
timestamp: July 22, 2023, 11:44:19 am
content: Quote from: ataradov on July 21, 2023, 08:17:57 pmSo I need to create a BUS with my AD2 and use appropriate channels to send and receive the informations to/from RTC, right? So all of the channels like OSC1, OSC2, CE, DS, R/W, AS and A0-A7 must be connected to with AD2?Quote from: ataradov on July 21, 2023, 08:17:57 pmSo I need to set a timing digram from Figure 1,2,3?Thanks J

author: ledtester
author_rank: Super Contributor
timestamp: July 22, 2023, 12:40:25 pm
content: You're going to find it's going to be a lot easier to interact with this chip with an MCU.One complication is that the ADx lines are bi-directional -- i.e. sometimes they are inputs to the chip and other times they are outputs. This is very easy to do with an MCU -- not so sure with the AD2.

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2023, 03:41:21 pm
content: Quote from: Jurek_p on July 22, 2023, 11:44:19 amOSCx pins must have the crystal circuit assembled as shown in the datasheet.. And note that it might not work on a breadboard due to stray capacitance.I think you are taking on more than you can handle at this time. You will waste a lot of time, since it is hard to make incremental progress with this, you need to get a lot of things right at the same time to get anything working.Get an Arduino board and play with it first, then it would be so much easier to figure out this chip. And may be you won't want to figure out out anyway.

author: Benta
author_rank: Super Contributor
timestamp: July 24, 2023, 09:15:44 pm
content: First, get therealdatasheet, which is the Motorola/Freescale/NXP one. Hitachi just copied the part:https://www.nxp.com/docs/en/data-sheet/MC146818.pdfIt's updated and readable.

author: TomS_
author_rank: Frequent Contributor
timestamp: September 15, 2023, 07:17:34 am
content: Short answer? Yes, of course you can. But youre going to need a lot of surrounding logic to do so.Longer answer:The chip itself is not designed to (in)directly drive displays, so in order to do that you first have to read the registers of the chip that store the data, and then write those values to some kind of display driver. Typically that would be done via a CPU or some kind of MCU.The MC146818 has a slightly more complicated bus where the address of the register you want to access is latched into the chip via the same pins that you also read and write data with, so this complicates the process of accessing the chip, especially via pure hardware. With a more traditional bus with a few address pins along side a data bus it would be conceivable to make a simpler hardware based state machine that loads an up/down counter with the appropriate starting address and reads out the required registers into some decoding circuitry while incrementing or decrementing the address of the register to read. Still, that is alotof effort and the resulting PCB could be quite big.Using an MCU will be much easier. Many e.g. Microchip PICs have what is called a "parallel master" peripheral that gives you a small piece of addressable external memory space which you can read and write like a regular memory device. This at least spares you from having to write a lot of software to mimick a CPU bus. Using something like this would help to simplify the logic and circuitry required to interface with the chip, and then interfacing via an SPI peripheral you could use something like some TLC9516 LED drivers to drive the displays themselves.Food for thought.