[sdiy] newbie question Can a simple PIC16F628A be used as an audio filter trigger like a light organ

rsdio at audiobanshee.com rsdio at audiobanshee.com
Wed Feb 24 22:47:50 CET 2016


Hi Tom,

I just double-checked the PIC16F628A data sheet, and this chip does not have an on-board ADC.

Other than that, your comments seem like they'd be a fine starting point for experimentation.

Brian


On Feb 24, 2016, at 1:23 AM, Tom Wiltshire <tom at electricdruid.net> wrote:
> I reckon it's possible. It's not at all easy, but it's possible. To get such a thing into a simple chip like that is going to need seriously tweaked code, or (equivalently) a seriously tweaked programmer. I'd seriously doubt it can be done in PICBasic. I'm impressed if you can pull that off.
> 
> You'd have to sample the audio with the on-board ADC, say 20-25KHz, 8-bit. Then you need some broad-brush frequency detection. We're not looking for amplitude envelope information, merely presence/absence of signals within a band, so that simplifies things a bit. This is a light organ, not a spectrum analyser.
> 
> I'd be looking at IIR filter algorithms based on bit shifts, since we've got no multiply. A LP/HP pair of filters would give you your band detection. Since you can do a HP as 1-LP, you could use the lower filter for the next band up as the upper filter for the band below and save yourself some more calculation. That reduces a 4-band detector to only four filters to work out.
> 
> Once you've got signals in the various bands, I'd rectify the signal and do some simple threshold detection to trigger the outputs. Something like "If the highest bit of the byte is set, trigger the output". Furthermore, to stop the outputs oscillating at the audio rate, you'd need to trigger an output for a few milliseconds minimum time - use a monostable for the output, effectively.
> 
> HTH,
> Tom
> 
> On 24 Feb 2016, at 05:33, Rob <roomberg at ptd.net> wrote:
>> I'm an electronic hobbyist. Nothing professional.... just playing here.
>> The goal is to feed MP3 music to a light trigger circuit.
>> Something like a light organ.
>> But have a much finer granularity than a light organ that has low, mid and highs separation.
>> I have PIC16F628A chips and PicBasicPro so I was thinking of using PULSIN to look for audio tones... real high stuff... around 6kHz ,7kHz and 8kHz.
>> 
>> I had been building audio band bass filters with op-amps when it occurred to me that PicBasic WILL listen for tones and assign a value to a variable. But I had not seen anything that resembled this circuit before.



More information about the Synth-diy mailing list