Author Topic: Can I read time data from an RTC (Real-Time Clock) chip without a MCU?  (Read 921 times)

0 Members and 1 Guest are viewing this topic.

Offline Jurek_pTopic starter

  • Newbie
  • Posts: 7
  • Country: pl
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/1

Thanks Jurek
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11183
  • Country: us
    • Personal site
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.
Alex
 

Offline Jurek_pTopic starter

  • Newbie
  • Posts: 7
  • Country: pl
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11183
  • Country: us
    • Personal site
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.
Alex
 

Offline Jurek_pTopic starter

  • Newbie
  • Posts: 7
  • Country: pl
you need to connect the signals from the Bus Interface.

So 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?

Setup AD2 to follow the timing diagrams.

So I need to set a timing digram from Figure 1,2,3?

Thanks J
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3032
  • Country: us
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11183
  • Country: us
    • Personal site
So all of the channels like OSC1, OSC2, CE, DS, R/W, AS and A0-A7 must be connected to with AD2?
OSCx 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.
Alex
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5790
  • Country: de
First, get the real datasheet, which is the Motorola/Freescale/NXP one. Hitachi just copied the part:
https://www.nxp.com/docs/en/data-sheet/MC146818.pdf
It's updated and readable.
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 830
  • Country: gb
Re: Can I read time data from an RTC (Real-Time Clock) chip without a MCU?
« Reply #8 on: September 15, 2023, 07:17:34 am »
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 a lot of 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf