Offline
Jr. Member
Karma: 1
Posts: 67
|
 |
« on: January 12, 2013, 09:13:08 pm » |
I'm making an audio control system (with LCD display) to use with a LM1036, using the arduino and a set of pushbuttons to adjust the volume, bass, and treble inputs on the 1036, instead of the recommended pots biased off of the on board zener voltage. Since analogwrite is a PWM function, I'm assuming it won't work to control the IC. In that case, what would be the correct function to use, or is this even possible?
|
|
|
|
|
Logged
|
|
|
|
|
Brisbane, Australia
Offline
God Member
Karma: 17
Posts: 812
|
 |
« Reply #1 on: January 12, 2013, 09:25:37 pm » |
Hi The arduino can drive a digital potentiometer if PWM doesn't do what you need. These are typically interfaced via SPI. Jeremy Blum has a tutorial on using one here: here. Cheers! Geoff
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 1
Posts: 67
|
 |
« Reply #2 on: January 12, 2013, 09:34:40 pm » |
I could do it with a digipot, but I'd prefer to keep external component count at a minimum, I thought this would have been possible within the arduino.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #3 on: January 12, 2013, 09:35:58 pm » |
I'm assuming it won't work to control the IC. When you pass a pwm signal through a low-pass filter, what do you get?
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6359
-
|
 |
« Reply #4 on: January 12, 2013, 10:30:32 pm » |
Given that these are controls for an audio system I guess that you will want a nice steady constant value so applying a low pass filter to a PWM stream may not be acceptable.
Depending what sort of resolution you wanted, you might get away with a small R-2R network controlled by the Arduino as a crude low resolution DAC.
I'm not sure what your objection is to using an external DAC, but the Due does have an onboard DAC - is that an option?
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #5 on: January 12, 2013, 10:38:09 pm » |
"Four control inputs provide control of the bass, treble, bal- ance and volume functions through application of DC volt- ages from a remote control system or, alternatively, from four potentiometers which may be biased from a zener regulated supply provided on the circuit. "
Yes, it will work if you apply PWM from arduino pin to associated input. The only things, PWM should be careffuly filtered out, otherwise you will get undesirable amplitude modulation. Trick is , you can't use default PWM settings, with 500 Hz and filter depth 80 dB it would take minutes till new settings come through (RC 1-st or 2-nd order). You will have to write directly to TIMER control registers , in order to move PWM freq. at least up to 16 kHz. I had a project, DIY FM Radio , where I had same issue. Look at the link below, you can download an arduino sketch and copy / pate Timer1 settings (10-bit Fast PWM).
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 1
Posts: 67
|
 |
« Reply #6 on: January 12, 2013, 11:21:09 pm » |
What do you mean by filtering out the PWM?
|
|
|
|
|
Logged
|
|
|
|
|
Montreal
Offline
Edison Member
Karma: 16
Posts: 2209
Per aspera ad astra.
|
 |
« Reply #7 on: January 12, 2013, 11:46:09 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Jr. Member
Karma: 1
Posts: 67
|
 |
« Reply #8 on: January 13, 2013, 07:01:14 pm » |
Thanks, I'll keep a low pass filter in mind next time I order stuff. In the meantime, I'm going to try it with just the PWM, and see what happens, then try with a capacitor inline, and see if that smooths it out. If neither of those work I'll just go with pots and read the values off of the pots and display the mapped values. Thanks for the help guys.
|
|
|
|
|
Logged
|
|
|
|
|
|