Docsity

Musical Tones Generation using Atlys Board and LM4550 Audio Codec, Exercises of Computer science

Toggle sidebar
bg1
Lab๎˜9๎˜ƒ
(Musical๎˜ƒnotes๎˜ƒgeneration)๎˜ƒ
๎˜ƒ๎˜ƒ
Introduction๎˜ƒ
The Atlys board includes a National Semiconductor LM4550 AC โ€˜97 audio codec (IC3) with๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ
four 1/8โ€ audio jacks for line๎˜out (J5), headphone๎˜out (J7), line๎˜in (J4), and microphone๎˜in๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ
(J6). Audio data at up to 18 bits and 48KHz sampling is supported, and the audio in (record)๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ
and audio out (playback) sampling rates can be different. Following signals represent the๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ ๎˜ƒ
interface๎˜ƒsignals๎˜ƒto๎˜ƒAC๎˜ƒโ€˜97๎˜ƒaudio๎˜ƒcodec๎˜ƒto๎˜ƒFPGA๎˜ƒas๎˜ƒshown๎˜ƒin๎˜ƒfigure๎˜1.๎˜ƒ
๎˜ƒ
๎˜ƒ
๎˜ƒ๎˜ƒ
๎˜ƒ ๎˜ƒ
Figure๎˜ƒ1๎˜ƒInterface๎˜ƒbetween๎˜ƒaudio๎˜ƒcodec๎˜ƒand๎˜ƒFPGA๎˜ƒ
๎˜ƒ
๎˜ƒ
pf3

Partial preview of the text

Download Musical Tones Generation using Atlys Board and LM4550 Audio Codec and more Exercises Computer science in PDF only on Docsity!

Lab 9

(Musical notes generation)

Introduction The Atlys board includes a National Semiconductor LM4550 AC โ€˜97 audio codec (IC3) with four 1/8โ€ audio jacks for line out (J5), headphone out (J7), line in (J4), and microphone in (J6). Audio data at up to 18 bits and 48KHz sampling is supported, and the audio in (record) and audio out (playback) sampling rates can be different. Following signals represent the interface signals to AC โ€˜97 audio codec to FPGA as shown in figure 1.

Figure 1 Interface between audio codec and FPGA

Sample Code Overview Figure 2 shows the main components and their interface in the sample code

Figure 2 Main components in sample code and their interface

In the sample code, we have considered sample rate at 48khz. Sample code has only one component inside the tone generator module which generate tone at 750Hz. Tone750Hz module has 64 (48khz/750) samples of 20 bit Pulse coded modulation (PCM) data. 64 samples are taken by sampling one complete cycle of sine wave of frequency 750Hz at periodic interval.

How it works? (Simple Overview) When you press key on the board assigned for tone generation, it will take the PCM data stored in the Tone750Hz module and pass it to the Ac97 codec interface module. Interface module forwards this data to codec h/w present on board. Codec convert this digital data into analog data using ADC (analog to digital converter). After converting to analog data codec output this data to the Line out.

Table 1 Tone and frequency Tone1 523.251 Hz Tone2 587.33 Hz Tone3 659.255 Hz Tone4 698.456 Hz Tone5 783.991 Hz Tone6 880 Hz Tone7 987.767 Hz

Things to be done in lab In this lab you need to replace tone750Hz module with 7 different modules (tone1, tone2,โ€ฆ,tone7) where frequency of each tone is given in the table 1. We have provided you PCM data in Hex format for each frequency use it to create 7 tone modules similar to tone750Hz module. You will have 7 keys (push button/up down) as input, where each key is assigned for a different tone. Each key input is passed through a debouncer module and