John said:
30hz ?? why so slow ?? I run PWM at 10-100khz or better for my servo
motor controller -- no flicker here !! (hardware PWM generator -- not
software !!)
That's why I told him NOT to use a rate that low. ;-) I don't think
hardware PWM would be a big help here, but maybe I'm missing something.
When using these things, it seems like one always has to keep thinking
outside the box, that's what I love about them.
And why add shift registers when you can direct drive or multiplex
and save the chips and the code needed to drive them ?? (direct drive
To learn how to use them, and to save on pin count. My way only needs three
I/O pins.
needs no external components except limit resistors, and multiplex
takes 3 transistors.. one for each color bank... too simple !!)
True, if you have a ton of spare pins.
Your eyes are incredibly more sensitive to green than they are to
blue and red -- found that out when I was researching color balancing
for RGB laser show systems.
That's true, but I think that 14,000mcd plays a part too. ;-)
all 3 banks act identically as a 0-10 level meter when a given bank is
enabled.. when a sufficiently strong pulse of sound is detected, then
the meter function switches to the next color bank -- this makes the
I'll have to take your word for it, he was a bit vague on this for my
comfort level.
multiplex idea especially attractive since it seperates color
selection from level meter code, and enables the level meter code to
work correctly no matter what color is currently selected. the level
meter code will not have to be aware at all of the current color
selection. (with the direct drive, the level meter code would have to
use a different set of I/O pins for each color.. with shift registers
-- well thats just getting overly complicated for something like this)
And using FFT and a DSP isn't overly complicating the problem? As I see it,
the "level meter code" has one purpose in life, and that is to return the
level of the signal (I assume by using an R/C low pass operation to average
the incoming signal and then using an ADC to read the average level). It
should have no idea what happens to the information after that, much less a
notion of banks of LEDs.
The main level code that called the "level meter code" should make the
determination of which bank to select based upon the returned value. I
would then have seperate code that had no purpose in life other than to turn
on the LEDs that it was commanded to do so. I would use an 8 pin PIC, some
op-amps to process the audio, and four shift registers to drive the LEDs for
about $5 not counting the LEDs. But that's me and the way I see it.
hehehe the same algorhithms will work on a PIC or an AVR... I program
Not written in assembler they won't. And translating would not be a piece
of cake. I only do assembler on the PIC, no C. I have done C on 8051 and
it's alright, but most things I tinker with don't require tons of code so
assembler is ok. It would be nice to have readily available math routines
sometimes though.
I've been thinking about tinkering with some of the
neato ARM thingys available now, I would likely use C on those.
both so it doesnt matter to me except that I prefer the AVR for its
features, and the free C compiler !! I got burned out on assembly
programming YEARS ago doing 8047 and 8051 microcontrollers, with a
dash of Z80 and 80186 on the side (and to think.. the PC had only
been around a coupla years at that point !!)
My first "personal computer" was a COSMAC ELF I built in 78, and it still
works believe it or not, all 256 bytes of it. ;-) The first PC I saw was
when I was a youngster in the military, I saw IBM PCs running CPM from
external 8" floppy drives. Seems that M$ was late delivering DOS 1.0 and
IBM couldn't let the hardware sit, so they delivered them without an OS.
Some enterprising individuals figured out how to make use of them until DOS
came out. You should have seen the documentation that came with each
machine, amazing. Back then I even saw the original idea that apple later
ripped off to make the MAC, the XEROX Star. Multiplexing is OK, but as soon
as the OP changes his mind about only one bank being on, it's all over. Use
the shift registers. ;-)