aboutsummaryrefslogtreecommitdiffstats
path: root/sound.v
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@trantor.hos.anvin.org>2008-12-30 16:14:34 -0800
committerH. Peter Anvin <hpa@trantor.hos.anvin.org>2008-12-30 16:14:34 -0800
commitfa7694a568081acd2f6284ea213e0bd78502b9d9 (patch)
treec1cca6bc5ab99667c9860c4f2e67350a8968bf70 /sound.v
parent060c89ac28498ca76b2308970d06273c6caa1c73 (diff)
downloadabc80-fa7694a568081acd2f6284ea213e0bd78502b9d9.tar.gz
abc80-fa7694a568081acd2f6284ea213e0bd78502b9d9.tar.xz
abc80-fa7694a568081acd2f6284ea213e0bd78502b9d9.zip
Fix audio DAC programmingabc80-de1-13
Quite a few of the sound DAC register settings were just plain wrong. Fix them.
Diffstat (limited to 'sound.v')
-rw-r--r--sound.v8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound.v b/sound.v
index 887ff08..056d082 100644
--- a/sound.v
+++ b/sound.v
@@ -320,11 +320,15 @@ module sound_i2s(
if (stb_16us)
sample <= magnitude;
+ // We load serial_out after clock 1, which means each frame has two
+ // zero padding bits at the front. Bit 0 is required by I2S standard
+ // format, and bit 1 means our unsigned output is always in the positive
+ // half of the signed number space.
always @(posedge i2s_clk)
- if (ctr[6:0] == 7'h00)
+ if (ctr[6:0] == 7'h01)
serial_out <= sample;
else
- serial_out <= { serial_out[12:0], 1'b0 };
+ serial_out <= { serial_out[13:0], 1'b0 };
sound_generator sound_generator (
.clk (i2s_clk),