    
 - . , RX9CBI.
.   . 3/2002 .

;Synthesizer--SI145M---1996--------------------
; .   rx9cbi@mail.ru
;=10700. WDT ON. F_RC_osc=50...100. ;__Files:_________________________
count   equ     0C  ;
bufB    equ     0E  ;  ,
rotate  equ     0F  ; DATA
switch  equ     10  ; 6    B   
;__Ports:_________________________
port_a	equ	5
port_b	equ	6
;-----------------------------------------------------
list p=16C54 ;-----------------------------------------------------
org	0
;Subroutine---   rotate   RA0---
send    movwf   rotate    ;  W   rotate
clrf    count	; 8
bsf	count,3   ;	  .
bcf	3,0	; cary
next    rlf	rotate,f  ; rotate  ( Cary)
btfsc	3,0	; Cary=0 skip
bsf	port_a,0	; DATA=1
btfss	3,0	; ary=1 skip
bcf	port_a,0	;. DATA=0
bsf	port_a,1	;CLK=1 _-
bcf	port_a,1	;   =0   -_    .
decfsz	count,1	;  .
goto	next	;  0.  .
retlw	0	;  \.
;#########################################################
start   movlw   0	;    W
option	;  W  option register.
movlw   8	;    W.
tris    5	;  3   RA  ,   .
movlw   3F	;  F
;_____  ____________
btfss   port_a,3   ;skip   
movwf   bufB	;W  bufB
;--- --------------
begin   movf    bufB,w	; bufB  W
xorwf   port_b,w   ;  B     bufB
btfsc   3,2	;
sleep	; .    WDT
;	  WDT  - 1FF (goto  start)
movf	port_b,w	; .  15081.
movwf	bufB	;        bufB
movlw	3F	;
andwf	bufB,w	;    6.  
movwf	switch	;         switch
movlw	1	;  15081
call	send	;      1  - 01 ( 01)
;----  144/145---------------
btfsc   port_b,6
goto    Band145
;-----144--------------------
rlf	switch,f   ;  2
bcf	switch,0   ;. 0 
btfss   port_b,7   ; ?
goto    RX144	;-
;-----TX144------------------
movlw   2D	; 2-  2D
call    send
;----- ------------
Third   movf    switch,w   ; switch  W
call    send	;  
goto    strob	; .    PB
;======RX144==============================
RX144   movlw   29
call    send	; 2- - 29
movlw   0A8
addwf   switch,f   ; A8  switch
goto    Third	; 3 
;=====a RX/TX========================
Band145 movlw   28
addwf	switch,f	; 28(hex)  switch
rlf	switch,f	;X2
bcf	switch,0	;  
btfss	port_b,7	; ?
goto	RX145	; 
;------TX 145--------------------
TX145   movlw   2D	; 
call    send	; 2- - 2D
goto    Third	; 
;=====RX 145=======================
RX145   movlw   0A8	; A8
addwf   switch,f   ;	 switch
btfss   3,0	; 
goto    R51
movlw   2A	; Cary. 2 =2A (145100...145975)
R52	call    send	; 2 
goto    Third	; 3-
R51	movlw   29	;2 =29 (145000...145075)
goto    R52
;============================
strob   bsf	port_a,2   ;1 _-
bcf	port_a,2   ;0   -_
goto    begin	;    B
;==================================
org	1FF	;  PIC16C54 = 1FF
goto    start
end
;__________________________________ 
