Battlezone Mini Arcade Source, STM32F407 Discovery Board Sound Mods

5:50 pm Projects

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 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’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:

And by adding a wire (indicated in red) on the top of the board from R48 to pin 77 (red arrow) of the STM32 (PA15):

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.

3 Responses
  1. Dave :

    Date: July 9, 2015 @ 2:24 pm

    Once again, awesome stuff. Quick question on sound- it tells me in
    Wire up a 4bit ladder dac from GPIOC[3:0] to the ladder dac (curr its either max or 0 in the code).
    Wiring a ladder dac on GPIOC[3:0] is no problem, but what do I connect the output to?

  2. eric :

    Date: July 11, 2015 @ 10:33 am

    Dave–the 4-bit DAC goes to the video amplifier board. You can get 16 different brightness levels.

  3. Robin :

    Date: January 20, 2021 @ 5:25 pm

    I’ve got Battlezone working, but no sound despite cutting the trace, soldering the wire and bridging the pins. Is the sound meant to come out of the headphone jack or should I wire a speaker to PA15 and GND, or something else?

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.