AVR based TDA7313 Audio processor control
Introduction
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 3 external stereo inputs, that allows to multiplex three incoming sound sources, volume control with steps of 1.25dB, Treble and BASS control, Loudness function, Each of four outputs have distinct control that allows to balance outputs. Chip can be controlled via I2C (TWI) interface.
Description
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 LCD menu.
Circuit and PCB
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 newest project files.
Hardware part is the easiest one.
Firmware design
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.
Conclusion
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.
Dont try to connect speakers or headphones to audioprocessor output – you wont hear anything because output load resistance has to be 2kΩ so pass through some kind of amplifier if you want to hear sound while testing. I have used PC speakers with built in amp.
Recommendations
-
Project it self is very easy to replicate. Just build PCB and furn Firmware.hex.
-
If you need 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 is many ways to make it more compact and more readable – but maybe next time. Feel free to modify project – just send a note of your version.
Have fun.
Blogsphere: TechnoratiFeedsterBloglines
Bookmark: Del.icio.usSpurlFurlSimpyBlinkDigg
RSS feed for comments on this post | TrackBack URI for this post
New on WinAVR Tutorial
Running TX433 and RX433 RF modules with AVR microcontrollers,Sometimes in embedded design you may want to go wireless. Might be you will want to log various readi …Programming AVR ADC module with WinAVR,Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solut … |
New on WinARM Tutorial
What are differences between WinARM and WinAVR,Everyone who is working with AVR microcontrollers knows this powerful tool – WinAVR (http://win …LPC2000 watchdog timer,As in all microcontrollers watchdog timers purpose isto reset microcontroller after reasonable amount … |

August 26th, 2007 at 11:23 pm
[...] based TDA7313 Audio processor control - [Link] Filed in [...]
February 27th, 2008 at 9:17 am
[...] http://www.scienceprog.com/avr-based-tda7313-audio-processor-control/ [...]
February 27th, 2008 at 11:37 am
hey
i am a newbie for this site and iam wondering about ur projects, those are interesting nd wonderful projects. electronics is my hobby from my childhood
but still i am in begining stage about microcontroller , microprocessor and its programing.
i hav searched thrrought internet to get basic + step by step tutorial for how to program these chips
if u know any tutorial links plz let me know ? and also i hav seen ur project AVR based TDA7313 audio processor project its very wonderfull project but i need to make this circuit to control by a remote controller at while having buttun control too, so hav u done any project like this ? or how to modify this circuit to connect a remote control ? i need this circuit for my school project. will u favor plz give helpfull information and source codes for my school project. i will more thank ful to u , u can contact me (vigneshrajive at gmail . com)
March 26th, 2008 at 9:16 pm
TDA7313 Audio processor control with LCD display…
ScienceProg presents this AVR based TDA7313 Audio processor control with every detail you need to build it. The project makes use of the TDA7313 Audio processor because this processor is well established in the industry because of its simplicit, fun…
April 7th, 2008 at 8:12 am
I think it great for experimenter, but I still prefer use computer based audio processor. It give litte bit delay but I have a lot of free VST plugin for the effect.
May 5th, 2008 at 3:10 pm
gmmm i am having some issue gettng the i2c out with the firmware present here.. ( get a blank box withe i2c debugg tool in isis (proteus vsm))
why could some one answere it.. and the hex fill called TDA7313.hex is not respondng to key press