vhdl - How to Get Audio Out via the Wolfson WM8731 CODEC on the Altera DE2-115 educational FPGA board? -
my group , trying create synthesizer out of de2-115 board our undergraduate capstone project.
the thing can't figure out how frequencies mapped "keys" outputted through audio port on board. we've scoured web , provided documentation included datasheets codec can't figure out how work in vhdl.
has ever worked outputting audio through wm8731 , if so, willing out?
i did years ago, wasn't hard, used nios processor sopc builder.
i used altera university program ip cores available here.
these cores provides different functionality related de2 , possibly other altera sponsered-board.
according logs, used 3 of these cores make audio work.
the altera_up_avalon_audio_and_video_config, used configure audio codec chip @ initialization.
the second ip provide data in/out interface audio chip: altera_up_avalon_audio.
the last 1 altera_up_avalon_clocks. can't remember does, name imply it's necessary clocking of audio chip. think takes input clock , generate pll provide right clock codec.
as said, used nios processor, still according log, c code used is:
void audio_isr(void* context, alt_u32 id) { const int len = 2682358; static signed char *ptr = test_snd; unsigned int x[128]; alt_up_audio_dev *audio_dev = (alt_up_audio_dev *)context; unsigned int n = alt_up_audio_write_fifo_space(audio_dev, alt_up_audio_right); for(unsigned int = 0; < n; i++) { x[i] = 0x800000 + ((int)*ptr++) << 9; if (ptr > test_snd+len) { ptr = test_snd; printf("done\n"); } } alt_up_audio_write_fifo(audio_dev, x, n, alt_up_audio_right); alt_up_audio_write_fifo(audio_dev, x, n, alt_up_audio_left); } static void audio_init(void) { alt_up_audio_dev *audio_dev = alt_up_audio_open_dev (audio_0_name); if ( audio_dev == null) printf ("error: not open audio device \n"); else printf ("opened audio device \n"); alt_up_audio_reset_audio_core(audio_dev); alt_up_audio_disable_write_interrupt(audio_dev); alt_up_audio_disable_read_interrupt(audio_dev); alt_irq_register(audio_0_irq, (void *)audio_dev, audio_isr); alt_up_audio_enable_write_interrupt(audio_dev); } i don't remember how worked. enough deserve commit, still test, don't give importance. final code way complicated present here.
hopefully, enough started on right track, use altera's ip. these ip clear-source afair, if don't want nios, should simpler start source scratch.
Comments
Post a Comment