I didn't think about the reset port, this would limit the 8 pin chips to 5 IO lines. I want to avoid HV programming if possible - an STK500 board costs about 220$ here in switzerland, or 80$ + 35$ shipping + ??$ customs from digikey.
Olimex has an ISP programmer for a mere 9.95$. Another option would be this: http://elm-chan.org/works/avrx/avrxp8.png.
Yes, the ATtiny24/44/84 looks good - but I can't find a place where I could buy it (and remember, 35$ shipping fee from digikey...). Guess it's either attiny45 or attiny26 for me - the first can most likely also be substituted by a n attiny25, the second should be compatible with the upcoming attiny261 (26 is 'not recommended for new designs', but not yet marked as 'obsolete'. looks like full scale production for 261 is just starting)
So, how to use the pins?
3 Vcc, GND, Reset
2 ADC inputs
1 LED indicator
1 power on sense
1 relay trigger (we don't really need to adress the two relays separately)
This gives 8 pins. The power on sense could be replaced by a trimpot if the chip is powered by the same power supply as the amp.
With a 14 or 20 pin uC, there would be the additional possibility for:
2 io for pushbutton on/off
1 for trimpot
1 for serial out (not for debugging the code, but more for seeing the actual values the ADC generates. in the 8pin version, they could also be stored in the eeprom and then read out by the programming adapter)
2 additional LEDs, or 3 without serial out
or maybe not - connect it to the normal power supply, and use a transistor to turn on the following amp circuit. I also don't know if a power-sense port is really needed - if the protecting circuit is on the same psu it's not needed, and if the pushbutton function is used it's also not needed. It would be needed if you want to install it into an existing amp with minimal changes necessary (just hook the power-sense line anywhere where there's power if amp is turned on)
But I think people get confused if there are 15 different versions of a design of which they have to choose one. So an all-in-one solution, which would also be reusable in another amp without having to reprogram it would be the best thing in my oppinion. And I think that you can cram all of this on a double sided 1x1 inch board - even with a 20 pin soic (which are wider than 8 and 14 pin soic). With a 14/20 pin uC you can also have a start-up time trimpot. Pretty much first thing that happened to AMBs circuit was that someone modded startup time to 30s.
ok let's quickly forget about the attenuator idea for now 
Yes, but I pretty much did until now
. The circuit, how I described it in my posting above, would only work for positive DC currents... it would work for negative voltages if you refer the inverting input of the opamp to a negative voltage source. But where to get this negative voltage source? either 'borrowing' from the power supply, or using a voltage inverter to create it from the +5V supply. but then you'd loose the ability to apply any gain - it would overload the ADC. (the output would basically be DC offset +5v). Another idea: something like a rectifier bridge - but this would have a voltage drop, not a good idea if you measure in the mV range. Anybody got an idea how to solve this?
Olimex has an ISP programmer for a mere 9.95$. Another option would be this: http://elm-chan.org/works/avrx/avrxp8.png.
Yes, the ATtiny24/44/84 looks good - but I can't find a place where I could buy it (and remember, 35$ shipping fee from digikey...). Guess it's either attiny45 or attiny26 for me - the first can most likely also be substituted by a n attiny25, the second should be compatible with the upcoming attiny261 (26 is 'not recommended for new designs', but not yet marked as 'obsolete'. looks like full scale production for 261 is just starting)
So, how to use the pins?
3 Vcc, GND, Reset
2 ADC inputs
1 LED indicator
1 power on sense
1 relay trigger (we don't really need to adress the two relays separately)
This gives 8 pins. The power on sense could be replaced by a trimpot if the chip is powered by the same power supply as the amp.
With a 14 or 20 pin uC, there would be the additional possibility for:
2 io for pushbutton on/off
1 for trimpot
1 for serial out (not for debugging the code, but more for seeing the actual values the ADC generates. in the 8pin version, they could also be stored in the eeprom and then read out by the programming adapter)
2 additional LEDs, or 3 without serial out
Quote:
| I like the amp power control idea though, and that means you need more pins (or no LED output), it solves both the power-on delay issue and the power-off muting - but does require an extra standby power supply for the uC. |
But I think people get confused if there are 15 different versions of a design of which they have to choose one. So an all-in-one solution, which would also be reusable in another amp without having to reprogram it would be the best thing in my oppinion. And I think that you can cram all of this on a double sided 1x1 inch board - even with a 20 pin soic (which are wider than 8 and 14 pin soic). With a 14/20 pin uC you can also have a start-up time trimpot. Pretty much first thing that happened to AMBs circuit was that someone modded startup time to 30s.
Quote:
| Well, currently you're only attached to the amp outputs...different problem entirely I would say... |

Quote:
| but you can't ignore negative offsets |
. The circuit, how I described it in my posting above, would only work for positive DC currents... it would work for negative voltages if you refer the inverting input of the opamp to a negative voltage source. But where to get this negative voltage source? either 'borrowing' from the power supply, or using a voltage inverter to create it from the +5V supply. but then you'd loose the ability to apply any gain - it would overload the ADC. (the output would basically be DC offset +5v). Another idea: something like a rectifier bridge - but this would have a voltage drop, not a good idea if you measure in the mV range. Anybody got an idea how to solve this?




















