home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / dsp / 2825 < prev    next >
Encoding:
Text File  |  1992-12-17  |  3.2 KB  |  93 lines

  1. Newsgroups: comp.dsp
  2. Path: sparky!uunet!mcsun!news.funet.fi!funic!nntp.hut.fi!vipunen.hut.fi!mimic
  3. From: mimic@lesti.hut.fi (Jarkko Vuori)
  4. Subject: Re: DSP56001 and CS4215
  5. Message-ID: <mimic.724615921@vipunen.hut.fi>
  6. Sender: usenet@nntp.hut.fi (Usenet pseudouser id)
  7. Nntp-Posting-Host: lesti.hut.fi
  8. Organization: Helsinki University of Technology, Finland
  9. References: <1gmm0kINNm8t@agate.berkeley.edu>
  10. Date: 17 Dec 92 18:12:01 GMT
  11. Lines: 80
  12.  
  13. In <1gmm0kINNm8t@agate.berkeley.edu> tom@mills.edu (Tom Erbe) writes:
  14. >Has anyone connected these two chips (DSP56001, CS4215)?
  15. >As I am under a deadline, I would be
  16. >forever indebted to anyone who could share their experiences with me.  DSP
  17. >or psuedo code would be very appreciated.
  18.  
  19.     CS4215 connects very neatly to DSP56001. The software is a little
  20.     tricky if you want high-performance 16-bit fast-interrupt
  21.     based data transfer. Look the source code sample below.
  22.  
  23.         Jarkko Vuori
  24.         Jarkko.Vuori@hut.fi
  25.  
  26. -----------------------------------------------------------------------
  27. ; SSI transmitter interrupt
  28. ;(because syncronous mode, we can use the same interrupt for both reading and writing)
  29.     org    p:i_ssitd
  30.     movep            y:(r7)+,x:m_tx
  31.     movep            x:m_rx,x:(r7)
  32.  
  33.  
  34. ;****************************
  35. ;*     Open codec driver    *
  36. ;****************************
  37. ; Start-up Crystal CS4215 Codec
  38. ;   r7 - address of the modulo buffer (x: A/D, y: D/A)
  39. ;   m7 - lenght of the modulo buffer
  40. ;   x0 - samping rate:
  41. ;    8    kHz   $000000
  42. ;    9.6    kHz   $003800
  43. ;      16    kHz   $000800
  44. ;      27.42857 kHz   $001000
  45. ;      32    kHz   $001800
  46. ;      48    kHz   $003000
  47. ;
  48. ;
  49. ; program SSI to handle Crystal's initial communication mode
  50. opencd    movep            #$4f05,x:m_cra        ; 16-bit, 16 frames
  51.     movep            #$3b3c,x:m_crb        ; generate SCLK and FS
  52.  
  53.     movep            #$01e3,x:m_pcc        ; TXD,RXD,SC2,SCK,SRD,STD
  54.     movep            #$001c,x:m_pcddr        ; SCLK,SC0,SC1 as output
  55.     movep            #$0000,x:m_pcd        ; PDN down (wake up Crystal)
  56.  
  57. ; send control blocks to the Crystal until we get valid responce from it
  58.     move            y:<cryconf,a1        ; add sampling rate info to configuration block
  59.     or    x0,a        #cryconf,r0
  60.     move            a1,y:<cryconf
  61.     move            #4-1,m0
  62.  
  63. wakeCry jsr    outblk                    ; send control info until CLB is low
  64.     jset    #2+16,x:tmpblk+2,wakeCry
  65.  
  66. ; Crystal is configured, send final control block
  67.     bset    #2+16,y:<cryconf+0            ; set CLB high
  68.     do    #10,confok                ; at least two frames after CLB high
  69.     jsr    outblk                    ; and ensure that at least 50 ms elapsed after leaving from PDN state
  70.     nop
  71.  
  72. ; reset and reprogram SSI again because we will get clock and frame signals from Crystal
  73. confok    movep            #$0003,x:m_pcc        ; SRD,STD
  74.     movep            #$4305,x:m_cra        ; 16-bit, 4 frames
  75.     movep            #$3b0c,x:m_crb        ; receive SCLK and FS
  76.     movep            #$01e3,x:m_pcc        ; TXD,RXD,SC2,SCK,SRD,STD
  77.  
  78. ; then start data transfer and synchronize to it
  79.     movep            #$0010,x:m_pcd        ; D/C high (switch Crystal to data mode)
  80.  
  81. waitsyn jclr    #m_tde,x:m_sr,waitsyn            ; wait for the frame sync
  82.     jset    #m_tfs,x:m_sr,frmsync
  83.     movep            x:m_rx,x:m_tsr
  84.     jmp    waitsyn
  85.  
  86. frmsync do    #4-1,flshfrm                ; then get rid of the remaining data
  87. _loop    jclr    #m_tde,x:m_sr,_loop
  88.     movep            y:(r7)+,x:m_tx
  89.     movep            x:m_rx,x:(r7)
  90. flshfrm movep            #$7b0c,x:m_crb        ; enable transmit interrupts
  91.  
  92.     rts
  93.