zmatt

beaglebone audio hw notes

Nov 15th, 2018 (edited)
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. // McASP 0 has two IOSets on the BBB headers:
  2. //
  3. // bbb gpio pin f3 f4
  4. // P8.34 2.17 51 rx hclk data 2
  5. // P8.35 0.08 52 rx clk data 2
  6. // P8.33 0.09 53 rx fs data 3
  7. // P8.32 0.11 55 tx hclk data 3
  8. // P8.37 2.14 48 tx clk -
  9. // P8.38 2.15 49 tx fs -
  10. // P8.36 2.16 50 data 0 -
  11. // P8.31 0.10 54 data 1 -
  12. //
  13. // and
  14. //
  15. // bbb gpio pin f0 f2 f3
  16. // P9.28 3.17 103 rx hclk data 2 -
  17. // P9.42 3.18 104 rx clk data 2 asp 1 tx clk
  18. // P9.27 3.19 105 rx fs data 3 asp 1 tx fs
  19. // P9.25 3.21 107 tx hclk (osc) data 3 asp 1 data 1
  20. // P9.31 3.14 100 tx clk - -
  21. // P9.29 3.15 101 tx fs - -
  22. // P9.30 3.16 102 data 0 - -
  23. // P9.41 3.20 106 data 1 - asp 1 data 0
  24. //
  25. // As indicated, some pins in the second set can alternatively be used for
  26. // McASP 1 instead. McASP 1 has no other pinout on the BBB.
  27. //
  28. // An on-board 24.576 MHz oscillator can be optionally enabled to drive its
  29. // signal onto pin 107 (P9.25) for use as audio master clock by McASP 0 and/or
  30. // external components.
  31. //
  32. //
  33. // Any set of synchronous signals with specific timing-relationship must come
  34. // from the same IOSet, otherwise timings specified in datasheet are not
  35. // guaranteed. Note however that e.g. the delay from hclk input to clk is not
  36. // specified, hence I see no reason to constrain hclk (if used) to to the same
  37. // ioset as clk.
  38. //
  39. // McASP can operate with transmit and receive sections synchronized or they
  40. // can be independent. If independent, then different iosets can be used for
  41. // the two sections of course. If synchronized, the internal transmit clk/fs
  42. // are also used as internal receive clk/fs.
  43. //
  44. // (CAUTION: the linux kernel driver currently only supports synchronized mode)
  45. //
  46. // Which signals are needed and what direction they have depend heavily on the
  47. // extremely flexible configuration of McASP. For example you could have fully
  48. // asynchronous transmit and receive sections in I²S master mode with external
  49. // reference clocks suited for 44.1 kHz input but 48 kHz output:
  50. //
  51. // tx hclk <-- master clock (24 576 000 Hz)
  52. //
  53. // tx clk --> tx clk ( 3 072 000 Hz)
  54. // tx fs --> tx fs ( 48 000 Hz)
  55. // data 0 --> tx data ( 2 × 32-bit )
  56. //
  57. // rx hclk <-- master clock (11 289 600 Hz)
  58. //
  59. // rx clk --> rx clk ( 705 600 Hz)
  60. // rx fs --> rx fs ( 44 100 Hz)
  61. // data 1 <-- rx data ( 2 × 16-bit )
  62. //
  63. // (Note that clk is also known as bck (bit clock) and fs is also known as
  64. // lrck (left/right clock). The official I²S terminology however is "sck"
  65. // for clk, "ws" (word select) for fs, and "sd" (serial data) for data.
  66. // This however conflicts with the common use of "sck" to denote system
  67. // clock, i.e. what McASP calls hclk (high-speed clock).
  68. //
  69. // Here's the other extreme, with tx/rx synchronized in slave mode on just a
  70. // single clock line and the max amount of data crammed in both directions:
  71. //
  72. // tx clk <-- tx/rx clock (49 152 000 Hz)
  73. // tx fs <-- tx/rx frame sync ( 48 000 Hz)
  74. // data 0 --> tx channels 0-31 ( 32 × 32-bit )
  75. // data 1 <-- rx channels 0-31 ( 32 × 32-bit )
  76. // data 2 --> tx channels 32-63 ( 32 × 32-bit )
  77. // data 3 <-- rx channels 32-63 ( 32 × 32-bit )
  78. //
  79. // You can configure the direction of each data line, so you can trade number
  80. // of inputs against number of outputs (in blocks of 32 channels), yielding
  81. // the limit of max 128 in or out. Beware that this configuration is barely
  82. // within spec (max clock is 50 MHz), may not be supported by linux, and in
  83. // general may be "fun" to get working reliably ;)
  84. //
  85. // Another example, with clk/fs going the same direction as the associated data,
  86. // which helps to avoid any worries about timing closure. It also gives more
  87. // freedom of pin assignment since rx and tx can be in different iosets:
  88. //
  89. // tx hclk <-- master clock (24 576 000 Hz)
  90. //
  91. // tx clk --> tx clk (24 576 000 Hz)
  92. // tx fs --> tx lrck ( 48 500 Hz)
  93. // data 0 --> tx ch 0-15 ( 16 × 32-bit )
  94. // data 2 --> tx ch 16-31 ( 16 × 32-bit )
  95. //
  96. // rx clk <-- rx clk (24 576 000 Hz)
  97. // rx fs <-- rx fs ( 48 000 Hz)
  98. // data 1 <-- rx ch 0-15 ( 16 × 32-bit )
  99. // data 3 <-- rx ch 16-31 ( 16 × 32-bit )
  100. //
  101. // If providing tx hclk is problematic you may need to sacrifice data 3 or just
  102. // accept you're stuck with the 24 MHz main osc and e.g. a funky config like:
  103. //
  104. // tx clk --> tx clk (24 000 000 Hz)
  105. // tx fs --> tx lrck ( 62 500 Hz) or ( 46 875 Hz)
  106. // data 0 --> tx ch 0-15 ( 16 × 24-bit ) or ( 16 × 32-bit )
  107. // data 2 --> tx ch 16-31 ( 16 × 24-bit ) or ( 16 × 32-bit )
  108. //
  109. // This may look weird but isn't always necessarily a problem, especially if an
  110. // async sample rate converter is already somewhere in the chain. (You can
  111. // even get 48 kHz exactly by using 20-bit slots, 5 or 25 slots per frame.)
  112. //
  113. //
  114. // Finally, the transmit section can be configured to directly produce output
  115. // in S/PDIF or AES-3. When enabled, it applies to all data lines configured
  116. // for transmit, which will have two 20/24-bit channels each but all use the
  117. // same metadata (channel status, user data, and validity information). The
  118. // receiver may still be used independently.
  119. //
  120. // For this mode clk must be 128 * fs and internally generated from hclk. It
  121. // cannot be supplied via the clk pin, though it could be output if you cared.
  122. //
  123. // tx hclk <-- master clock (24 576 000 Hz)
  124. // data 0 --> tx ch 0-1 ( S/PDIF or AES-3 )
  125. // data 1 --> tx ch 2-3 ( S/PDIF or AES-3 )
  126. // data 2 --> tx ch 4-5 ( S/PDIF or AES-3 )
  127. // data 3 --> tx ch 6-7 ( S/PDIF or AES-3 )
  128. //
  129. // Using main osc instead of external master clock would yield 46 875 Hz.
Add Comment
Please, Sign In to add comment