TDA7313 audio processor has been used for more than ten years in the industry because of its simplicity, functionality, and proper parameters like low distortion, and 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 allow multiplexing three incoming sound sources. It has volume control with steps of 1.25dB, Treble and BASS control, Loudness function. Each of the four outputs has a distinct control that allows balancing outputs. A chip can be controlled via I2C (TWI) interface.
Description of Audio processor
The idea of this project was to construct an independent audio processor which can be embedded in any sound system with the 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.
Firmware writing is always the most interesting and time-consuming task. The idea was to implement a menu system that allows controlling all parameters of the 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 the parameter is expressed as a 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 are for the change parameter value. Hold [+] or [-] button for a longer time and parameter is increased continuously. [Mute] button is used to mute signal when the active menu is Volume and set Loudness when the active menu is Input gain. Mute and Loudness settings are indicated in the Volume menu as MT and LD strings.
There you can download menu simulation Proteus files (menusimulation.zip). The archive includes Proteus_LCD.DSN file (tested with Proteus 7.1 SP2) and main.hex file that has to be loaded into the model.
The system stores current parameters in Atmega8 internal EEPROM, so each time the Audio processor is powered, it remembers last settings. Parameters are saved to EEPROM after <60 s of previous menu inactivity.
Watch video of menu control:
Fully functioning compiled firmware, WinAVR ready source files, and Eagle project files can be downloaded here (audioproc.zip). If the circuit assembled correctly, it should work at once.
Hardware and software seem to be working OK. Signal output was inspected with an 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 line for any other sound 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.
The project itself is effortless to replicate. Just build PCB and flash Firmware.hex.
If you need a smaller board, then you should think of double sided PCB.
The 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.