home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dspgroup / sound.arc / ECHO.ASM next >
Encoding:
Assembly Source File  |  1988-01-23  |  1.4 KB  |  59 lines

  1. ; Play samples loaded by the host out through the D/A converter
  2. ; This code assumes that the Delanco Spry board is set up in the
  3. ; usual manner, i.e., with timer 2 triggering the A/D converter and
  4. ; the A/D conversion done signal fed to the TMS-32010's BIO/ line.
  5. ; Hence the "dummy conversions" done for timing.
  6. ;
  7. ; Protocol: On each clock tick, the 320 reads the 16-bit port
  8. ; and copies it to the D/A converter, whether the host is ready or not.
  9. ; The 320 also toggles the value in the 8-bit port between 0 and 1 after
  10. ; reading each sample to indicate readiness for a new value.  As usual,
  11. ; the host is responsible for setting the proper clock rate on timer 2.
  12. ;
  13. ; 21 January 1987 Phil Karn, KA9Q
  14. ;
  15. zero:    equ    0
  16. one:    equ    1
  17. tmp:    equ    2
  18.  
  19. adport:    equ    3
  20. daport:    equ    4
  21. hsport:    equ    5
  22. hdport:    equ    7
  23.  
  24.     b    start
  25.     nop
  26.     nop
  27.     nop
  28.     nop
  29.     nop
  30.  
  31. start:    ldpk    0
  32.     lack    0
  33.     sacl    zero
  34.     lack    1
  35.     sacl    one
  36.  
  37. begin:    out    zero,hsport    ; indicate phase 0
  38.  
  39. wait1:    bioz    read1        ; wait for first clock tick
  40.     b    wait1
  41.  
  42. read1:    in    tmp,hdport    ; read data port
  43.     out    tmp,daport    ; write d/a converter
  44.     in    tmp,adport    ; clear BIO line
  45.     out    tmp,hdport
  46.  
  47.     out    one,hsport    ; indicate phase 1
  48.  
  49. wait2:    bioz    read2        ; wait for second clock tick
  50.     b    wait2
  51.  
  52. read2:    in    tmp,hdport    ; read data port
  53.     out    tmp,daport    ; write d/a converter
  54.     in    tmp,adport    ; clear BIO line
  55.     out    tmp,hdport
  56.  
  57.     b    begin        ; start all over
  58.     end
  59.