home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_10 / DEVELOP.LZH / DSP / DSPDEBUG / HOSTDTA.HLP < prev    next >
Text File  |  1992-08-29  |  16KB  |  331 lines

  1. {PORT B}{êHOST INTERFACE}{êHI}
  2.  
  3.     Port B is a dual-purpose I/O port that can be used as 15 general-purpos 
  4. pins individually configurable as either inputs or outputs, or as an 8-bit
  5. bidirectional host interface ({HI}).
  6.  
  7. {HOST INTERFACE} ({HI})
  8.  
  9.     The {HI} is a byte-wide, full duplex, double-buffered, parallel port which
  10. may be connected directly to the data bus of a host processor. The
  11. hostprocessor may be any of a number of industry standard microcomputers or
  12. microprocessors, another DSP, or DMA hardware because this interface
  13. lookslike static memory. The {HI} is asynchronous and consists of two banks of
  14. registers - one bank accessible to the host processor and a second bank
  15. accessible to the DSP CPU. A brief description of the {HI} features is
  16. presented in the following listing:
  17.  
  18. Speed
  19.     8 MByte/Sec Burst Data Transfert Rate
  20.     1.71 Million Word/Sec Interrupt Driven Data Transfer Rate (This is the
  21.     maximum interrupt rate for the DSP56000/DSP56001 running at 20.5 MHz -
  22.     i.e., one interrupt every six instruction cycles.)
  23.  
  24. Interface - DSP CPU Side
  25.     Mapping:   Three X: Memory Locations
  26.  
  27.     Data Word:    24 Bits
  28.  
  29.     Transfer Modes:
  30.         DSP to Host
  31.         Host to DSP
  32.         Host Command
  33.  
  34.     Handshaking Protocols:
  35.         Softwware Polled
  36.         Interrupt Driven (Fast or Long)
  37.         Direct Memory Access
  38.  
  39. Instructions:
  40.     Memory-mapped registers allow the standard MOVE instruction to be used.
  41.  
  42.     Special MOVEP instruction provides for I/O service capability using fast
  43. interrupts.
  44.  
  45.     Bit addressing instructions ({BCHG}, {BCLR}, {BSET}, {BTST}, {JCLR}, {JSCLR}, {JSET},
  46. {JSSET}) simplify I/O service routines.
  47.  
  48.     I/O short addressing provides faster execution with fewer instruction
  49. words.
  50.  
  51. Interface - Host Side
  52.  
  53.     Mapping:
  54.         Eight Consecutive Memory Locations
  55.         Memory-Mapped Peripheral for Microprocessors, DMA controllers, etc..
  56.  
  57.     Data Word:    8 Bits
  58.  
  59.     Transfer Modes:
  60.         DSP to Host
  61.         Host to DSP
  62.         Host Command
  63.         Mixed 8-, 16-, and 24-Bit Data Transfers
  64.  
  65.     Handshaking Protocols:
  66.         Software Polled
  67.         Interrupt Driven - Compatible with MC680x0
  68.         Cycle stealing DMA with initialization
  69.  
  70.     Dedicated Interrupts:
  71.         Separate Interrupt Vectors for Each Interrupt Source
  72.  
  73.         Special host commands force DSP CPU interrupts under host processor
  74.         control, which are useful for:
  75.             Real-Time production Diagnostics
  76.             Debugging Window for Program Development
  77.             Host Control Protocols and DMA Setup
  78.  
  79. The {HI} registers can be divided vertically down the middle into registers
  80. visible to the host processor on the left and registers visible to the DSP
  81. on the right. They can also be divided horizontally into control at the top,
  82. DSP-to-host data transfer in the middle ({HTX}, RXH, RXM, and RXL), and
  83. host-to-DSP data transfer at the bottom (TXH, TXM, TXL, and {HRX}).
  84.  
  85. Host Interface - DSP CPU Viewpoint
  86.  
  87.     The DSP views the {HI} as a memory-mapped peripheral occupying three
  88. 24-bit words in data memory space. The DSP may use the {HI} as a normal
  89. memory-mapped peripheral, using either standard polled or interrupt
  90. programming techniques. Separate transmit and receive data registers are
  91. double buffered to allow the DSP and host processor to efficiently transfer
  92. data at high speed. Memory mapping allows DSP CPU communication with the {HI}
  93. registers to be accomplished using standard instructions and addressing
  94. modes. In addition, the MOVEP instruction allows {HI}-to-memory and
  95. memory-to-{HI} data transfers without going through an intermediate register.
  96. Both hardware and software reset disable the {HI} and change port B to general
  97. purpose I/O with all pins designated as inputs.
  98.  
  99. Programming Model - DSP CPU Viewpoint
  100.  
  101.     The {HI} has two programming models - one for the DSP programmer and one
  102. for the host processor programmer. In most cases, the notation used reflects
  103. the DSP perspective. There are three registers: 1) a control register ({HCR}),
  104. 2) a status register ({HSR}), and 3) a data transmit/receive register
  105. ({HTX}/{HRX}). These registers can only be accessed by the DSP56000/DSP56001;
  106. they can not be accessed by the hostprocessor.
  107.  
  108. The following paragraph describes the purpose and operation of each bit in
  109. each register of the {HI} visible to the DSP CPU. the effects of the different
  110. types of reset on these registers are shown. A brief discussion of
  111. interrupts and operation of the DSP side of the {HI} complete the programming
  112. model from the DSP viewpoint.
  113.  
  114. REGISTER CONTENTS AFTER RESET:
  115.  
  116.     Table shows the results of four reset types on bits in each of the {HI}
  117. registers seen by the DSP CPU. The hardware reset (HW) is caused by the
  118. ~RESET signal; the software reset (SW) is caused by executing the {RESET}
  119. instruction; the individual reset (IR) is caused by clearing the BPC
  120. register bit 0; and the stop reset (ST) is caused by executing the {STOP}
  121. instruction.
  122.  
  123.     +----------+----------+-------------------------------+
  124.     |          |          |           Reset Type          |
  125.     | Register | Register +-------+-------+-------+-------+
  126.     |   Name   |   Data   |   HW  |   SW  |   IR  |   ST  |
  127.     |          |          | Reset | Reset | Reset | Reset |
  128.     +----------+----------+-------+-------+-------+-------+
  129.     |          | HF(3-2)  |   0   |   0   |  ---  |  ---  |
  130.     |          +----------+-------+-------+-------+-------+
  131.     |          | {HCIE}     |   0   |   0   |  ---  |  ---  |
  132.     |   {HCR}    +----------+-------+-------+-------+-------+
  133.     |          | {HTIE}     |   0   |   0   |  ---  |  ---  |
  134.     |          +----------+-------+-------+-------+-------+
  135.     |          | {HRIE}     |   0   |   0   |  ---  |  ---  |
  136.     +----------+----------+-------+-------+-------+-------+
  137.     |          | {DMA}      |   0   |   0   |   0   |   0   |
  138.     |          +----------+-------+-------+-------+-------+
  139.     |          | {HCP}      |   0   |   0   |   0   |   0   |
  140.     |   {HSR}    +----------+-------+-------+-------+-------+
  141.     |          | {HTDE}     |   1   |   1   |   1   |   1   |
  142.     |          +----------+-------+-------+-------+-------+
  143.     |          | {HRDF}     |   0   |   0   |   0   |   0   |
  144.     +----------+----------+-------+-------+-------+-------+
  145.     |   {HRX}    | {HRX}(23-0)|  ---  |  ---  |  ---  |  ---  |
  146.     +----------+----------+-------+-------+-------+-------+
  147.     |   {HTX}    | {HTX}(23-0)|  ---  |  ---  |  ---  |  ---  |
  148.     +----------+----------+-------+-------+-------+-------+
  149.  
  150. HOST INTERFACE DSP CPU INTERRUPTS.
  151.  
  152.     The {HI} may request interrupt service from either the DSP or the host
  153. processor. the DSP CPU interrupts are internal and do not require the use of
  154. an external interrupt pin. When the appropriate mask bit in the {HCR} is set,
  155. an interrupt condition caused by the host processor sets the appropriate bit
  156. in the {HSR}, which generates an interrupt request to the DSP CPU. The DSP
  157. acknoledges interrupts caused by the host processor by jumping to the
  158. appropriate interrupt service routine. The three possible interrupts are 1)
  159. receive data register full, 2) transmit data register empty, and 3) host
  160. command. The host command can access any interrupt vector in the interrupt
  161. interrupt vector table although it has a set of vectors reserved for host
  162. command use. The DSP interrupt service routine must read or write the
  163. appropriate {HI} register (i.e., clearing {HRDF} or {HTDE}, for example) to clear
  164. the interrupt. In the case of host command interrupts, the interrupt
  165. acknowledge from the program controller will clear the pending interrupt
  166. condition.
  167.  
  168. HOST PORT USAGE CONSIDERATIONS --- DSP SIDE
  169.  
  170.     Careful synchronization is required when reading multibit registers that
  171. are written by another asynchronous system.
  172.  
  173. This is a common problem when two asynchronous systems are connected. The
  174. situation exists in the {HI}. However, if the {HI} is used in the way it was
  175. designed, proper operation is guaranteed.{DMA},{HF1},{HF0},{HCP},{HTDE}, {HRDF} status
  176. bits are set or cleared by the host processorside of the interface. These
  177. bits are individually synchronized to the DSPclock. The only system problem
  178. with reading status occurs with {HF1} and {HF0} if theyare encoded as a pair --
  179. e.g., the four combinations (00,01,10, and 11) each have significance. This
  180. problem occurs because there is a very small probability that the DSP will
  181. read the status bits during the transition. The solution to this potential
  182. problem is to read the bits twice forconsensus.
  183.  
  184.  
  185. {HOST CONTROL REGISTER} ({HCR}):{êHRIE}{êHTIE}{êHCIE}{êHF2}{êHF3}
  186.  
  187.     The {HCR} is an 8-bit read/write control register used by the DSP to
  188. control the {HI} interrupts and flags. The {HCR} cannot be accessed by the host
  189. processor. The {HCR} occupies the low-order byte of the internal data bus; the
  190. high-order portion is zero filled. {HCR} is a read/write register to allow
  191. individual control register bits to be set or cleared. Any reserved bits are
  192. read as zeros and should be programmed as zeros for future compatibility.
  193. The bit manipulation instructions are useful for accessing the individual
  194. bits. The contents of {HCR} are cleared on hardware or software reset. The
  195. control bits are described in the following paragraphs.
  196.  
  197. {Host Receive Interrupt Enable} ({HRIE}) {HCR} Bit 0:
  198.  
  199.     The {HRIE} bit is used to enablea DSP interrupt when the host receive data
  200. full ({HRDF}) status bit in the host status register ({HSR}) is set. When {HRIE}
  201. is cleared, {HRDF} interrupts are disabled. When {HRIE} is set, a host receive
  202. data interrupt request will occur if {HRDF} is set. Hardware and software
  203. resets clear {HRIE}.
  204.  
  205. {Host Transmit Interrupt Enable} ({HTIE}) {HCR} Bit 1:
  206.  
  207.     The {HTIE} bit is used to enable a DSP interrupt when the host transmit
  208. data empty ({HTDE}) status bit in the {HSR} is set. When {HTIE} is cleared, {HTDE}
  209. interrupts are disabled. When {HTIE} is set, a host transmit data interrupt
  210. request will occur if {HTDE} is set. Hardware and software resets clear {HTIE}.
  211.  
  212. {Host Command Interrupt Enable} ({HCIE}) {HCR} Bit 2:
  213.     The {HCIE} bit is used to enable a vectored DSP interrupt when the host
  214. command pending ({HCP}) status bit in the {HSR} is set. When {HCIE} is cleared,
  215. {HCP} interupts are disabled. When {HCIE} is set, a host command interrupt
  216. request will occur if {HCP} is set. The starting address of this interrupt is
  217. determined by the host vector (HV). Hardware and software resets clear {HCIE}.
  218.  
  219. {Host Flag 2} ({HF2}) {HCR} Bit 3:
  220.  
  221.     The {HF2} bit is used as a general-purpose flag for DSP-to-host
  222. communication. {HF2} may be set or cleared by the DSP. {HF2} is visible in the
  223. interrupt status register (ISR) on the host processor side. Hardware and
  224. software resets clear {HF2}.
  225.  
  226. NOTE:    There are four host flags: two used by the host to signal the DSP
  227. ({HF0} and {HF1}) and two used by the DSP to signal the host processor ({HF2} and
  228. {HF3}).These flags are not designated for any specific purpose but are
  229. general-purpose flags. The host flags do not cause interrupts; they must be
  230. polled to see if they have changed. These flagscan be used individually or
  231. as encoded pairs.
  232.  
  233. {Host Flag 3} ({HF3}) {HCR} Bit 4:
  234.  
  235.     The {HF3} bit is used as a general-purpose flag for DSP-to-host
  236. communication. {HF3} may be set or cleared by the DSP. {HF3} is visible in the
  237. ISR on the host processor side. Hardware and software resets clear {HF3}.
  238.  
  239. {Reserved Bits} ({HCR} Bits 5, 6, and 7):
  240.  
  241.     These unused bits are reserved for future expansion and should be
  242. written with zeros for upward compatibility.
  243.  
  244.  
  245. {HOST STATUS REGISTER} ({HSR}):{êHRDF}{êHTDE}{êHCP}{êHF0}{êHF1}{êDMA}
  246.     The {HSR} is an 8-bit read only status register used by the DSP to
  247. interrogate status and flags of the {HI}. It can not be directly accessed by
  248. the host processor. When the {HSR} is read to the internal data bus, the
  249. register contents occupy the low-order byte of the data bus; the high-order
  250. portion is zero filled. The status bits are described in the following
  251. paragraphs.
  252.  
  253. {Host Receive Data Full} ({HRDF}) {HSR} Bit 0:
  254.     The {HRDF} bit indicates that the host receive data register ({HRX})
  255. contains data from the host processor. {HRDF} is set when data is transferred
  256. from the TXH:TXM:TXL registers to the {HRX} register. {HRDF} is cleared when {HRX}
  257. is read by the DSP. {HRDF} can also be cleared by the host processor using the
  258. initialize function. Hardware, software, individual and {STOP} resets clear
  259. {HRDF}.
  260.  
  261. {Host Transmit Data Empty} ({HTDE}) {HSR} Bit 1:
  262.  
  263.     The {HTDE} bit indicates that the Host Transmit Data Register ({HTX}) is
  264. empty and can be written by the DSP. {HTDE} is set when the {HTX} register is
  265. transferred to the RXH:RXM:RXL registers. {HTDE} is cleared when {HTX} is
  266. written by the DSP. {HTDE} can also be set by the host processor using the
  267. initialise function. Hardware, software, individual, and {STOP} resets set
  268. {HTDE}.
  269.  
  270. {Host Command Pending} ({HCP}) {HSR} Bit 2:
  271.  
  272.     The {HCP} bit indicates that the host has set the HC bit and that a host
  273. command interrupt is pending. The {HCP} bit reflects the status of the HC bit
  274. in the command vector register (CVR). HC and {HCP} are cleared by the DSP
  275. exception hardware when the exception is taken. The host can clear HC, which
  276. also clears {HCP}. Hardware, software, individual, and {STOP} resets clear {HCP}.
  277.  
  278. {Host Flag 0} ({HF0}) {HSR} Bit 3:
  279.  
  280.     The {HF0} bit in the {HSR} indicates the state of host flag 0 in the ICR on
  281. the host processor side. {HF0} can only be changed by the host processor.
  282. Hardware, software, individual, and {STOP} resets clear {HF0}.
  283.  
  284. {Host Flag 1} ({HF1}) {HSR} Bit 4:
  285.  
  286.     The {HF1} bit in the {HSR} indicates the state of host flag 1 in the ICR on
  287. the host processor side. {HF1} can only be changed by the host processor.
  288. Hardware, software, individual, and {STOP} resets clear {HF1}.
  289.  
  290. {Reserved Bits} ({HSR} Bits 5 and 6):
  291.  
  292.     These status bits are reserved for future expansion and reads as zero
  293. during DSP read operations.
  294.  
  295. {DMA Status} ({DMA}) {HSR} Bit 7:
  296.  
  297.     The {DMA} bit indicates that the host processor has enabled the {DMA} mode of
  298. the {HI} by setting HM1 or HM0 to one. When {DMA} bit is zero, it indicates that
  299. the {DMA} mode is disabled by the HM0 and HM1 bits in the ICR and that no {DMA}
  300. operations are pending. When {DMA} is set, the {DMA} mode has been enabled by one
  301. or more of the host mode bits being set to one.The channel not in use can be
  302. used for polled or interrupt operation bythe DSP. Hardware, software,
  303. individual, and {STOP} resets clear the {DMA} bit.
  304.  
  305.  
  306. {HOST RECEIVE DATA REGISTER} ({HRX}):
  307.     The {HRX} register is used for host-to-DSP data transfers.The {HRX} register
  308. is viewed as a 24-bit read-only register by the DSP CPU. The {HRX} register is
  309. loaded with 24-bit data from the transmit data registers (TXH:TXM:TXL) on
  310. the host processor side when both the transmit data register empty TXDE on
  311. the host processor side and DSP host receive data full ({HRDF}) bits are
  312. cleared. This transfer operations sets TXDE and {HRDF}. The {HRX} register
  313. contains valid data when the {HRDF} bit is set. Reading {HRX} clears {HRDF}. The
  314. DSP may program the {HRIE} bit to cause a host receive data interrupt when
  315. {HRDF} is set. Resets do not affect {HRX}.
  316.  
  317.  
  318. {HOST TRANSMIT DATA REGISTER} ({HTX}):
  319.  
  320.     The {HTX} register is used for DSP-to-host data transfers. The {HTX}
  321. register is viewed as a 24-bit write-only register by the DSP CPU. Writing
  322. the {HTX} register clears {HTDE}. The DSP may program the {HTIE} bit to cause a
  323. host transmit data interrupt when {HTDE} is set. The {HTX} register is
  324. transfered as a 24-bit data to the receive byte registers (RXH:RXM:RXL) if
  325. both the {HTDE} bit (DSP CPU side) and receive data full (RXDF) status bits
  326. (host processor side are cleared. This transfer operation sets RXDF and
  327. {HTDE}. Data should not be written to the {HTX} until {HTDE} is set to prevent the
  328. previous data from being overwritten. Resets do not affect {HTX}.
  329.  
  330.  
  331.