home *** CD-ROM | disk | FTP | other *** search
- page 132,63,3,3
- opt rc
- ;
- ; TST.ASM -- General diagnostic program for the DSP CARD 3
- ;
- ; Copyright (C) 1990, 1991 by Alef Null. All rights reserved.
- ; Author(s): Jarkko Vuori, OH2LNS
- ; Modification(s):
- ;
-
- ; program parameters
- ; X Y P
- ; 0000 +----------+ 0000 +----------+ 0000 +----------+
- ; | Internal | | Internal | | |
- ; 0100 +----------+ 0100 +----------+ | Internal |
- ; | LOG ROM | | SIN ROM | | |
- ; 0200 +----------+ 0200 +----------+ 0200 +----------+
- ; | External | | External | | |
- ; | | | | | External |
- ; 0A00 +----------+ 0A00 +----------+ | |
- ; | |
- ; 1200 +----------+
- ;
- ;
- ;
- begdblk equ $0200
- enddblk equ $09ff
- begpblk equ $0200
- endpblk equ $11ff
-
- nolist
- include 'intequlc.asm'
- include 'ioequlc.asm'
- list
-
- outssi macro data
- jclr #m_tde,x:m_sr,*
- movep #data,x:m_tx
- endm
-
- ; Reset vector
- org p:i_reset
- jmp start
-
- ; SSI xmit vector
- org p:i_ssitd
- jsr ssixmit
-
- ; SCI receiving vector
- org p:i_scird
- jsr scirec
-
- ; SCI receiving with execption status
- org p:i_scirde
- jsr scirece
-
- ; SCI xmit vector (fast interrupt)
- org p:i_scitd
- movep x:(r6)+,x:m_stxl
- nop
-
- ;
- ; Program Start
- ;
- org p:$40
-
- ; no wait states on external memory
- start movep #$0000,x:m_bcr ; no wait states
-
- ; initialize SCI
- movep #$1b02,x:m_scr ; 8,n,1
- movep #$0022,x:m_sccr ; 9600 bit/s
-
- ; initialize SSI
- movep #$4000,x:m_cra ; 16 bit word
- movep #$7200,x:m_crb ; syncronous,word frame,ext clk
-
- ; initialize port C
- movep #$01eb,x:m_pcc ; TXD,RXD,SC0,SC2,SCK,SRD,STD
- movep #$0014,x:m_pcddr ; SCLK,SC1 as output
- movep #$0000,x:m_pcd
-
- ; program the A/D & D/A converter chip (TLC32044)
- ; insert A/D high-pass filter, disable loopback, disable AUX IN,
- ; select syncronous mode, Gain as +-3V, insert sinx/x correction
- ; cutoff frequency at 2356Hz -> TXA = 14 (SCF = 179kHz)
- ; sampling frequency is 4826Hz -> TXB = 37
- outssi $000000 ; flush any garbage out
- outssi $000300 ; begin secondary communication
- outssi ((%10011001<<2)|%11)<<8 ; d9=1,d7=0,d6=1,d5=1,d4=0,d3=0,d2=1
- outssi $000300 ; begin secondary communication
- outssi ((14<<9)|%00)<<8 ; TA=14
- outssi $000300 ; begin secondary communication
- outssi ((37<<9)|%10)<<8 ; TB=37
-
- ; initialize sinewave generator
- ori #$4,omr ; enable internal ROMs
- move #$0100,r7
- move #256-1,m7
- move #117,n7 ; frequency
-
- ; initialize banner writer
- move #banner,r6
- move #banlen-1,m6
- nop
- movep x:(r6)+,x:m_stxl ; kick SCI xmitter up
-
- ; start interrupts
- movep #$b000,x:m_ipr ; SSI=IPL2,SCI=IPL1
- andi #$fc,mr ; unmask interrupts
-
- ; initialize pattern pointers
- move #<pat,r1
- move #<patlen-1,m1
- move m1,m2
-
- ; set memory
- loop move r1,r2
- ; X
- move #begdblk,r0
- do #enddblk-begdblk,setxloop
- move y:(r2)+,x0
- move x0,x:(r0)+
- setxloop
- ; Y
- move #begdblk,r0
- do #enddblk-begdblk,setyloop
- move y:(r2)+,y0
- move y0,y:(r0)+
- setyloop
- ; P
- move #begpblk,r0
- do #endpblk-begpblk,setploop
- move y:(r2)+,x0
- move x0,p:(r0)+
- setploop
-
- ; check memory
- move r1,r2
- move #-1,x0
- clr b
- ; X
- move #begdblk,r0
- do #enddblk-begdblk,chkxloop
- move y:(r2)+,y0
- move x:(r0)+,a
- cmp y0,a
- tne x0,b
- chkxloop
- ; Y
- move #begdblk,r0
- do #enddblk-begdblk,chkyloop
- move y:(r2)+,y0
- move y:(r0)+,a
- cmp y0,a
- tne x0,b
- chkyloop
- ; P
- move #begpblk,r0
- do #endpblk-begpblk,chkploop
- move y:(r2)+,y0
- move p:(r0)+,a
- cmp y0,a
- tne x0,b
- chkploop
-
- ; reset error bit (SC1) and stop the system if errors detected
- tst b
- jeq ok
- bset #$2,x:m_pcd
- stop
-
- ; change test patterns cyclically
- ok move #<pat,x0
- move (r1)+
- move r1,b
- cmp x0,b
- jne loop
-
- ; toggle indicator bit CTS (SC1) when one test run is complete
- bchg #$2,x:m_pcd
-
- jmp loop
-
-
- ; *** SSI xmit interrupt ***
- ssixmit
- ; store contex
- move y,l:<contexa
- move a10,l:<contexa+1
- move a2,x:<contexa+2
-
- move y:(r7)+n7,a
- move #$fffc00,y0
- and y0,a
- movep a,x:m_tx
-
- ; restore contex
- move l:<contexa,y
- move l:<contexa+1,a10
- move x:<contexa+2,a2
-
- rti
-
-
- ; *** SCI receiving interrupt ***
- scirec
- ; store contex
- move y,l:<contexb
- move a10,l:<contexb+1
- move a2,x:<contexb+2
-
- move n7,r3
- movep x:m_srxl,a
- move #>'+',y0
- cmp y0,a #>'-',y0
- jeq <inc
- cmp y0,a
- jne <endsci
- ; decrement frequency
- move (r3)-
- move r3,n7
- jmp <endsci
- ; increment frequency
- inc move (r3)+
- move r3,n7
-
- ; restore contex
- endsci move l:<contexb,y
- move l:<contexb+1,a10
- move x:<contexb+2,a2
-
- rti
-
-
- ; *** SCI receiving with errors interrupt ***
- scirece
- ; store contex
- move a10,l:<contexb+1
-
- movep x:m_ssr,a1
- movep x:m_srxl,a1
-
- ; restore contex
- move l:<contexb+1,a10
-
- rti
-
-
- ;
- ; Y:mem
- ;
- org y:$0
- ; test patterns
- pat
- dc $ffffff
- dc $aaaaaa
- dc $555555
- dc $0ffff0
- dc $ff00ff
- dc $00ff00
- dc $f0f0f0
- dc $0f0f0f
- dc $101010
- dc $ffffff
- dc $000000
- patlen equ *-pat
-
-
- ;
- ; X mem
- ;
- org x:$0
- banner dc 'H','e','l','l','o',' ','W','o','r','l','d','!',10,13
- banlen equ *-banner
-
-
- ;
- ; L:mem
- ;
- org l:banlen
- contexa ds 3
- contexb ds 2
-
- end
-