again about cmos [1/2]
ZXNet echo conference «real.speccy»
From Aleksandr Majorov → To All 7 June 1998
Hello, Andrey!
04-06-98 at 22:13:01 Andrey Isaev wrote for Aleksandr Majorov ≈ 500:812/00
I don’t understand, is the gate buggy again? ^^^^^^^^^^^^
KF>>> 4.ZXNEWS. 5.*MAS*...
AI>> ^^^ what kind of miracle is this?
AM>> YOU ARE A MIRACLE! ;-)))
AI> Well, I'm sorry, I thought it was a computer, but it turns out... you :)
;-)))))
although you can call me a computer, a couple of days ago
in .drink I proved it ;-)
[ ]
AM>> here's a piece about CMOS
AI> that's all there is about CMOS or the current part?
current part, and at the beginning there is a dock on the chip...
Right now I’ll look and glue it...
Hmm... an article for 13 kilos with eag pulls...
Ha! I re-read it here, and noticed a mistake...
You might think that this was really “torn”
from the taste, and is compatible with it...
Although _somehow_ it’s similar! in relish the watch is also
in TR-DOS hanging!
========================================================= =
╔═───────────────════ ════───────────────═╗
│ CMOS clock │
╚═────────────────── ────────────────────═ў
Alexander Mayorov
Dmitry Lomov
In this issue we decided to tell you about such a wonderful thing as a CMOS clock chip. What kind of animal is this and
what is it needed for, you ask?
Butsee for yourself!
This microcircuit provides time calculation, independent of the computer, generation of interrupt signals from the alarm clock, and
can also be used as a small
non-volatile RAM of 50 bytes.
A special feature of CMOS clocks is their
extremely low power consumption! (according to the reference book, the current consumption is from 0.1 to 4 mA!).
If you connect a backup power supply to this microcircuit, then the calculation of time and the safety of information in the internal RAM will be guaranteed even when the computer is turned off.
You may ask - why do I need this?
Indeed, under normal conditions, a clock
not really needed on a computer.
But! If from time to time you write
letters in Ehi, then this watch will save you
from the need to constantly look at the calendar and wall clock to put down
the time/date. Well, for a BBS or a "mailer" a clock is very, very necessary!
Actually, the need for a clock was
one of the reasons for creating a new version of BBS.
Which, perhaps, will be discussed in the next issues of Newska.
Well, now closer to the point!
The microcircuit is called 512VI1, its proprietary prototype MC 146818, as well as the largest rulez - DALLAS 1287, which has internal quartz and a battery for 10 years.
It should be said that suchmicrocircuits
are located in PCs 286 and 386, and therefore are accessible
thanks to the great Upgrade...
First, the assignment of the pins:
01 NC not used
02 OSC1 generator input
03 OSC2 generator output
04 AD0 \
05 AD1 \
06 AD2 \
07 AD3 multiplex bus
08 AD4 address/data
09 AD5 /
10 AD6 /
11 AD7 /
12 GND ground
13 /CE crystal select
14 AS address strobe
15 R/W read/write
16 NC not used
17 /DS data strobe
18 /RES reset input
19 /IRQ interrupt request output
20 SED frequency control CKOUT
21 CKOUT clock signal output
22 PS supply voltage failure control
23 SQW software-controlled frequency divider output
24 +Ucc +3...+5 volts
And now more details:
To the output 02 (OSC1) it is necessary to supply frequency from an external oscillator, or connect a quartz resonator to pins 02/03 (OSC1/OSC2).
Pins 4...11 (AD0...AD7) - address-
res/data bus, connected to the processor data bus.
Pin 13 (/CE) - selection crystal. If available, log. "1" at this input the microcircuit
is blocked.
There is one feature: at this input there must bestate log "0" during the entire cycle of access to the microcircuit.
Ie. Simultaneously with (or before) the selection of the register address, log
0 should be set at the input /CE, and its state should not change during the entire cycle of accessing the selected register!
It is most convenient and simple to set
the state of log "0" at this input during
the entire time the computer is running.
The selection of the register number is carried out by sending it to the bus ADDRESS/DATA (AD0...AD7)
and applying log."1" to input 14 (AS)
To read/write data to/from register(s)
pins 15 (R/W) are used - selecting the read/write mode (respectively log."1"
and "0") and 17 (DS) - data strobe.
When applying log "0" At the R/W pin, data is written to a previously selected
register, and when a log "0" is applied to the
DS pin, data is read from the register.
The appearance of a log "0" at pin 19 (/IRQ)
informs about the process of a system interrupt
BIS. In all other cases, the data output is in the third logical state (high impedance).
Applying a logic "0" to the 22nd pin (/PS) informs the LSI that a supply voltage failure has occurred and the contents of the registers are not reliable. If there isbackup
power supply, then apply a
log to this input. "1".
At pin 23 (SQW) there are pulses
of frequency, which is obtained by dividing the frequency of the clock generator by a coefficient
set by software.
At output 21 (CKOUT) there are pulses
the frequency of which depends on the state of input
20 (SED). If there is a log "1" there, the frequency at the SQW output coincides with the frequency of the generator (OSC1-OSC2). If there is
log "0" at the SED input, the frequency at the
SQW output is four times less than the frequency of the generator (OSC1-OSC2).
The chip has 64 eight-bit
registers. When working with them, you must first
indicate which register to work with (write its number in the address register), and then write/read.
Register numbers
#00 SECONDS
#01 SECONDS (ALARM)
#02 MINUTES
#03 MINUTES (ALARM CLOCK)
#04 HOURS
#05 HOURS (ALARM CLOCK)
#06 DAY OF THE WEEK
#07 DAY OF THE MONTH
#08 MONTH
#09 YEAR
#0A REGISTER A
#0B REGISTER B
#0C REGISTER C
#0D REGISTER D
#0E General purpose RAM
... General purpose RAM
#3F General purpose RAM
#0C,#0D - read only
#00,#0A - high orderdigits read only
DESCRIPTION OF REGISTERS A...D
─════════════════════════─
REGISTER (individual bits)
────────────────────────────
7 UIP "1" in this bit means that
information is being updated and You can’t work with the clock
, you need to wait
for some time. Duration of update cycles
depending on the frequency
of clock pulses:
│frequency │ duration │
│ MHz │ update cycle, ms│
│4.194304 │ 248 │
│1.048576 │ 248 │
│0.032768 │ 1984 │
32768 1048576 4194304 RESET
6 DV2 frequency 0 0 0 1
5 DV1 quartz 1 0 0 1
4 DV0 0 1 0 x
3 RS3 Setting the frequency at pin
2 RS2 SQW (23) and interrupt period
1 RS1 IRQ (19)
0 RS0
IRQ - signal to issue an interrupt or
DC. frequency, either at the end of the update cycle, or from the alarm clock.
IRQ = 1000 / SQW
SQW is used to send a signal from the
alarm clock
For example: frequency SQW = 256 Hz, period
equal to 1000/256 = 3.9ms
D3 D2 D1 D0 FREQUENCY,Hz PERIOD,ms
00 1 1 8192 0.122
0 1 0 0 4096 0.244
0 1 0 1 2048 0.488
....................................
1 1 1 0 4 250
1 1 1 1 2 500
=============================================
Это не все
*MAS* с кувалдой
From Roman Milukov → To All 10 June 1998
Hello, Aleksandr!
07 Jun 98 Aleksandr Majorov, hoping that Andrey Isaev will read,
wrote:
AM> part of the current, and at the beginning there is a dock on the chip...
According to my information (Radio Yearbook'89) 521VI1 consumes no more than 50
uA at frequency quartz 32.768 kHz.
AM> 14 AS address strobe
AM> 15 R/W read/write
AM> 17 /DS data strobe
These inputs have broader capabilities:
The address is written to the buffer upon the decline of the positive
impulse on AS. At the same moment, the
logical level on the 17th leg (DS) is analyzed and, depending
on it, the further mode of operation with
the DS and R/W inputs is established.
*MAS* used one of the options.
The glitch is different:
If at the moment of the decline of the AS pulse the DS input was "0",
then moment of a positive pulse on DS, the data will be
read from the microchip if R/W is “1”, or written into it
if R/W is “0”.
AM> Pin 13 (/CE) - crystal selection. If there is a log. "1" at this input, the
AM> microcircuit is blocked.
AM> It is most convenient and simple to set
AM> at this input to the log "0" state during
AM> the entire time the computer is running.
The microcircuit allows a permanent connection of this leg
to the "ground". But it is useful, in my opinion, to be able to
allow access to the microcircuitonly from programs where
the clock is used. In Gluck's circuit this is done with bit "7" of port #EFF7. And there is no need to go under TR-DOS.
AM> The appearance of log "0" at pin 19 (/IRQ)
AM> reports the process of a system interrupt
AM> LSI. In all other cases of data, the
AM> output is in the third logical state -
AM> (high impedance).
More precisely, the output is made according to the “open drain” circuit.
I think it would be interesting to use this output...
Put it on NMI...
All the best.
Regards Roman Milukov.
From Aleksandr Majorov → To All 12 June 1998
RM> Mikpukha allows the constant connection of this leg
RM> with the “ground”. But it is useful, in my opinion, to be able
for example, we connected the Dallas chips this way, and batteryless
chips - according to the same scheme - there is power on the computer - "0",
no - "1"...
RM> to allow access to the microcircuit only from programs, where
what, other programs can get into the clock and throw it off?
then you need to choose good ports, for example in TR-DOS ;-)))
Why such nonsense?
My watch has been standing for almost a year, and no one has knocked it down yet...
I myself, and the glitches of my software do not count ;-)))
RM> the watch is in use. In the Gluck circuit, this is done by bit “7”
RM> of port #EFF7. And you don’t need to go under TR-DOS.
Does RESET reset this port? ;-))
And on Scorpio there is no #EFF7 port, but under TR-DOS
there are free ports...
From Roman Milukov → To All 17 June 1998
AM> yeah, don’t forget the interrupt manager ;-))))
?!! This is probably some kind of 40-legged boar? A? ;)
You can do without a dispatcher. Or you can make the simplest one using a couple of
logical elements, controlling the free bit of the same #EFF7. Depending on
how you decide to use the capabilities of this leg.
AM> from hais int where does it go? ;-)))
So I also have “magic” coming from the controller there! ;)
All the best.
Roman.