– BlackAn – The Blackfin Analyzer by Jacob Zurasky and Paul Deffenbaugh
Project Goals Display oscilloscope view of audio on TV screen Display oscilloscope view of audio on TV screen Compute and display Fourier Spectrum on TV Compute and display Fourier Spectrum on TV
Tasks Sample Audio Data Sample Audio Data Compute Fourier Spectrum Compute Fourier Spectrum Update Video Memory Update Video Memory Display Video Memory Display Video Memory
Displaying Graphics Memory requirements Memory requirements One Frame = [1716][525] elements One Frame = [1716][525] elements Two frames required to buffer video output Two frames required to buffer video output Active area on TV is 310 x 212 pixels Active area on TV is 310 x 212 pixels
Video Memory SDRAM holds first frame at 0x SDRAM holds first frame at 0x Second frame at 0x000D BF24 Second frame at 0x000D BF24 DMA0 sends data through PPI DMA0 sends data through PPI Video Codec creates the TV signal Video Codec creates the TV signal
SDRAM Problems Writing to SDRAM interrupts reading Writing to SDRAM interrupts reading This causes video glitches This causes video glitches Corrupts the timing of data sent to codec Corrupts the timing of data sent to codec
SDRAM Solution We found that 1-4 pixels can be written We found that 1-4 pixels can be written at the end of each TV line sent This method allows for pixels to This method allows for pixels to be written per frame sent to the TV
SDRAM Solution We changed the DMA0 interrupt to trigger We changed the DMA0 interrupt to trigger on the completion of inner loop (each line) State machine decides what pixels need to be written and blanked at the correct time State machine decides what pixels need to be written and blanked at the correct time
State Machine State 0 – Fill audio buffers State 0 – Fill audio buffers Capture 310 audio samples at 48 kHz Capture 310 audio samples at 48 kHz This is the width of the TV screen This is the width of the TV screen State is changed to 1 upon completion State is changed to 1 upon completion
State Machine State 1 – Process audio data State 1 – Process audio data Compute the DFT if necessary for display Compute the DFT if necessary for display Set to state 2 upon completion Set to state 2 upon completion
State Machine State 2 – Plot data to video memory State 2 – Plot data to video memory At the end of each line sent, draw a new pixel At the end of each line sent, draw a new pixel to the video buffer not being displayed When all current plotting is complete, switch to State 3 When all current plotting is complete, switch to State 3
State Machine State 3 – Swap Video Buffers State 3 – Swap Video Buffers At the end of a complete frame (DMA outer loop), the DMA start address is set to the other video buffer in SDRAM At the end of a complete frame (DMA outer loop), the DMA start address is set to the other video buffer in SDRAM The switch must occur while the DMA is disabled and after completing a frame The switch must occur while the DMA is disabled and after completing a frame
State Machine State 4 – Blank the previous video buffer State 4 – Blank the previous video buffer The buffer not being displayed now must be cleared for new data The buffer not being displayed now must be cleared for new data Write black pixels over the old data Write black pixels over the old data Reset back to State 0 Reset back to State 0
Sampling Audio Data DMA1 uses SPORT0 to receive audio data DMA1 uses SPORT0 to receive audio data DMA2 uses SPORT0 to transmit audio data DMA2 uses SPORT0 to transmit audio data
Sampling Audio Data On interrupt, if State = 0, fill audio buffers On interrupt, if State = 0, fill audio buffers Audio_BufferL[] and Audio_BufferR[] Audio_BufferL[] and Audio_BufferR[] Collect 310 samples of audio Collect 310 samples of audio
Compute the DFT Using this definition, the DFT is computed Using this definition, the DFT is computed
Compute DFT Sine and Cosine factors are pre-computed Sine and Cosine factors are pre-computed This greatly improved the speed of DFT This greatly improved the speed of DFT The lookup tables had to be implemented in SDRAM The lookup tables had to be implemented in SDRAM
Plotting Data to TV There are 4 display modes There are 4 display modes Left channel oscilloscope Left channel oscilloscope Left/Right channel oscilloscope Left/Right channel oscilloscope DFT DFT Left channel oscilloscope and DFT Left channel oscilloscope and DFT
Plotting Data to TV The data is scaled depending on the mode The data is scaled depending on the mode Data is plotted pixel by pixel at the end of each line sent to the TV Data is plotted pixel by pixel at the end of each line sent to the TV Video buffers are swapped once complete Video buffers are swapped once complete
Changing Display Modes Can only occur at the end of a frame Can only occur at the end of a frame Both video buffers must be cleared Both video buffers must be cleared Then change the display mode flag Then change the display mode flag
Future Improvements Add a title screen from a bitmap image Add a title screen from a bitmap image Fine tune the DFT results and scaling Fine tune the DFT results and scaling More display modes More display modes
Questions? Please us at Please us at