Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1203 Discussions

Assembly or C program that produce an output tone on speaker NIOS II.

Altera_Forum
Honored Contributor II
1,367 Views

All i want to do is produce and output tone to the speaker.  

 

My university has a sample code  

 

http://www-ug.eecg.toronto.edu/msl/nios_devices/dev_audio.html 

 

 

However for some reason the code is broken and outputs a scrambled noise from the speaker. I attempted to modify this code to output a single however it obviously doesn't work, same scrambled noise.Can someone explain why this code is broken so I can fix tone output code, or explain how to output a tone to the speaker?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
394 Views

I want to produce a tone output on the speakers 

 

Assembly Example: Echo program - connects mic to speakers, polling .equ ADDR_AUDIODACFIFO, 0x10003040 main: movia r2,ADDR_AUDIODACFIFO ldwio r3,4(r2) /* Read fifospace register */ andi r3,r3,0xff /* Extract# of samples in Input Right Channel FIFO */ beq r3,r0,main /* If no samples in FIFO, go back to start */ ldwio r3,8(r2) stwio r3,8(r2) /* Echo to left channel */ ldwio r3,12(r2) stwio r3,12(r2) /* Echo to right channel */ br main  

 

This code was provided by my university website(http://www-ug.eecg.toronto.edu/msl/nios_devices/dev_audio.html), however its broken and the output is scrambled noise nothing is right. How can I output to the speaker a single tone?
0 Kudos
Reply