Forum Discussion
Altera_Forum
Honored Contributor
17 years ago --- Quote Start --- Hi guys , I'm trying to understand the audio demo example for the altera De2 that comes into the CD I'm reading the datasheet from wolfson(wm8731). At moment I doesn't know how they are using the index in the ROM array. ROM[0]= 16'h0c00; //power down ROM[1]= 16'h0ec2; //master ROM[2]= 16'h0838; //sound select ROM[3]= 16'h1000; //mclk ROM[4]= 16'h0017; // ROM[5]= 16'h0217; // ROM[6]= {8'h04,1'b0,vol[6:0]}; // ROM[7]= {8'h06,1'b0,vol[6:0]}; //sound vol //ROM[4]= 16'h1e00; //reset ROM[`rom_size]= 16'h1201;//active Can you explain me please? Thank you. --- Quote End --- First and foremost you should understand the software control interface. one write sequence require 3 bytes : 7-bit slave address ( 0x34 ), 1write bit ( 0 ), 7-bit register address, followed by 9-bit data. at page 46 of the datasheet, you could find Table 29:Mapping of Program Registers ROM[0]= 16'h0c00; //power down , R6 : enable power for all modules ROM[1]= 16'h0ec2; //master R7: used inverted BCLK, Master mode, I2S format, MSB-first left-1 justified I believe you could easily understand the rest of the configuration. After configuring WM8731, you need to activate it by this one ROM[`rom_size]= 16'h1201;//active btw, For the I2sound demonstration WM8731 is configured in the sidetone mode ( directly route from mic to headphone ). If you want to make the codec speak audio from PCM like wav file, you probably want to see the configuration in SDcard to music demonstration.