Upload
cornelius-caldwell
View
213
Download
0
Tags:
Embed Size (px)
Citation preview
– – BlackAn –BlackAn –The Blackfin AnalyzerThe Blackfin Analyzer
by Jacob Zuraskyby Jacob Zurasky
and Paul Deffenbaughand Paul Deffenbaugh
Project GoalsProject Goals
Display oscilloscope view of audio on TV Display oscilloscope view of audio on TV screenscreen
Compute and display Fourier Spectrum on Compute and display Fourier Spectrum on TVTV
TasksTasks
Sample Audio DataSample Audio Data
Compute Fourier SpectrumCompute Fourier Spectrum
Update Video MemoryUpdate Video Memory
Display Video MemoryDisplay Video Memory
Displaying GraphicsDisplaying Graphics
Memory requirementsMemory requirements One Frame = [1716][525] elementsOne Frame = [1716][525] elements Two frames required to buffer video Two frames required to buffer video
outputoutput
Active area on TV is 310 x 212 pixelsActive area on TV is 310 x 212 pixels
Video MemoryVideo Memory SDRAM holds first frame at 0x0000 0000SDRAM holds first frame at 0x0000 0000
Second frame at 0x000D BF24Second frame at 0x000D BF24
DMA0 sends data through PPIDMA0 sends data through PPI
Video Codec creates the TV signalVideo Codec creates the TV signal
SDRAM ProblemsSDRAM Problems
Writing to SDRAM interrupts readingWriting to SDRAM interrupts reading
This causes video glitches This causes video glitches
Corrupts the timing of data sent to codecCorrupts the timing of data sent to codec
SDRAM SolutionSDRAM Solution
We found that 1-4 pixels can be writtenWe found that 1-4 pixels can be written
at the end of each TV line sentat the end of each TV line sent
This method allows for 525-2100 pixels This method allows for 525-2100 pixels toto
be written per frame sent to the TVbe written per frame sent to the TV
SDRAM SolutionSDRAM Solution
We changed the DMA0 interrupt to triggerWe changed the DMA0 interrupt to trigger
on the completion of inner loop (each line)on the completion of inner loop (each line)
State machine decides what pixels need to State machine decides what pixels need to be written and blanked at the correct timebe written and blanked at the correct time
State MachineState Machine
State 0 – Fill audio buffersState 0 – Fill audio buffers
Capture 310 audio samples at 48 kHzCapture 310 audio samples at 48 kHz
This is the width of the TV screenThis is the width of the TV screen
State is changed to 1 upon completionState is changed to 1 upon completion
State MachineState Machine
State 1 – Process audio dataState 1 – Process audio data
Compute the DFT if necessary for Compute the DFT if necessary for displaydisplay
Set to state 2 upon completionSet to state 2 upon completion
State MachineState Machine
State 2 – Plot data to video memoryState 2 – Plot data to video memory
At the end of each line sent, draw a new pixelAt the end of each line sent, draw a new pixel
to the video buffer not being displayedto the video buffer not being displayed
When all current plotting is complete, switch to When all current plotting is complete, switch to State 3State 3
State MachineState Machine State 3 – Swap Video BuffersState 3 – Swap Video Buffers
At the end of a complete frame (DMA outer loop), At the end of a complete frame (DMA outer loop), the DMA start address is set to the other video the DMA start address is set to the other video buffer in SDRAMbuffer in SDRAM
The switch must occur while the DMA is disabled and The switch must occur while the DMA is disabled and after completing a frameafter completing a frame
State MachineState Machine State 4 – Blank the previous video bufferState 4 – Blank the previous video buffer
The buffer not being displayed now must be cleared for The buffer not being displayed now must be cleared for new datanew data
Write black pixels over the old dataWrite black pixels over the old data
Reset back to State 0 Reset back to State 0
Sampling Audio DataSampling Audio Data
DMA1 uses SPORT0 to receive audio DMA1 uses SPORT0 to receive audio datadata
DMA2 uses SPORT0 to transmit audio DMA2 uses SPORT0 to transmit audio datadata
Sampling Audio DataSampling Audio Data
On interrupt, if State = 0, fill audio On interrupt, if State = 0, fill audio buffersbuffers
Audio_BufferL[] and Audio_BufferR[]Audio_BufferL[] and Audio_BufferR[] Collect 310 samples of audioCollect 310 samples of audio
Compute the DFTCompute the DFT
Using this definition, the DFT is Using this definition, the DFT is computedcomputed
Compute DFTCompute DFT
Sine and Cosine factors are pre-computedSine and Cosine factors are pre-computed
This greatly improved the speed of DFTThis greatly improved the speed of DFT
The lookup tables had to be implemented The lookup tables had to be implemented in SDRAMin SDRAM
Plotting Data to TVPlotting Data to TV
There are 4 display modesThere are 4 display modes Left channel oscilloscopeLeft channel oscilloscope Left/Right channel oscilloscopeLeft/Right channel oscilloscope DFTDFT Left channel oscilloscope and DFTLeft channel oscilloscope and DFT
Plotting Data to TVPlotting Data to TV
The data is scaled depending on the modeThe data is scaled depending on the mode
Data is plotted pixel by pixel at the end of Data is plotted pixel by pixel at the end of each line sent to the TVeach line sent to the TV
Video buffers are swapped once completeVideo buffers are swapped once complete
Changing Display ModesChanging Display Modes
Can only occur at the end of a frameCan only occur at the end of a frame
Both video buffers must be clearedBoth video buffers must be cleared
Then change the display mode flagThen change the display mode flag
Future ImprovementsFuture Improvements
Add a title screen from a bitmap imageAdd a title screen from a bitmap image
Fine tune the DFT results and scalingFine tune the DFT results and scaling
More display modesMore display modes
Questions?Questions?
Please email us atPlease email us at