TERASIC DE1 SOC VIP Demo
TERASIC DE1 SOC VIP Demo
TERASIC DE1 SOC VIP Demo
Many commercial media/audio players use a large external storage device, such as an
SD Card or CF card, to store music or video files. Such players may also include
high-quality DAC devices so that good audio quality can be produced. DE1_SoC
board provides the hardware and software needed for Micro SD Card access and
professional audio performance so that it is possible to design advanced multimedia
products using the DE1_SOC board. It is very convenient to get music file is the
micro SD card with the embedded linux operate system and file system. This
demonstration presents using HPS to control the FPGA to play music on De1_SoC
board.
As it known to the users that the micro SD card is accessible to the HPS and the audio
chip is accessible to the FPGA part on De1_SOC board. So the HPS must translate
date to the FPGA to control the audio chip and play music in this demonstration. In
the diagram of this demonstration shown in Figure 6-3, The Lightweight
HPS-to-FPGA Bridge works as the media to translate date from HPS to FPGA.
The program running in hps access the Lightweight HPS-to-FPGA Bridge and
translate date through it to the fpga. Since the user application program can't control
the peripheral through the physical address, so the lwaxi bridge should be mapped
into the user space. The method to get music data is so simply that you just need to
use the file operate functions such as fopen( ) and fread( ) in the standard C library.
The audio decode chip WM8731 has a I2C control interface to write the register in it.
The audio chip should be configured before sending audio signal to the audio chip.
The program uses I2C protocol to configure the audio chip working in master mode;
the audio output interface working in I2S 16-bits per channel and with sampling
rate according to the wave file contents. In audio playing loop, the main program
reads 512-byte audio data from the micro SD Card, and then writes the data to DAC
FIFO in the Audio Controller. Before writing the data to the FIFO through lwaxi
bridge, the program will verify if the FIFO is full. The design also mixes the audio
signal from the microphone-in and line-in for the Karaoke-style effects by enabling
the BYPASS and SITETONE functions in the audio chip.
Demonstration Setup
Make sure Quartus II and Nios II are installed on your PC.
Connect the USB blaster cable to the USB blaster connector (J13) on the
DE1_SOC board and host PC install USB Blaster driver II if necessary.
Connect the USB cable to the USB-to-UART connector (J4) on the DE1_SOC
board and host PC.
Make sure the executable file " de1_soc_audio_app " and the .mp3 or .wav music
file is copied into the SD card under the "/home/root" folder in Linux.
Insert the booting micro SD card into the DE1_SOC board.
Power on the DE1_SOC board.
Launch PuTTY to connect to the UART port of DE1_SOC board and type "root"
to login Altera Yocto Linux.
Execute the demo batch file “test.bat” under the \ quickfile \sof_dwonload
In the UART terminal of PuTTY, execute "./de1_soc_audio_app –f
My_Heart_Will_Go_On.wav (or .mp3)" to start the program.
Insert a speaker to the line out connector and you should listen the music. Press
"CTRL + C" to terminate the program.
DE1_SOC video decode demonstration
It is very fashion to display video in multimedia products. The fpga and arm processor
have special advantage in video processing because their high speed and
programmable logic in embedded appication. This demonstration presents how to use
HPS to decode mpeg2 format video and display it on the VGA monitor on DE1_SoC
board.
Figure 6-4 show the block diagram of the video decode demo. The HPS use both
LWAXI bridge and AXI bridge to communicate with FPGA. The LWAXI bridge is
used for translating vip suite controlling signal and the axi bridge is used for
translating video data .Since the axi bridge data width can be configured as 128 bits at
most and the lwaxi bridge is only 64 bits, the axi bridge is more suitable for
translating large mount of data. The sdram on fpga part is used storage frame data and
the frame reader read the data. The pattern generator ip and log generate ip constitute
the background of demonstration through the mix ip. The output clock generate ip get
the data from mix and generate the VGA timing data. In this demonstration, 640x480
resolution format video is used and the background is 1280x1024 pixels.
The program running in hps access the Lightweight HPS-to-FPGA Bridge and
HPS-to-FPGA Bridge then translate date to the fpga. Since the user application
program can't control the peripheral through the physical address, so the lwaxi bridge
and axi bridge should be mapped into the user space. The method to get video data is
so simply that you just need to use the file operate functions such as fopen() and
fread() in the standard C library.
In this demonstration, we use the mpeg2 format video to display and the hps should
decode the video data into raw RGB format data before translating it to the FPGA. We
add the libmpeg library to our application to decode the video data. The library supply
us the interface function to decode the video. We just need to call the function in you
application program and add the library when compile the program.
Demonstration Setup
Make sure Quartus II and Nios II are installed on your PC.
Connect the USB blaster cable to the USB blaster connector (J13) on the
DE1_SOC board and host PC install USB Blaster driver II if necessary.
Connect the USB cable to the USB-to-UART connector (J4) on the DE1_SOC
board and host PC.
Make sure the executable file " de1_soc_vip_mpeg " and the .m2v video file is
copied into the SD card under the "/home/root" folder in Linux.
Insert the booting micro SD card into the DE1_SOC board.
Power on the DE1_SOC board.
Launch PuTTY to connect to the UART port of SoCKit board and type "root" to
login Altera Yocto Linux.
Execute the demo batch file “test.bat” under the \ quickfile \sof_dwonload
In the UART terminal of PuTTY, execute ".\de1_soc_vip_mpeg v_640x480.m2v
" to start the program.
Connect a VGA monitor to the VGA connector and you will find a video will
display on the monitor ,and the video will move around. Press "CTRL + C" to
terminate the program.