I am currently trying to setup the ssm2603 audio codex on the zybo board to output audio, with a purely rtl design. I am having issues setting up the audio codex via i2c. I am wondering about how you should send the address information to the audio codex to initialize the setup registers. Below is an RTL state machine of how I am trying to write the register values to the codex. Can someone verify that this is the correct way to address the registers? I am unable to get anything out from the audio codex currently, and I don't think my initialization is working.
always @(*) begin
next_state = IDLE;
address = 7'h0F;
data = 8'hFF;
case(state)
IDLE: begin
start = 0;
address = 7'h0F;
data = 8'hFF;
next_state = (setup_audio_codex) ? WR_POWER_MGNT : IDLE;
end
WR_POWER_MGNT: begin
start = (busy) ? 0 : 1;
address = 7'h06; //power management
data = 8'b00000111; //PWROFF,CLKOUT,OSC,OUT,DAC,ADC,MIC,LINEIN
next_state = (ready) ? WR_DIG_AUDIO_IF : WR_POWER_MGNT;
end
WR_DIG_AUDIO_IF: begin
start = (busy) ? 0 : 1;
address = 7'h07; //digital audio I/F
data = 8'b00000010; //BCLKINV,MS,LRSWAP,LRP,WL,FORMAT
next_state = (ready) ? WR_DIG_AUDIO_PATH : WR_DIG_AUDIO_IF;
end
WR_DIG_AUDIO_PATH: begin
start = (busy) ? 0 : 1;
address = 7'h05; //digital audio path
data = 8'b00000000; //HPOR,DACMU,DEEMPH,ADCHPF
next_state = (ready) ? WR_ANA_AUDIO_PATH : WR_DIG_AUDIO_PATH;
end
WR_ANA_AUDIO_PATH: begin
start = (busy) ? 0 : 1;
address = 7'h04; //analog audio path
data = 8'h00010010; //SIDETONE_ATT,SIDETONE_EN,DACSEL,BYPASS,INSEL,MUTEMIC,MICBOOST
next_state = (ready) ? IDLE : WR_ANA_AUDIO_PATH;
end
endcase
end
Question
zoggx003
I am currently trying to setup the ssm2603 audio codex on the zybo board to output audio, with a purely rtl design. I am having issues setting up the audio codex via i2c. I am wondering about how you should send the address information to the audio codex to initialize the setup registers. Below is an RTL state machine of how I am trying to write the register values to the codex. Can someone verify that this is the correct way to address the registers? I am unable to get anything out from the audio codex currently, and I don't think my initialization is working.
always @(*) begin next_state = IDLE; address = 7'h0F; data = 8'hFF; case(state) IDLE: begin start = 0; address = 7'h0F; data = 8'hFF; next_state = (setup_audio_codex) ? WR_POWER_MGNT : IDLE; end WR_POWER_MGNT: begin start = (busy) ? 0 : 1; address = 7'h06; //power management data = 8'b00000111; //PWROFF,CLKOUT,OSC,OUT,DAC,ADC,MIC,LINEIN next_state = (ready) ? WR_DIG_AUDIO_IF : WR_POWER_MGNT; end WR_DIG_AUDIO_IF: begin start = (busy) ? 0 : 1; address = 7'h07; //digital audio I/F data = 8'b00000010; //BCLKINV,MS,LRSWAP,LRP,WL,FORMAT next_state = (ready) ? WR_DIG_AUDIO_PATH : WR_DIG_AUDIO_IF; end WR_DIG_AUDIO_PATH: begin start = (busy) ? 0 : 1; address = 7'h05; //digital audio path data = 8'b00000000; //HPOR,DACMU,DEEMPH,ADCHPF next_state = (ready) ? WR_ANA_AUDIO_PATH : WR_DIG_AUDIO_PATH; end WR_ANA_AUDIO_PATH: begin start = (busy) ? 0 : 1; address = 7'h04; //analog audio path data = 8'h00010010; //SIDETONE_ATT,SIDETONE_EN,DACSEL,BYPASS,INSEL,MUTEMIC,MICBOOST next_state = (ready) ? IDLE : WR_ANA_AUDIO_PATH; end endcase end
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.