if i use a normal 9v square battery , how long can i run the atmega1284P on it with minimal components? the datasheet of this micro says 0.4mA only when active.
1) the 0.4mA Active Current is @ 1MHz clock, if you use higher clock speeds , you will use more power.
2) For using this with a simple 9V battery, you need a low Quiescent current regulator , not a normal one.
For Example : LM2936-5.0 (5V) , LT1521 Family (Fixed 5V, 3.3V , 3V versions or Adjustable Version ) or MAX16910 or LP2954 (Fixed 5V or Adjustable Version) and ......
1) for LT1521 only 1.5uF Capacitor in output is enough, but if you can use another 1uF in Regulator input.
2) According to Figure 27-2 (page 335) in atmega1284p Datasheet , with 3.3V power supply, it should be less than 6mA, but it also depends on your circuit and the sink/source loads on microcontroller pins.
also how can i measure the total current draw for a circuit ? i have a current meter in my multimeter and I once tried to measure the current by putting the multimeter in series on the positive rail but it blew up the micro controller together with other components on the board.
also how can i measure the total current draw for a circuit ? i have a current meter in my multimeter and I once tried to measure the current by putting the multimeter in series on the positive rail but it blew up the micro controller together with other components on the board.
doesn't matter but a good capacitor with low ESR is better. For your circuit simple polar capacitors are enough. BTW, if you currently have any polar capacitor with <10uf Capacitance (4.7uf, ... etc) you can use them and you don't need to buy new capacitors.
your connection of multimeter is correct, but multimeters have different current range, for example a multimeter may have 10A , 500mA , 100mA measurement ranges . Some cheap multimeters in their low range(100mA,...) may have a large series resistance that may cause a problem.
if you want to measure the current, connect the multimeter in current measurement mode (higher range , for example 500mA) in series after 9V battery and before the regulator (positive line). in this case regulator will protect your microcontroller. if you couldn't read the current accurately or it did show zero,goto one step lower on the multimeter and try again until you read the current with acceptable accuracy.
P.S : what is your multimeter model / part number?