ZX-News #35
26 июня 1997
  Железо  

CMOS-clock - Chip CMOS-clock for a computer (connection diagram).

<b>CMOS-clock</b> - Chip CMOS-clock for a computer (connection diagram).
               CMOS-clock



                         Alexander Mayorov

                         Dmitry Lomov



  In this issue we decided to tell you about
such a wonderful thing as a chip
CMOS-clock. What kind of a beast and
what it is, you ask?

  But see for yourself!


  This chip provides independent computer calculation time, the 
production of interrupt signals from the alarm, and can also be 
used as a small NVRAM 50 bytes.



  Feature of the CMOS-clock is their
extremely low power consumption! (By
directory of the current consumption of 0.1
to 4mA!).


  If this chip to connect a backup power source, the 
calculation of time and preservation of information in the 
internal RAM will be guaranteed and if you disable your 
computer. 


  You may ask - well, why do I need?

  Indeed, in normal clock
computer is not very much and want.


  But! If you're writing from time to time
letter ekhi, the data clock relieve you
the need to constantly look at the calendar and clock, to put 
down time / date. But for the BBS, or "Myler" watch very, very 
needed! 


  Actually need to watch yavilas
one of the reasons for the creation of a new version of the BBS.
About which, perhaps, will be discussed in the following issues 
Newskah. 



        Well, now closer to the point!


  Chip called 512VI1, its proprietary prototype MS 146,818, and 
most rulez - DALLAS 1287, has an internal battery and quartz 
for 10 years. 


  It should be said that such chips
stand in the PC 286 and 386, and therefore available
Thanks to the great Upgrades ...



      To begin pin assignment:


  NC 01 is not used

  02 OSC1 input generator

  03 OSC2 output of the generator

  04 AD0 \

  05 AD1 \

  06 AD2 \

  07 AD3 multiplexed bus

  08 AD4 address / data

  09 AD5 /

  10 AD6 /

  11 AD7 /

  12 GND ground

  13 / CE chip-select

  14 AS address strobe

  15 R / W Read / Write

  NC 16 is not used

  17 / DS data strobe

  18 / RES reset input

  19 / IRQ output interrupt request

  20 SED frequency control CKOUT

  21 CKOUT output clock signals

  22 PS control supply voltage failure

  23 SQW output of the program-controlled frequency divider

  24 + Ucc +3 ... +5 V


 And now the details:


  At the conclusion 02 (OSC1) must submit
frequency of the external oscillator, or connected to pin 02/03 
(OSC1/OSC2) quartz. 


  Conclusions 4 ... 11 (AD0. .. AD7) - Bus address / data bus 
connects to the data prrotsesora.



  Pin 13 (/ CE) - Crystal's choice. In the presence of the log. 
"1" on this input chip blocked.


  There is one more feature: at this entrance should be the 
status log. "0" for the entire cycle of treatment to the chip. 
Ie simultaneously with (or before) the choice of register 
address input / CE shall be established a log. "0", and its 
status should not be change during the entire cycle of 
treatment to selected case!


  The most convenient and easy to install
on this input state of the log. "0" for
the entire duration of the computer.


  The choice of register number is fed to the bus ADDRESS / 
DATA (AD0. .. AD7) and submission log. "1" to input 14 (AS)



  Read / write data from / to register (a)
used the findings in 1915 (R / W) - Selecting the read / write 
(or a log. "1" and "0") and 17 (DS) - Data Strobe.



  When a log. "0" to output R / W data is written into the 
previously selected register, and the feeding log. "0" on output

DS - data read from the register.


  Poyavlyanie log. "0" on pin 19 (/ IRQ)
reports on the process of system interruptions
BIS. In all other cases, the data output is in the third logic 
state (high-impedance). 


  Submission of a log. "0" on the 22-th output (/ PS) informs 
the BIS that failed supply voltage, and the contents of the 
registers unreliable. If there is a reserve

power source, then this input file
log. "1."


  On the derivation of 23 (SQW) have the momentum
frequency, which is obtained by dividing the clock generator 
frequency by a factor defined by software.



  At the exit 21 (CKOUT) have the momentum,
frequency depends on the input state
20 (SED). If there is there a log. "1" SQW output frequency 
equal to the frequency generator (OSC1-OSC2). In the presence of

log. "0" input SED output frequency
SQW four times menshe frequency oscillator (OSC1-OSC2).



  In the chip are 64 eight-
register. When you work with them must first
indicate which register to work (record number in the address 
register) and then perform the read / write. 



             Non registers


       # 00 sec

       # 01 SEC (ALARM)

       # 02 MINUTES

       # 03 Minutes (ALARM)

       # 04 HOURS

       # 05 HOURS (ALARM)

       # 06 DAY OF THE WEEK

       # 07 DAY OF THE MONTH

       # 08 A MONTH

       # 09 YEAR

       # 0A REGISTER A

       # 0B B REGISTER

       # 0C REGISTER C

       # 0D REGISTER D


       # 0E general-purpose RAM

       ... RAM is general-purpose

       # 3F general-purpose RAM


# 0C, # 0D - read only
# 00, # 0A - senior level read-only



         DESCRIPTION OF THE REGISTERS A. .. D



        REGISTER A (individual bits)


7 UIP "1" in this bit indicates that

      being updated information and hours
      mi can not work, wait

      some time. Cycle Time

      updates depending on the frequency

      Clock:



     frequency duration

       MHz refresh 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
DV0 4 0 1 0 x

3 RS3 Set the frequency on pin
2 RS2 SQW (23), and period interrupt
1 RS1 IRQ (19)
0 RS0

 IRQ - interrupt signal to the issuance of any
post. frequency or at the end of the update cycle, or from an 
alarm clock. 

  IRQ = 1000 / SQW

 SQW is used to feed the signal from the
Alarm
 For example: the frequency of SQW = 256 Hz, period
is equal to 1000/256 = 3.9ms



  D3 D2 D1 D0 Frequency, Hz PERIOD, ms


  0 0 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



        REGISTER B (individual bits)


7 SET "1" ban update

       (To set the time).

6 PIE interrupt enable, with a period

       specified in the RS-bit register A.

       Cleared by Reset'u.

5 AIE resolution Interrupt Alarm
       ka. Cleared by Reset'u.

4 UIE interrupt enable at the end

       update cycle. Cleared

       by Reset'u.

3 SQWE permit issuance of information on you
       course of SQW. Cleared by Reset'u.

2 DM type of data: 0 - BCD

                   1 - Binary

A 24/12 score: 0 - 12 hours

              1 - in 24 hours

0 DSE "1" enables automatic transfer
       move from summer to winter time

       back.
 Daylight saving time is carried out in
3h nights voskesene last April, and
on winter nights in 1 hour the last Sunday in October.



        REGISTER C (individual bits)



  All bits are reset to Reset'u or
reading Register C.

7 IRQF flag interrupt request. Establishes
        Lebanon into a "1" on condition that:

        (PF and PIE) or (AF and AIE) or

        (UF and UIE).

        If IRQF = "1", then the output IRQ

        (19) is set to "0".

6 PF ustanavlvaetsya in front of a signal

        at the output of the internal divider

        frequency selected in accordance

        with RS-digits.

5 AF is set to 1 if the coincidence

       current time and time Alarm
       nick.

UF 4 is set to 1 after

       update cycle.

3 = 0
...
0 = 0



        REGISTER D (individual bits)


7 is set to log. "0" if

       food was wasted and information

       unreliable.

       Set to "1" on Reset'u

       or when reading the register D.

6 = 0
...
0 = 0



              Data Format



  Sunday = 1, Monday to. = 2, etc.


  January = 1 February = 2, etc.


  1997 = 97 1998 = 98, etc.


  Records the number of days per month and accounted for leap 
years. If the registers # 00 ... # 09 record number in the range

# C0 ... # FF - it is indifferent state.
Ie if the clock alarm = # FF, then it will fire every hour.



         The alarm

       When the alarm



  Necessary in the case {B} to set
AIE = SQWE = 1 UIE = PIE = 0.

  Frequency of the sound output is given by SQW
RS-bit register {A}. At operation
Alarm IRQ output will be installed in
log. "0". Ie for sound generation need
merge the outputs of OR SQW and IRQ
 You can put the RC-chain, which, after
nokotorogo time after the IRQ in
# 0 sfoormiruet reset signal, and the sound stops.



             Connection scheme



  If you have a controller SMUG, then
all you need to do is stick a chip CMOS-hours in accordance 
socket. 


  Well, if you "bad luck", you will have
little Popayán ...


                Generator



                  2 (OSC1)


     22M

                  3 (OSC2)


             470k



                    quartz:

October 20 32.768 kHz

             * 1.048576 MHz

                    4.194304 MHz



   Choice Crystal and voltage control



                        5.1K

                                  24 (+ Un)



      / 5.1K / 13 (/ CE)

     / / K

                       KT315
 5 \ \ e

      \ \


    KS133



                5.1K
 24 (+ Un) 22 (PS)



            Nutrition Products



              \

               \

      B 5 / 24 (+ Un)

              /



              \

               \

               /

              /


             +

              battery, 3.6V



         Connecting to a Computer



  You must connect the signals AD0 ... AD7
on the data bus of the processor.

  Signal / RES (18) connected to the / RESET
Processor (26-th output)


  The remaining conclusions - AS, R / W, / DS to
connected to address decoder.


            Status signals



                          AS R / W / DC

  Nothing 0 1 1

  number selection register 1 1 1

  Reading from register 0 1 0

  write to register 0 0 1



   For example, on a yellow card for Scorpio
findings of AS, / DS, R / W signals can be fed
with m / D54:


       D54/13 through an inverter to AS

       D54/11 at / DS

       D54/15 in the R / W


  In this case, the port addresses CMOS-hours
will be stationed in TR-DOS area.


  In this arrangement, including analysis of
Only bits 1 and 7, but in order to avoid conflicts with other 
ports are recommended such port addresses 


         The choice of register # D8

         Reading from register # 58

         Entry in the register # 58


  When ispolnovanii Scorpio for the read / write data, you can 
use n / n TR-DOS:


# 3FF0 - OUT (C), A

        RET

# 3FF3 - IN A, (C)

        RET



  On computers that have the ROM TR-DOS
There are no such instructions recommend the following program:

; Write data to register
; In:
; [C] - register number of CMOS-hours
; [B] - value to be written
WRREG LD A, C

        CALL SETREG

        LD A, B

        LD C, # 1958

        JR OUTPAR


; Reading data from register
; In
; [C] - register number of CMOS-hours

; Out:
; [A] - schitanye from the register value
RDREG LD A, C

        CALL SETREG

        LD A, # D8

        LD C, # 1F

        CALL OUTPAR

        LD C, # 1958

        LD IX, # 3EF3

        CALL JPTR

        LD A, H

        RET

SETREG LD C, # D8
OUTPAR LD IX, # 2A53
JPTR PUSH IX

        JP # 3D2F



        __________________________







Other articles:

CMOS-clock - Chip CMOS-clock for a computer (connection diagram).

Ot edition - The newspaper is no longer permanent editor - went to the PC.

Games - Helpik for the game North & South 128

List BBS - AC gate. List of BBS.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Advertising - advertising and announcements.
IRYSOU-201 - Science-fiction story (Part 1-4).
Likbez - CHEATS & POKES. The last two parts of the cycle.
Gambling - Description of the game Operation, RR

В этот день...   2 May