Jeff, Given the cost and complexity of putting multiple stepped attenuators in series, for something like simple MDS measurements I would use just one step attenuator and add fixed attenuators to the 0-31.5 dB range. If you do insist on multiple programmable attenuators, build separate stand alone attenuators and connect them in series as needed; micro-controllers are relatively cheap.
The simplest way to program one of these attenuators is to use a parallel version with six hard-wired toggle switches and a single "latch" push button switch. You would have to debounce the latch button with a schmidt trigger or simple RC circuit. Just set the BCD switches and hit the latch button. To program the attenuator with a micro-controller, the 3-wire (data, clock, latch) serial protocol is rather simple. It would be pretty easy to use a small micro-controller with on-chip UART to bit-bang program the attenuator. I would prefer the serial version over the parallel when using a micro-controller. To interface your BCD thumb-wheel switches You could use one or more micro-controllers with a lot of GPIO pins; but I would likely use a small micro like an ATtiny85 and interface the switches via serial I2C bus parallel I/O expanders (parallel to serial shift registers via the two-wire I2C serial bus protocol). A different approach would be to use three LED's and put push button switches above and below each of them to increment or decrement the digit. Three seven segment LED's will multiplex nicely, so with one hard wired decimal point they would use 10 GPIO pins. The switches use 6 GPIO pins. The attenuator serial interface uses 3 GPIO pins (data, clock, and latch). So a total 10+6+3=19 GPIO pins are used. The DIP ATMega168/328 with two dedicated external crystal pins and one dedicated reset pin has has 19 GPIO pins free. Whew - exactly the number needed! Remember to pick your GPIO pins carefully to allow six pin ISP programming or use a header to enable/disable the ISP pins. Icing on the cake would be to make the serial pins dual purpose and add a serial boot-loader. With a hardware serial/RS-232 level converter (e.g. Maxim MAX232) this would allow the firmware to be field updated without a dedicated AVR programmer. As this is not a product for mass production, with the LED approach I would likely move to a 40 pin DIP micro as there are no GPIO pins left with the ATMega168/328. Have a look at the Parallax Propeller (www.parallax.com). The Propeller is now $8 in unit quantity and has a very easy to program interpreted SPIN language via the free prop-tool IDE. You don't have to deal with interrupts either, the propeller has eight processors or "cogs" which run in parallel with commutative shared I/O. There are lots of I/O pins and the cogs run at 80 MHz (assembler instructions are typically 4 clocks each). You will however need one $19 Prop-Plug USB programmer to program any number of propeller chips. Have a look at the rather inexpensive propeller proto-board as a ready to run hardware platform (less the Prop-Plug). Best 73's, David WB4ONA --- In [email protected], "Jeff Blaine AC0C" <keepwalking...@...> wrote: > > I have configured my SR v9 to serve dual duty. With the BPF, it provides > 160-10m RX service. > > And by tapping the Si570 LO and running that through a low pass filter array, > I have a variable frequency, stable amplitude signal source which is great > around the shack. > > Now I am looking at adding a stepped attenuator to the mix to provide a way > to precisely vary the output level. Mini circuits makes a 0-31db step > attenuator chip that takes a 5-bit BCD input. Add 2 more fixed attenuation > 32db pads and voila, you would have a 7-bit BCD input stepped attenuator that > would cover 0-95db with just one set of thumbwheel switches. Very cool! > > So off I went and purchased some surplus dual thumbwheel switches which > provide BCD output. Ready to go!!! > > Not so fast... Unfortunately, the BCD output is on a per digit basis - so > there is set of BCD bits that represent the "1's" place and another off the > 2nd switch that represent the "10's" place. And wow, the circuitry to > implement that conversion is not trivial... An eprom that would handle the > 10 bit (input) would do the job as a look-up device. But I don't have that > handy! > > So I got to thinking about how common the Ateml AVR chips are - and how a > larger one with enough IO could be configured to serve as a simple look-up > table. The ATmega168 or similar looks like it has enough I/O to do the job... > > I wondered if anyone on the SR board has done something similar. > > And if you are handy with the AVR - and would be interested in programming an > AVR for me with this function, please contact me off line with your terms. > > The versatility of the SR lives on - now as a test instrument! > > 73/jeff/ac0c >
