简体   繁体   中英

Having FPGA to output sound on “line out” pin using verilog

I am trying to write a verilog code for FPGA which will output sound from the embedded "line out" pin. I use Quartus II and Altera DE1.

I am new to hardware programming, therefore it just takes too much time for me to catch up with basics. Apparently I need to initialize the wolfson chip and need to write something to communicate with it, as discussed here: http://www.alteraforum.com/forum/showthread.php?t=6005

It uses wolfson WM8731 codec, manual is in here: http://www.rockbox.org/wiki/pub/Main/DataSheets/WM8731_8731L.pdf

and an example I found but couldnt figured out how to use it is in here: https://code.google.com/p/vector06cc/wiki/SoundCodec

I have found bunch of examples about how to generate sounds using GPIO pins, but barely anything about the usage of WM8731. I would really appreciate any guidance or experience you might share.

Assuming you're using Nios II and either SOPC Builder or Qsys, the Altera University Program offers an IP core to control the Audio CODEC on the DE-Series boards.

If you don't already have it, you can download it here (at the bottom of the page, listed as University Program Installer): https://www.altera.com/support/training/university/materials-ip-cores.html

Once you install it, check the <altera-directory>/University_Program\\NiosII_Computer_Systems\\DE1\\DE1_Media_Computer directory. app_software and app_software_HAL both give example methods to write to the audio output (using C code running on the Nios II), and the verilog or vhdl folder show example systems on connecting the core to a NIOS II using your preferred HDL.

The core itself can be found in <altera-directory>\\ip\\University_Program\\Audio_Video . See also ftp://ftp.altera.com/up/pub/Altera_Material/14.1/University_Program_IP_Cores/Audio_Video/Audio.pdf for some (potentially) helpful reading/reference.


Addendum: All of the FPGA inputs and outputs use the "Digital Audio Interface" of the WM8731 chip. The pins available on the FPGA are as follows:

  • PIN_A6 : AUD_ADCLRCK
  • PIN_B6 : AUD_ADCDAT
  • PIN_A5 : AUD_DACLRCK
  • PIN_B5 : AUD_DACDAT
  • PIN_A4 : AUD_BCLK
  • PIN_B4 : AUD_XCK (MCLK on WM8731)

Output is sent to the CODEC on the AUD_DACDAT pin. The chip is configured using the I2C_SDAT and I2C_SCLK pins on I2C address 0x34 for read, and 0x35 for write. No other pins are available to the FPGA - some are used for external connections (like the mike or line-in), or are not connected at all. For a full list of pin assignments for the DE1 (which can be directly imported to Quartus) see: ftp://ftp.altera.com/up/pub/Altera_Material/12.1/Boards/DE1/DE1.qsf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM