home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-2.iso / Developer / hardware / dsp / drbub / board / note4 < prev    next >
Encoding:
Text File  |  1991-09-07  |  6.5 KB  |  140 lines

  1. Building a DSP board, Part Four: Hooking up RAM & ROM
  2. -----------------------------------------------------
  3.  
  4. This is the fourth in a series on how I went about building
  5. a dual Motorola DSP56000 sampling board.
  6.  
  7. As I had no real high-speed (well, high for me) digital design
  8. experience, I wanted to keep this part as simple as possible.
  9. I chose to use static RAMs since the 56000 doesn't have a
  10. built in RAM refresh.  The only problem with this choice is
  11. that they are *expensive*, especially the fast ones.  Thankfully,
  12. Integrated Device Technologies came to my aid and gave me four
  13. 64k x 16bit 70ns SRAMS.  Unfortunately, these are not quite
  14. fast enough to go with no wait states (<60 ns would do it).
  15.  
  16. However, that is no big deal.  Wait states are metered out
  17. in terms of clock cycles, not instruction cycles.  Therefore,
  18. I only needed half an instruction cycle of wait time.  Besides,
  19. I mainly would use this part for storing data for delay effects.
  20. The 256 words of fast RAM (no wait states) maps into the first
  21. 256 address spaces, with the rest taken by the external SRAM.
  22. The chip is smart enough to know not to wait on the internal
  23. RAM.  So, if I needed to do any fast calculations and memory
  24. stores, I would use the first 256 words.  Delay storage gets
  25. set above that 256 words.  Not only that, but in my case,
  26. the first 256 words are 24 bits and the rest of the 64k is
  27. 16 bits (BTW, the address bus is 16 bits, the data register
  28. is 24 bits... kinda unusual to to the later greater than
  29. the former!).  64 k is enough to store 1 and 2/3rds seconds
  30. of audio at my 39kHz sampling rate (and remember, since I
  31. am using X and Y memory, it's in stereo!).  This is more than
  32. enough memory for most audio applications.
  33.  
  34. [side note:  The separate X and Y memories make this chip ideal
  35.          for stereo applications.  It makes it very easy to
  36.          write routines - you simply duplicate the routine
  37.          and make it work with the other address space instead.]
  38.  
  39. Okay, where were we?  Oh yeah... I think I've covered most of the
  40. SRAM details.  One last thing.  Since we are not using the bottom
  41. 8 bits of the external memory, we tie them to ground through a
  42. 47k ohm resistor.  This is important!  If we don't ground these
  43. bits, they will probably be read as high and we will have to clear
  44. them in software every time we load from external RAM.  We have to
  45. use the resistor, as these are outputs, too, and if we just ground
  46. them, we'll short those pins if they are high.  Also, the ROM gets
  47. connected to these lower bits.
  48.  
  49. Making a program ROM for this chip is very easy.  You can use
  50. off the shelf EPROMS (like the 2716) of only 8 bits wide.  There
  51. are two mode bits that you wire up on the chip that determine its
  52. bootup mode (there is a bootstrap ROM in the chip).  We select
  53. mode 1 (bootstrap mode) which boots a program that will load program
  54. data through the lower 8 bits of the data bus.  But first, we must
  55. tie the high bit of the data bus through a 47k ohm resistor to +5V.
  56. The bootstrap program checks the high data bit at program memory
  57. $C000 to check whether or not to load from the host port or from
  58. the data port.  The host port loading will make program loading
  59. easy for those of you with PCs.
  60.  
  61. The program then loads the program from the ROM.  The 56000 boots
  62. in slow mode (15 wait states on all types of external memory), so
  63. we don't have to worry about speed on the 2716 (I think I used 250
  64. nsec).  Addresses $0000-$0002 hold the first word in LSB, MidSB,
  65. MSB order (Intel bassackwards format).  Remember that it is NOT
  66. MSB, MidSB, LSB!!!  It took me a couple hours to figure this one
  67. out, as I am used to the "correct" way of MSB, MidSB, LSB that
  68. Motorola uses in all of their products.  Internally, the 56000
  69. keeps things in MSB LSB order; it is just the external bootstrap
  70. ROM that has to be backwards (not sure why they did this...
  71. suspect that it has to do with some standard for PROM burning...).
  72.  
  73. Now we have to do the external chip select decoding.  This is the
  74. *only* glue logic needed!  This is also the only part that I
  75. think Motorola screwed up on (although I'm sure they have their
  76. reasons).  There are three chip select outputs.  _PS_ (this is
  77. my notation for PS with a bar over it) is low for external program
  78. memory, _DS_ is low for external data memory, and X/_Y_ determines
  79. which external data memory is referenced.  Here's a chart:
  80. __ __   _
  81. PS DS X/Y    External Memory reference
  82. -----------------------------------------
  83. 1  1  1        No activity
  84. 1  0  1        X data memory on data bus
  85. 1  0  0        Y data memory on data bus
  86. 0  1  1        Program memory on data bus
  87. 0  1  0        External exception fetch (development mode)
  88. 0  0  X        Reserved
  89. 1  1  0        Reserved
  90.  
  91. I thought it would be difficult to decode the X, Y and P lines, but
  92. there is a simple solution: just use a three to eight decoder.
  93. I chose the 74138 because it uses negative logic (the SRAM lines
  94. are negative logic).  I just hooked up the enable lines to the
  95. decoder outputs that went low when the proper input pattern
  96. was selected.  The delay time that this chip adds is another
  97. thing you must account for if you want to use no wait state
  98. SRAMS.
  99.  
  100. One thing I forgot to mention is that the bootstrap ROM is
  101. mapped from $C000 to $C5FF in the external program ROM.  I just
  102. ignore the upper bits of the address bus so that my EPROM is
  103. automatically selected.  Mode 1 maps the external program memory
  104. over the internal program memory for reading, but uses the internal
  105. program memory for writing.  After the internal bootstrap
  106. program has loaded the external program into the internal
  107. program RAM, it switches to mode 2 (maps internal program RAM for
  108. reading and writing) and starts executing at $0000.
  109.  
  110. I forgot to mention that these IDT SRAMS are SIPS (single in-line
  111. packages).  I need two of them for (one for X mem, one for Y mem).
  112. They each have 40 pins.  Hookup is quite simple.
  113.  
  114. First, I put 5 16-pin dips in a row like this:
  115.  ______  ______  ______  ______  ______
  116. /      \/      \/      \/      \/      \ <-- each one of this is a 16 pin dip
  117. oooooooooooooooooooooooooooooooooooooooo
  118.  
  119. oooooooooooooooooooooooooooooooooooooooo
  120.  
  121. This gives me two rows of sockets for the SIPS.  Basically, I just connect
  122. each of the adjacent pins like this:
  123.  
  124.             X
  125.             |
  126. oooooooooooooooooooooooooooooooooooooooo
  127. |||||||||||||||||||| |||||||||||||||||||
  128. oooooooooooooooooooooooooooooooooooooooo
  129.             |
  130.             Y
  131.  
  132. The X and Y are the individual chips selects.  The rest of the pins are
  133. power, control signals, address lines, and data lines, which are the same
  134. for both chips.
  135.  
  136. This arangement takes very little board space and is quite easy to hook up.
  137.  
  138. Next: Power supply considerations
  139.  
  140.