{"id":285,"date":"2015-06-10T17:50:28","date_gmt":"2015-06-11T00:50:28","guid":{"rendered":"http:\/\/tubetime.us\/?p=285"},"modified":"2015-06-10T17:50:28","modified_gmt":"2015-06-11T00:50:28","slug":"battlezone-mini-arcade-source-stm32f407-discovery-board-sound-mods","status":"publish","type":"post","link":"https:\/\/tubetime.us\/index.php\/2015\/06\/10\/battlezone-mini-arcade-source-stm32f407-discovery-board-sound-mods\/","title":{"rendered":"Battlezone Mini Arcade Source, STM32F407 Discovery Board Sound Mods"},"content":{"rendered":"<p>First, the source code for the mini <a href=\"http:\/\/tubetime.us\/?p=280\" target=\"_blank\">Battlezone arcade machine<\/a> is <a href=\"https:\/\/github.com\/morbos\/bzone\" target=\"_blank\">now online (GitHub)<\/a>, along with the <a href=\"https:\/\/github.com\/morbos\/asteroids\" target=\"_blank\">code for the mini Asteroids arcade<\/a>.<\/p>\n<p>If you build either of those and try it out on an STM32F407 Discovery board, you will notice that no sound comes out. The reason is that the onboard audio codec has a LRCK line (left\/right framing clock for the I2S audio stream) wired up to GPIO PA4, which happens to be one of the DAC outputs that we are using for the vector graphics generation. You&#8217;ll need to disconnect LRCK (U7 pin 40) from PA4 and wire it to PA15. I did it by cutting a trace (indicated with a black arrow) on the back of the board to isolate the PA4\/LRCK net from the STM32:<br \/>\n<a href=\"https:\/\/picasaweb.google.com\/lh\/photo\/4h_awH5Ys4jK6tYkJ67NCcBvcm5g8xbMBAyv0vCZF1M?feat=embedwebsite\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/-3hf58xVicnU\/VXjXpmoGubI\/AAAAAAAAF2k\/SCKAVIquCHw\/s400\/bottom_cut_trace.jpg\" height=\"400\" width=\"318\" \/><\/a><br \/>\nAnd by adding a wire (indicated in red) on the top of the board from R48 to pin 77 (red arrow) of the STM32 (PA15):<br \/>\n<a href=\"https:\/\/picasaweb.google.com\/lh\/photo\/thbTQ7HCd1_m-tkDFWyh7sBvcm5g8xbMBAyv0vCZF1M?feat=embedwebsite\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/-dkxLpmKA4Ac\/VXjXru7r18I\/AAAAAAAAF2k\/1E0egJvHnkQ\/s400\/top_add_wire.jpg\" height=\"400\" width=\"292\" \/><\/a><\/p>\n<p>Oh, and one more thing. To keep the audio mixer marching along, we had to connect PC6 to PC7. This ties the I2S MCLK to timer 3 channel 1, which triggers a periodic interrupt that mixes new samples into the audio output buffer. The easiest way to do this is to connect a jumper across pins 47 and 48 on the GPIO header P2. They are clearly marked on the board and the pins are right next to each other so this is easy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First, the source code for the mini Battlezone arcade machine is now online (GitHub), along with the code for the mini Asteroids arcade. If you build either of those and try it out on an STM32F407 Discovery board, you will notice that no sound comes out. The reason is that the onboard audio codec has [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p80Z1r-4B","_links":{"self":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts\/285"}],"collection":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/comments?post=285"}],"version-history":[{"count":0,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/posts\/285\/revisions"}],"wp:attachment":[{"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tubetime.us\/index.php\/wp-json\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}