Tim said:
- snip -
If you use an IIR filter the system delay won't be much more than an
analog filter (the filter itself will be comparable, any excess will
just be from the acquisition and output sample time).
The ADC I had in mind is a sigma-delta type, the AD7711 or others of
it's ilk. It samples the input signal at up to 40kHz if I read the data
sheet correctly (more if I don't), so you don't need much anti-alias on
the input. If you can't stand the aliasing products on the output
you'll need anti-aliasing there, or you need to have a digital
reconstruction filter running on the uP, which will get you out of the
8051 class fairly quickly.
Unless you go to Cygnal, and buy the worlds most expensive 8051....
I worked on a project where they did a whole bunch of 24-bit DSP using a
25MHz single-cycle 8051 derivative beasty, that cost about $12 in volume
- I can easily buy a 32-bit whiteware DSP for less than that. The '51
derivative had stuff all ROM, so a large EEPROM was used for extra code
storage (oh god, virtual memory in an 8051, what a disaster - about 1/3
of the total code was for VM only) and it took years to get the code
reliable. Right at the outset I suggested more memory, but was assured
the larger memory parts were much more expensive. Turns out that we
could quadruple the memory for less than the price of the EEPROM, if we
leaned on the supplier a bit. oops, best not to think about the cost of
an extra 2 years code development (for a total of 16kb - not very cost
effective).
Reminds me of the programmer I once hired to develop code for a user
interface - 4x20 LDC, 5 buttons, 3 LEDs, a MODBUS interface (it was a
master). He was a smart guy, so I gave him the specs and let him rip
into it. A couple of weeks later he came and asked for more RAM - at
which point I got real concerned, the part had 2kb or so, which is
mountains! Then I found he had used 48kb of the 64kb flash to implement
a home-made (but very nice) fully multi-tasking RTOS. He wrote it all in
C, and was (automagically) using 32-bit ints as boolean flags - in an
8051, with all its bit-crunching power. No wonder he ate the RAM. I
expected it to take about 4kb of code, leaving 60kb for data. I re-wrote
the spec, explicitly specifying the data space in ROM (and RAM), and
Dave wrote a much, much, much better piece of code - about 2kb IIRC. His
previous project had been a laser printer, with 20Mb RAM, 32-bit cpu
etc, so he kinda got in the habit of gross overkill.
Cheers
Terry