Author Topic: RTC MC146818 / HD146818 problem  (Read 2915 times)

0 Members and 1 Guest are viewing this topic.

Offline WawavounTopic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: fr
  • Someday I'll get you, Red Baron !
RTC MC146818 / HD146818 problem
« on: December 15, 2021, 09:33:45 am »
Hello there !

I have rebuild the Microbox II 6809 based computer.

This computer has a rtc chip MC146818 keeping date, time and also some parameters. The rtc is backed up by a 3.6 V battery.

It seems that SOMETIMES rtc datas are corrupted at power down.
The computer wont restart.
By clearing the rtc (pin 22 to gnd) default values are restored at next boot and he restart well.

I have try two different chips (Motorola and Hitachi) with the same problem.
 
I put the scope on CE pin of the rtc set into one shot mode. At power down the scope trigger and I see several pulses.

The monitor has no code for doing something into the rtc at this moment so this is abnormal.
This CE signal is made by decoding E, S0, S1 coming from the 74LS783 SAM and A2, A3, A4 coming from the proc (via buffers).
This is working well because I can read and write easely into the rtc.

I have try 3 different power supplies with the same problem (one is linear serial with cut off button at the output so power down is immediate, nos discharging of capacitors etc...).

I will put the logic analyzer and try to understand how these pulses are generated.

I need some advices if this is a kown problem and if its the case what are usually the solutions.

Regards.
Philippe

 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: RTC MC146818 / HD146818 problem
« Reply #1 on: December 15, 2021, 04:41:20 pm »
I don't necessarily have a solution, but just did a bit of reading and am thinking that the battery backup circuitry deserves a closer look...because...you have not described/discussed that piece of the puzzle.

If I am reading correctly, the power backup is shown in the February issue linked here http://www.sardis-technologies.com/oth6809/microbox2.htm

Diodes and no caps...[edit: correction C5 is part of the backup circuitry] compare that to the 'recommended' scheme. Is it possible that with your battery the diode drop is getting borderline for the MC146818 as suggested by this guy and his tests with an IBM MB http://www.minuszerodegrees.net/misc/5170_battery_3.6v.htm

AP note http://www.bitsavers.org/components/motorola/_appNotes/AN-0856_Low_Power_Considerations_MC146818.pdf
DS AP Note on replacement with DS parts https://www.jameco.com/Jameco/Products/ProdDS/25101.pdf

Just thinking out loud and where I would start looking - hope it helps.
« Last Edit: December 15, 2021, 05:26:50 pm by DrG »
- Invest in science - it pays big dividends. -
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: RTC MC146818 / HD146818 problem
« Reply #2 on: December 15, 2021, 05:28:54 pm »
I looked at the Electronics Today issue in question.
The problem is the Q2 circuit for pulling /CE high when the supply voltage drops. The cutoff voltage needs to be better defined.
I'd suggest modifying that part to use a real voltage supervisor driving the base of Q2, something like an MC34164-5, or whatever you can find on the market.
Drive Q2 directly from the MC34164, and redefine R31 as pull-up resistor between the two. It's already connected as such.

This would ensure a clean power-up and power-down for the RTC.

EDIT: I would also connect R32 to the RTC VCC pin (24) instead of directly to the battery. Otherwise the high level at the /CE pin is marginal.



« Last Edit: December 15, 2021, 06:06:15 pm by Benta »
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: RTC MC146818 / HD146818 problem
« Reply #3 on: December 15, 2021, 06:17:30 pm »
I was hoping somebody else would look which is why I posted the link to the schematic. Attached is the circuit from the article and the ap note circuit and description.

So, I don't understand why CE is connected to the nicad at all in the article? Note that in the ap note the recommended method does not connect CE to the nicad. In fact, why not duplicate that scheme and just add the inverter and pull down and not use Q2 at all?
- Invest in science - it pays big dividends. -
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: RTC MC146818 / HD146818 problem
« Reply #4 on: December 15, 2021, 06:57:59 pm »
So, I don't understand why CE is connected to the nicad at all in the article? Note that in the ap note the recommended method does not connect CE to the nicad. In fact, why not duplicate that scheme and just add the inverter and pull down and not use Q2 at all?
I don't understand either and have already commented on this.

The Motorola circuit is unnecessarily involved and needs higher voltages than the +5 V in the 6809 SBC.
As PCBs probably already exist, my suggestion of adding one TO-92 device and relocating one wire seemed to be the simplest.

 

Offline WawavounTopic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: fr
  • Someday I'll get you, Red Baron !
Re: RTC MC146818 / HD146818 problem
« Reply #5 on: December 16, 2021, 02:41:57 pm »
What do you think about that ?
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5869
  • Country: de
Re: RTC MC146818 / HD146818 problem
« Reply #6 on: December 16, 2021, 06:48:48 pm »
I've no idea what it's supposed to do, but it seems upside down.
Please read the previous posts.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: RTC MC146818 / HD146818 problem
« Reply #7 on: December 16, 2021, 07:16:24 pm »
So, I don't understand why CE is connected to the nicad at all in the article? Note that in the ap note the recommended method does not connect CE to the nicad. In fact, why not duplicate that scheme and just add the inverter and pull down and not use Q2 at all?
I don't understand either and have already commented on this.

The Motorola circuit is unnecessarily involved and needs higher voltages than the +5 V in the 6809 SBC.
As PCBs probably already exist, my suggestion of adding one TO-92 device and relocating one wire seemed to be the simplest.

Yeah I kind of agree that the entire Motorola circuit *may* be more than needed. Looking at the thread again, it is not yet known exactly why the glitch is occurring.

Assuming that the glitch occurs with some repeatability simply by powering down and up again, I would probably disconnect the CE from the bat first and see if it had any effect.
« Last Edit: December 16, 2021, 07:22:11 pm by DrG »
- Invest in science - it pays big dividends. -
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1091
  • Country: nz
  • Retired Electronics Design Engineer
Re: RTC MC146818 / HD146818 problem
« Reply #8 on: December 16, 2021, 08:18:21 pm »
I looked at the Electronics Today issue in question.
The problem is the Q2 circuit for pulling /CE high when the supply voltage drops. The cutoff voltage needs to be better defined.
Agreed.

The transistor controlling /CE won't turn off to protect the RTC contents until the main Vcc drops below 0.6V. This is way below the Vcc where you can reasonably expect the control logic to continue to behave and consequently there could be spurious writes to the RTC registers.

A better cut-off threshold than that solely defined by the transistor Vbe is required.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf