Iron - Real time clock.

MSF #22
Track: By me composed! Xe-xe.. :)        
Author: Macros, 14 July 2K1.             
-----------------------------------------

  +-----------+                          
 4+ADO     VDD+24   Микросхема  часов    
 5+AD1    CKFS+20   реального времени    
 6+AD2      PS+22                        
 7+ADЗ    OSC1+2         146818          
 8+ADЧ  RESET#+18                        
 9+ADS     VSS+12                        
10+ADб        |                          
11+AD7        |                          
14+AS         |                          
15+R/W#       |                          
17+DS         |                          
13+CE#        |                          
  +-----------+                          


  ADO-AD7 - двунаправленная шина даных.  
  AS - высоким уровнем выбирается регистр
гадреса микросхемы.                      
  DS - выбор регистра данных. R/W#  - reading or writing data.      
  CE#  - chip sampling signal.       
  RESET# - reset.                        

  Purpose of CMOS cells:                 


+---------------------------------------+ 
|Cells in BCD format | 
|00 - seconds | 
|01 - alarm seconds | 
|02 - minutes | 
|03 - alarm minutes | 
|04 - clock | 
|05 - alarm clock | 
|06 - day of the week | 
|07 - day of the month | 
|08 - month | 
|09 - year (2 low digits) | 
+------------------+----------------------------------+ 
|OAh|Status-register | 
|   |Bit 7 - time update: | 
|   |0=ready to read.                 | 
|   |Bits 6-4 - frequency divider, | 
|   |for 32.768 kHz - 010 | 
|   |Bits 3-0=0110 - output frequency | 
|   |meander 1024 Hz | 
+------------------+----------------------------------+ 
|OBh|Status-register | 
|   |Bit 7 - stop clock: | 
||0 - normal move | 
|   |Bit 6 - periodic resolution | 
|   |interrupts: 0=disabled | 
|   |Bit 5 - enable interrupt from | 
|   |alarm: 0=disabled | 
|   |Bit 4 - interrupt resolution by | 
|   |end of time change: 0=disabled | 
|   |puppy | 
|   |Bit 3 - resolution of the output mean-| 
|   |dra: | 
|   |0=disabled | 
|   |Bit 2 - BCD/BIN format: 0=BCD | 
|   |Bit 1 - 12/24 hour mode: | 
|   |1=24-hour | 
|   |Bit 0 - winter/summer time: | 
|   |0=switching disabled | 
+------------------+----------------------------------+ 
|OCh|Status register - reading flags | 
|   |interrupt IDs: | 
|   |Bit 7 - IRQF - general interrupt request-| 
|   |        vania | 
|   |Bit 6 - PF - periodic interruptions- | 
|   |        vania | 
|   |Bit 5 - AF - interruption from alarm-| 
|   |        nickname | 
|   |Bit 4 - UF - shift interrupt | 
|   |        time | 
|   |Bits 3-0 - reserved | 
+------------------+----------------------------------+ 
|ODh|Status-register | 
|   |Bit 7 - power: | 
|   |1=normal, 0=low battery | 
|   |Bits 6-0 - reserved| 
+------------------+----------------------------------+ 
|OEh|Post Diagnostic Status Byte (on PC)| 
|   |Bit 7 - 1=Power Lost - was lost | 
|   |        CMOS power supply | 
|   |Bit 6 - 1=Checksum Bad - error | 
|   |        CMOS checksum | 
|   |Bit 5 - 1=Bad config - error con-| 
|   |        figurations | 
|   |Bit 4 - 1=Ram Size Error - inaccurate | 
|   |        according to the size of RAM, op- | 
|   |        divided by test, records| 
|   |        in CMOS | 
|   |Bit 3 - 1=HDD Error - error when | 
|   |        HDD initialization | 
|   |Bit 2 - 1=Time Valid - no for- | 
|   |        small clock error | 
|   |        Lendar (February 30, 25 | 
|   |        hours) | 
|   |Bits 1-0 - reserved | 
+------------------+----------------------------------+ 

  Access to CMOS cells in pc is carried out
Available via ports:                        

  070h - cell address                    
  071h - data.                         

Share your thoughts about the article