My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
SoundCodec  
Sound codec on DE1 (WM8731)
Phase-Implementation, Featured
Updated Feb 4, 2010 by svof...@gmail.com

Modules

Connections and principle of operation

soundcodec.v has very simple interface.

clk18in118MHz master clock for the codec
pulsesin41-bit sound streams, they're sampled into clk18 clock domain
pcmin88-bit mono PCM stream from AY
tapeinout11-bit tape input, passed through adaptive threshold
reset_nin1reset
oAUD_XCKout1connect to AUD_XCK
oAUD_BCKout1audio bit clock
oAUD_DATAout1audio data
oAUD_LRCKout1audio L/R clock
iAUD_ADCDATin1ADCdata in
oAUD_ADCLRCKout1ADC L/R clock

NB1: AUD_XCK must be assigned same clock as clk18, probably in the top level: see associated issue;

NB2: 12MHz (256fs) clock can be used instead of 18MHz clock (384fs)

Pulses is a 4-bit wide bus. Bits 0..2 are ought to be the connected to outputs of 8253 PIT sound generator. Bit 3 is ought to be tape output. Music bits are passed through a simple moving average filter; tape out bit is unfiltered.

The other module that has to be explicitly instantiated is I2C_AV_Config. It comes from the DE1 samples, although the configuration bits are changed: line input is enabled and signal passthrough is disabled. The connections are self-explanatory.

After reset is reasserted high, I2C_AV_Config sends configuration to the codec chip and soundcodec.v starts data exchange through audio_io.v. Line input is passed through an adaptive threshold to make loading from "tape" easier. "Music" outputs are filtered through a very simple moving averager. Parameters of adaptive thresholder and averager are found experimentally.

8253 Programmable Interrupt Timer

Original Vector-06C used a 8253 chip to generate 3-channel audio. 8253.v is (an ineffective) behavioral description of 8253 PIT based on Intel datasheet. I didn't bother myself with redesigning the whole thing, this module just mimics what's enough for fair sound reproduction. Modes that can be useful for sound are faithful to the original though. Modes 1 and 5 are not implemented at all, GATE inputs are not used.


Sign in to add a comment
Powered by Google Project Hosting