home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / source / init.asm < prev    next >
Encoding:
Assembly Source File  |  1992-05-30  |  2.7 KB  |  138 lines

  1.     page    132,63,1,1
  2.     opt    rc
  3.     title    'DSP CARD 3 initialization'
  4.  
  5. ;***************************************************************
  6. ;* INIT.ASM -- DSP56001 interrupt vector table and DSP CARD 3  *
  7. ;*           initialization code                   *
  8. ;*                                   *
  9. ;* Here are all DSP56001 interrupt vectors and space for       *
  10. ;* interrupt contexts. Also included are initalization code    *
  11. ;* and some stuff for debugging.                   *
  12. ;*                                   *
  13. ;* Copyright (C) 1990-1992 by Alef Null. All rights reserved.  *
  14. ;* Author(s): Jarkko Vuori, OH2LNS                   *
  15. ;* Modification(s):                           *
  16. ;***************************************************************
  17.  
  18. ; Mies katsoo tuossa,
  19. ; on nainen sieltä poissa.
  20. ; Itku katseen samentaa
  21. ; ja särky ohimoissa.
  22. ;
  23. ; Korvissa soi jo kohisten.
  24. ; Kuin takaa järjen rajan
  25. ; nyt mieleen tunkee, täyttää sen
  26. ; vain meri koko ajan.
  27. ;
  28. ; On poissa hän, on lähtenyt
  29. ; pois yhteisiltä teiltä.
  30. ; Vain kipu syöpyy luuhun nyt
  31. ; ja nielee kaiken hältä.
  32. ;
  33. ;    Jacques Berg
  34.  
  35.     nolist
  36.     include 'ioequlc'
  37.     list
  38.  
  39.     section Vector
  40.     xref    m_rx,m_sr,m_tx,m_ssr,m_srxl
  41.  
  42.     nolist
  43.     include 'intequlc'
  44.     list
  45.  
  46. ; Reset vector
  47.     org    p:i_reset
  48.     jmp    start
  49.  
  50. ; SSI transmitter interrupt
  51. ;(because syncronous mode, we can use the same interrupt for both reading and writing)
  52.     org    p:i_ssitd
  53.     movep            y:(r7),x:m_tx
  54.     movep            x:m_rx,x:(r7)+
  55.  
  56. ; SSI transmitter interrupt with errors
  57.     org    p:i_ssitde
  58.     movep            x:m_sr,x:m_tx        ; clear TUE
  59.  
  60. ; SCI receive interrupt
  61.     org    p:i_scird
  62.     jsr    sci_rec
  63.  
  64. ; SCI receive interrupt with errors
  65.     org    p:i_scirde
  66.     jsr    sci_err
  67.  
  68. ; SCI transmitter interrupt
  69.     org    p:i_scitd
  70.     jsr    sci_xmt
  71.  
  72.     endsec
  73.  
  74.  
  75.     section Init
  76.     xdef    start
  77.     xref    ssi_ini
  78.     xref    lpc_i
  79.     xref    m_loop
  80.     xref    m_bcr,m_pcc,m_pcddr,m_pcd,m_ipr
  81.  
  82.     nolist
  83.     include 'macros'
  84.     list
  85.  
  86.     org    p:
  87.  
  88.  
  89. ;****************************
  90. ;*   Start of the program   *
  91. ;****************************
  92. ; no wait states on external memory
  93. start    movep            #$0000,x:m_bcr        ; no wait states
  94.  
  95. ; initialize peripherals
  96.     jsr    <ssi_ini
  97.     jsr    <sci_ini
  98.  
  99. ; initialize port C
  100.     movep            #$01eb,x:m_pcc        ; TXD,RXD,SC0,SC2,SCK,SRD,STD
  101.     movep            #$0014,x:m_pcddr        ; SCLK,SC1 as output
  102.     movep            #$0000,x:m_pcd
  103.  
  104. ; initialize modules
  105.     jsr    <lpc_i
  106.     jsr    <pro_i
  107.  
  108. ; start interrupts
  109.     movep            #$b400,x:m_ipr        ; SSI=IPL2,SCI=IPL1,HOST=IPL0
  110.     andi    #$fc,mr                 ; unmask interrupts
  111.  
  112. ; and jump to the main module
  113.     jmp    <m_loop
  114.  
  115.     endsec
  116.  
  117.  
  118. ;****************************
  119. ;*  CONTEX STORE FOR INTS   *
  120. ;****************************
  121.  
  122.     section Contexts
  123.     xdef    scix,scir
  124.  
  125.     nolist
  126.     include 'macros'
  127.     list
  128.  
  129.     org    l:
  130.  
  131. scix    roomab
  132. scir    roomab
  133.  
  134.     endsec
  135.  
  136.  
  137.     end
  138.