TDA7313 audio processor have been used for more than ten years in the industry because of its simplicity, functionality and good parameters like low distortion, low noise. Chip is based on BIPOLAR/CMOS technology and can be used in various applications including car radios, Hi-FI, simple mixers.
TDA7313 chip has three external stereo inputs that allows multiplexing three incoming sound sources, volume control with steps of 1.25dB, Treble and BASS control, Loudness function, Each of four outputs has distinct control that allows balancing outputs. A chip can be controlled via I2C (TWI) interface.
The idea of this project was to construct independent audio processor which can be embedded in any audio system with ability to control settings with simple button interface with menu preview in LCD.
The intent was to cover all audio-processor functionality within the LCD menu.
Circuit and PCB
The circuit diagram is pretty the same as in datasheet plus Atmega8 control circuit.
Control board was projected in single-sided PCB board so it was easier and simpler to reproduce it.
Here is a prototype board with buttons and LCD connected.
Some mistakes found on board are already corrected and included in the newest project files.
The hardware part is the easiest one.
Firmware writing is always most interesting and time consuming task. The idea was to implement a menu system that allows to control all parameters of audio processor:
Volume [-78.75dB to 0dB] + Mute;
BASS [-14dB to 14dB];
Treble [-14dB to 14dB];
Channel select [Ch1, Ch2, Ch3];
Input Gain for selected channel [0dB to +11.25dB] +Loudness;
LF speaker attenuation [-38.75dB to 0dB];
RF speaker attenuation [-38.75dB to 0dB];
LR speaker attenuation [-38.75dB to 0dB];
RR speaker attenuation [-38.75dB to 0dB];
For this linear menu system was implemented where parameter is expressed as progress bar except channel select:
Control is done with specially oriented buttons:
[Up] and [Down] buttons are used to navigate in the menu, [+] and [â€“] buttons is for change parameter value. Hold [+] or [â€“] button for a longer time and parameter is increased continuously. [Mute] button is used to mute signal when active menu is Volume and set Loudness when active menu is Input gain. Mute and Loudness settings are indicated in Volume menu as MT and LD strings.
There you can download menu simulation Proteus files (menusimulation.zip). Archive includes Proteus_LCD.DSN file (tested with Proteus 7.1 SP2) and main.hex file that has to be loaded in to model.
System stores current parameters in Atmega8 internal EEPROM so each time Audio processor is powered it remembers last settings. Parameters are saved to EEPROM after <60 s of last menu inactivity.
Wach video of menu control:
Fully functioning compiled firmware, WinAVR ready source files and Eagle project files can be downloaded here (audioproc.zip). If circuit assembled correctly it should work at once.
Hardware and software seems to be working OK. Signal output was inspected with oscilloscope and with speakers. All functionality works as expected. Audio signal quality on exit depends on power supply stability, be sure to use filtered power supply like for any other audio system.
Don’t try to connect speakers or headphones to audio processor output – you won’t hear anything because output load resistance has to be 2k so pass through some amplifier if you want to hear sound while testing. I have used PC speakers with a built-in amp.
Project it self is very easy to replicate. Just build PCB and fun Firmware.hex.
If you need a smaller board, then you should think of double sided PCB.
Program source isn’t optimized very much – all based on if, else – I think there are many ways to make it more compact and more readable – but maybe next time. Feel free to modify project – send a note of your version.