Logo Katedry
Strona główna
Katedra Systemów Mikroelektronicznych, Wydział Elektroniki, Telekomunikacji i Informatyki, Politechnika Gdańska Logo Wydziału
English English version

DTMF - konfiguracja i komunikacja z modułem AC97_top

W module AC97_top osadzone są dwa komponenty: AC97_core oraz AC97_command_rom.

Schemat blokowy szkieletu modułu AC97
Rys. 1 Schemat blokowy modułu obsługującego LM4550



Moduł AC97_core w początkowej fazie działania wykonuje zapis do rejestrów konfiguracyjnych kodeka LM4550. W rejestrach konfiguracyjnych ustawia się najważniejsze parametry pracy kodeka np. wzmocnienie w kanale Mic In, częstotliwość próbkowania - znaczenie poszczególnych bitów rejestrów konfiguracyjnych kodeka zostały opisana w Tab.1 oraz Tab.2, a także w dokumentacji LM4550.
Komunikacja z kodekiem LM4550 odbywa się za pomocą 4 linii AC97_Sync_o, AC97_SData_o, AC97_Sdata_i, AC97_Resetn_o synchronizowanych zegarem AC97_clk_i.
Po zapisaniu konfiguracji do rejestrów układu LM4550, moduł AC97_core rozpoczyna proces odczytu napięcia z wejścia Mic In oraz zapisu nowych wartości napięcia na wyjściu Line Out. Czas pomiędzy kolejnymi zmianami określony jest przez parametr czasu próbkowania (dla fs=8 kHz wynosi on Ts=1/8k s=125 us). Dodatkowo z czasem Ts na linii PCM_New_Sample pojawia się przez jeden cykl zegara clk_i stan wysoki, oznaczający pobranie i zapisanie nowych wartości przez moduł AC97_core.
Moduł AC97_core jest w pełni funkcjonalny komponentem i nie ma potrzeby wprowadzania jakichkolwiek modyfikacji.

Komunikacja modułu AC97_top z kodekiem LM4550 w
                       standardzie AC97
Rys. 2 Komunikacja modułu AC97_top z kodekiem LM4550 w standardzie AC97




Komponent AC97_command_rom zawiera pamięć ROM z 24-bitowymi słowami konfiguracji kodeka. 24-bitowe słowa konfiguracji (adres+dana) są kolejno pobierane z pamięci AC97_command_rom przez komponent AC97_core i zapisywane do rejestrów kodeka LM4550.
W Tab.1 przedstawiono początkowe parametry 24-bitowych słów zapisanych w AC97_command_rom:

Tab. 1. Konfiguracja kodeka LM4550 zapisana w pamięci moduł AC97_command_rom.vhd
Adres
rejestru
Wartość
Znaczenie
Opis rejestru
0x00
0x0000
Reset kodeka LM4550
Writing any value to this register causes a Register Reset which changes all registers back to their default values. If a read is performed on this register, the LM4550 will return a value of 0D50h.
This value can be interpreted in accordance with the AC'97 specification to indicate that National 3D Sound is implemented, 18-bit data is supported for both the ADCs and DACs, and that headphone output is supported.
0x02
0x04
0x0000
Wzmocnienie kanału Line Out/Amp Out
LCH -> 0dB
RCH -> 0dB
This output register allows the output level from either channel of the stereo LINE_OUT to be muted or attenuated over
the range 0 dB - 46.5 dB in nominal 1.5 dB steps.
There are 5 bits of volume control for each channel and both stereo channels can be individually attenuated.
The mute bit (D15) acts simultaneously on both stereo channels of LINE_OUT.
0x0E
0x0040
Wzmocnienie bezpośredniego
przejścia Mic In -> Line Out
(12dB+20dB)
These input registers adjust the volume levels into the stereo mixers MIX1 and MIX2. Each channel may be adjusted over a range of +12dB gain to 34.5dB attenuation in 1.5dB steps. For stereo ports, volumes of the left and right channels can be independently adjusted. Muting a given port is accomplished by setting the MSB to 1. Setting the MSB to 1 for stereo ports mutes both the left and right channels. The Mic Volume register (0Eh) controls an additional 20dB boost for the selected microphone input by setting the 20dB bit (bit D6).
0x18
0x0808
Wzmocnienie próbek PCM -> Line Out
(0dB)
These input registers adjust the volume levels into the stereo mixers MIX1 and MIX2. Each channel may be adjusted over a range of +12dB gain to 34.5dB attenuation in 1.5dB steps. For stereo ports, volumes of the left and right channels can be independently adjusted. Muting a given port is accomplished by setting the MSB to 1. Setting the MSB to 1 for stereo ports mutes both the left and right channels.
0x1A
0x0000
Wybór źródła sygnału wejsciowego
dla przetworników ADC
This register independently controls the sources for the right and left channels of the stereo ADC. The default value of 0000h corresponds to selecting the (mono) Mic input for both channels.
0x1C
0x0F0F
Wzmocnienie rejestru nagrywania
22.5dB
This register controls the input levels for both channels of the stereo ADC. The inputs come from the Record Select Mux and are selected via the Record Select Control register, 1Ah. The gain of each channel can be individually programmed from 0dB to +22.5dB in 1.5dB steps. Both channels can also be muted by setting the MSB to 1.
0x2A
0x0001
Odblokowanie zmiany
częstotliwości próbkowania
This read/write register provides status and control of the variable sample rate capabilities in the LM4550. Setting the LSB of this register to "1" enables Variable Rate Audio (VRA) mode and allows DAC and ADC sample rates to be programmed via registers 2Ch and 32h respectively.
0x2C
0x32
0x0001
Zmiany częstotliwości próbkowania
These read/write registers are used to set the sample rate for the left and right channels of the DAC (PCM DAC Rate, 2Ch) and the ADC (PCM ADC Rate, 32h). When Variable Rate Audio is enabled via bit 0 of the Extended Audio Control/Status register (2Ah), the sample rates can be programmed, in 1 Hz increments, to be any value from 4 kHz to 48 kHz. The value required is the hexadecimal representation of the desired sample rate, e.g. 800010 = 1F40h.


Nie zaleca się dokonywania zmian w konfiguracji kodeka LM4550 (konfiguracja zapisana domyślnie w module AC97_command_rom pozwala na zrealizowanie zadania nadajnika/odbiornika DTMF).

Symulacja: Plik ac97_model.vhd. zawiera model kodeka LM4550. W pliku top_tb.vhd, podłączono odpowiednie linie modelu do linii własnego modułu (np. DTMF_AC97_top.vhd - AC97_Sync_o, AC97_SData_o, AC97_Sdata_i, AC97_Resetn_o, AC97_clk_i). W modelu zasymulowano zwarcie wyjścia z wejściem (próbki z Line Out przekazywane są na Mic In). W celu wygenerowania własnego pobudzenia, należy zmodyfikować proces z lini 297 pliku ac97_model.vhd.

Informacje Dodatkowe:

Schemat blokowy szkieletu modułu AC97
Rys. 3 Schemat blokowy modułu LM4550



Schemat blokowy szkieletu modułu AC97
Tab. 2 Tabela z opisem rejestrów kodeka LM4550.