: --

: --

̲Ͳ ²

ȯ ֲ ̲ Ͳ Ͳ

: 5.091504

:

̳

: -- ʻ

. . 5.091504.


: . 3-2

. .

..


2007


1

1.1

1.2

1.3

2

2.1

2.2 ²

2.3

3

3.1 ²

3.2

3.3

4

5 ˳


, . . , , , .

, .

̳ () - - , , ( ) .

㳿 . ' . . . , , , .

, , .

() - , .

̳ ( ).

, , . , , , , . .

:

-    ();

-    ;

-    ;

-    -;

-    ;

-    .

. ³ , .

, . , , .

, . , .

ϳ - , 䳿 ᒺ .

-. ᒺ :

-    ( );

-    ( );

-    , ( 䳿 ).

( ), .

- ( ), . - , -.


1

1.1

, :

Ϡ -

-

²

ʠ

Ѡ

Ϡ -

ʠ

̳ .

() , ², : , ' , ' , .

:

-  , ;

-  , , ;

-  , , ;

-  ;

-  , .

- , , , .

, , ( ) -55+99 º 1 º. . , , (). 10 , ( 0,1 ) , ( 0,1 ), ( ). , . Snooze ( ), . , Snooze . , () , ( ).

DD2 894051. 1.2

894051, 117147, FCP8583, SAA3010, PCF8583, DS1621, MC34063.

.

894051:

894051 8- , Atmel , 4 1000 /, 15 /, 2 16- /, , , , . Power-down, (/ ) , Idle mode , , , /, , .

1.2.1 894051.

1.2.1 894051

894051 1.2.2.

1.2.2 894051

: , RAM, Flash-, , - (), , , , , , , , , , , .

1.3

1.3.

1.3

(. 1.3) : , ; ; , ; ; .


2

2.1

2.1.1. , , .

2.1.1 --

DD2 AT89C4051, . (4), (128 ), 2 , . (. 1.2). 117147 (DA1), 4.7 .

SA08-11GWA. . VD5 VD6.

: P1.2, (14); P1.3, (15); P1.4, (16).

74HC595 8- .

PCF 8583, . PCF 8583 , .

1606 , 2200 .

GB1 .

- SFH 506-36. , VD4C8C9.

MC 34063. 2.1.2.

2.1.2 --

. SAA 3010 RC5. SAA 3010 .

DS1621

2.2 ²

2.2.1.

2.2.1

MOVX, ALE .

2.3

2.1.1 2.1.

, -55˚ +99˚ ˚ . 10, 1 2 . , , , .

10 : , , . , . , Snooze . .

̳ DD2 AT89C4051 . , , 2 , . 117147 (DA1), 4.7 .

SA08-11GWA. . VD5 VD6.

: P1.2, (14); P1.3, (15); P1.4, (16).

74HC595 8- .

PCF 8583, . PCF 8583 , .

1606 , 2200 .

GB1 .

- SFH 506-36. , VD4C8C9.


3

3.1 ²

- . . .

3.2.

3.2

894051 :

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC

ORG 0

Goto PROGRAM

sec equ H'11' ;

sec10 equ H'12' ;

min equ H'13' ;

min10 equ H'14' ;

hour equ H'15' ;

hour10 equ H'16' ;

Indicator equ H'17' ; 7- DD2

Bit_counter equ H'18' ; , DD2

FLAGS equ H'19' ;

FLAGS_2 equ H'1F'

Fig_pointer equ H'1B' ;

TEMP equ H'1C' ; A

Ind_start equ H'1D' ; ,

SB_delay equ H'1E' ;

STATUS_copy equ H'21' ; ﳿ

W_copy equ H'22'

FSR_copy equ H'23'

min_al_1 equ H'24' ;

min10_al_1 equ H'25'

hour_al_1 equ H'26'

hour10_al_1 equ H'27'

min_al_2 equ H'28' ;

min10_al_2 equ H'29'

hour_al_2 equ H'2A'

hour10_al_2 equ H'2B'

EEP_Ind_4 equ H'2C' ;

EEP_Ind_3 equ H'2D' ; EEPROM

EEP_Ind_2 equ H'2E'

EEP_Ind_1 equ H'2F'

Alarm_count equ H'30' ;

SB4_count equ H'31' ; SB2

IntCount_H equ H'32' ; 1

IntCount_L equ H'33' ; 2

MaxInt_H equ H'34' ;

MaxInt_L equ H'35' ;

TIME_SET equ H'36' ;

; ------------- ϳ ---------------

INC_MIN macro Reg1_min,Reg2_min

movfw Reg1_min ; = 9

xorlw 9 ;

BZ $+3 ;

incf Reg1_min, f

goto Main_loop

clrf Reg1_min

movfw Reg2_min

xorlw 5 ; = 5,

BZ $+3 ;

incf Reg2_min, f ;

goto Main_loop

clrf Reg1_min

clrf Reg2_min

goto Main_loop

endm

; ------------- ϳ ---------------

INC_HOUR macro Reg1_hour,Reg2_hour

movfw Reg1_hour ; = 3,

xorlw 3 ; = 2,

btfss STATUS, Z ; ( 23 00)

goto $+5

movfw Reg2_hour

xorlw 2

BZ $+D'14'

movfw Reg1_hour ; = 10,

xorlw 9 ;

BZ $+3 ;

incf Reg1_hour, f

goto Main_loop

clrf Reg1_hour

movfw Reg2_hour

xorlw 2

BZ $+3

incf Reg2_hour, f

goto Main_loop

clrf Reg1_hour

clrf Reg2_hour

goto Main_loop

endm

; ------------- ϳ ---------------

DEC_MIN macro Reg1_min,Reg2_min

local DEC_min10,Clr

movfw Reg1_min ;

xorlw 0

BZ DEC_min10

decf Reg1_min,f

goto Main_loop

DEC_min10 movlw 9 ; = 9

movwf Reg1_min ;

movfw Reg2_min

xorlw 0

BZ Clr

decf Reg2_min, f

goto Main_loop

movlw 5

movwf Reg2_min

goto Main_loop

endm

; ------------- ϳ ---------------

DEC_HOUR macro Reg1_hour,Reg2_hour

local Set_hour,Clr,If_hour10_1,If_hour10_2,Dec_hour10

movfw Reg1_hour ;

xorlw 0

BZ Set_hour

decf Reg1_hour, f

goto Main_loop

movfw Reg2_hour ; = 0,

xorlw 0 ; 3

btfss STATUS, Z

goto If_hour10_1

movlw 3

movwf Reg1_hour

goto Dec_hour10

If_hour10_1 movfw Reg2_hour ; = 1,

xorlw 1 ; = 9

btfss STATUS, Z

goto If_hour10_2

movlw 9

movwf Reg1_hour

goto Dec_hour10

If_hour10_2 movlw 9 ; = 2,

movwf Reg1_hour ; 9

Dec_hour10 movfw Reg2_hour ;

xorlw 0

BZ Clr

decf Reg2_hour, f

goto Main_loop

Clr movlw 2

movwf Reg2_hour

goto Main_loop

endm

; ------------- ϳ EEPROM ---------------

EE_write macro Adress,Data

movlw Adress

movwf EEADR

movfw Data

movwf EEDATA

call Write_to_EEPROM

endm

; ------------- ϳ EEPROM ---------------

EE_read macro Adress,Destination

movlw Adress

movwf EEADR

call Read_from_EEPROM

movfw EEDATA

movwf Destination

endm

; ------------------- Ͳֲ˲ֲ ----------------------

PROGRAM

bsf STATUS,RP0 ; 1

clrf TRISA ;

movlw B'11110000' ; RB7..RB4 - , RB3..RB0 -

movwf TRISB

movlw B'00001000' ;

movwf OPTION_REG

bcf STATUS, RP0 ; 0

clrf TIME_SET

clrf FLAGS

clrf FLAGS_2

clrf sec

clrf sec10

clrf min

clrf min10

clrf hour

clrf hour10

clrf SB_delay

clrf Bit_counter

clrf Alarm_count

clrf PORTB

clrf SB4_count

clrf IntCount_H

clrf IntCount_L

movlw B'00010001'

movwf PORTA

movlw H'16' ;

movwf Ind_start

movfw Ind_start

movwf Fig_pointer

bsf FLAGS,PT ;

bsf FLAGS_2, HL1

movlw D'16' ; 0

movwf TMR0

EE_read 1, TIME_SET ;

movwf TIME_SET ;

EE_read 2, min_al_1 ;

EE_read 3, min10_al_1 ; EEPROM

EE_read 4, hour_al_1

EE_read 5, hour10_al_1

EE_read 6, min_al_2

EE_read 7, min10_al_2

EE_read 8, hour_al_2

EE_read 9, hour10_al_2

movfw min_al_1 ;

xorlw H'11' ; 011, ,

btfss STATUS,Z ;

bsf FLAGS, Al_on ; EEPROM

movfw min_al_2

xorlw H'11'

btfss STATUS, Z

bsf FLAGS_2, Al_on2

bsf PORTB, 3 ;

btfsc FLAGS, Al_on

bcf PORTB, 3

btfsc FLAGS_2, Al_on2

bcf PORTB, 3

bsf INTCON, T0IE ;

bsf INTCON, GIE

movlw H'E' ;

movwf EEP_Ind_1 ; EEPROM

movlw H'E'

movwf EEP_Ind_2

movfw TIME_SET ; TIME_SET

andlw B'00001111' ; 16-

movwf EEP_Ind_4 ;

movfw TIME_SET

movwf EEP_Ind_3 ;

swapf EEP_Ind_3, f

movlw B'00001111'

andwf EEP_Ind_3, f

;******************************************************************

;

******************************************************************

movlw H'21' ;

movwf MaxInt_L ; = 3873

movlw H'F'

movwf MaxInt_H

movfw TIME_SET ; TIME_SET

bcf STATUS, C ;

addwf MaxInt_L, f

btfsc STATUS, C

incf MaxInt_H, f

movfw IntCount_H ;

xorwf MaxInt_H, w

btfss STATUS, Z

goto Main_loop

movfw IntCount_L ;

xorwf MaxInt_L, w

btfss STATUS, Z

goto Main_loop

goto ADD1s ;

; ------- --------

Table

addwf PCL,f

retlw B'00000010' ; 0

retlw B'10011110' ; 1

retlw B'00100100' ; 2

retlw B'00001100' ; 3

retlw B'10011000' ; 4

retlw B'01001000' ; 5

retlw B'01000000' ; 6

retlw B'00011110' ; 7

retlw B'00000000' ; 8

retlw B'00001000' ; 9

retlw B'11111110' ; ( 10h)

retlw B'11111100' ; ( 11h)

;********************* ***********************

Show_seconds

clrf SB4_count

btfsc FLAGS,Sec ;

goto Show_hour ;

movlw H'14'

movwf Ind_start

bsf FLAGS, Sec

movwf SB_delay

goto Main_loop

Show_hour

movlw H'16'

movwf Ind_start

bcf FLAGS,Sec

movwf SB_delay

goto Main_loop

;***************** ******************

ADDmin_button

clrf sec

clrf sec10

INC_MIN min, min10

goto Main_loop

;****************** ******************

ADDh_button

clrf sec

clrf sec10

INC_HOUR hour, hour10

goto Main_loop

END ;


3.2.1 - -

3.3

, , , , .

:

1.         .

2.         .

3.         .

4.         .

, , .

, .

: , .

³ , .

³ :

() .

() , .

, .

:

1. .

2. 񳺿 .

.

:

1. :

(3.3.1)

:

ni ;

li - ;

m .

.

:

(3.3.2)

:

l ;

e ;

.

.

2. , .

:

(3.3.3)

:

- ;

t , ().

.

3. .

:

(3.3.4)

.


-- . , .

̳ , .


˳

1.         .. .. // .: 1995 6 .

2.         .. .. .. ̳ // .: 2004 24 .

3.         .

4.         .. // .: , 1986.

5.         .., .., .. // .: , 1986.





2010