If your cable is too long, ringing will stop it from working right. If the cable is shorter, it may work all of the time. If you are like me, and you make the cable from the programmer to the AVR just the right size, the ringing will sometimes stop the programmer from working, and sometimes not. For instance, my favorite AVR programmer works on every test board I have. When I built the ATmega128 board I had to mount the ISP connector on a carrier board, then run the wires to the SchmartBoard that held the MCU. That additional 1 or 2 inch length was enough to make the programmer intermittent. It would literally fail once and then work once. The only line that cares about transitions is the SCK line. Ringing on that line can make the AVR think it is getting two or more clock transitions instead of one. The design calls for 330 Ohm resistors in series with each lead, to cut down on ringing. I added an 11pF capacitor to ground on the output end of the 330 Ohm resistor, and the thing is 100% reliable with the ATmega128 board. Another board might require a larger capacitor, but don't get carried away. You can delay the clock to the point that it no longer falls in the bit time. The 330 Ohm / 11 pF combination puts a few nanoseconds of delay in the line, but really calms down the ringing.
From the Atmel site:
"One of the most important considerations is to ensure a defined level on all I/O pins. A floating pin
will give a significant increase in the overall power consumption."
There are hundreds of answers. Here are a few.
A very good, although slightly biased source of information is found on Michael Bluejay's battery page. You should check out the rest of the site, too. A source for batteries, if you can't find Radio Shack, is Batteries and Butter.
My own preference would be to stick to the batteries I can get at the Radio Shack when I need them in a hurry. And Ni-MH are both the best value for rechargeable, and the best for use without a voltage regulator. And you still need power supply and AREF bypass capacitors. Four cells get you around 4.8VDC, three will provide 3.6VDC. I've seen three cell holders at Mouser.
Hmm... I really like using the CUI V-Infinity EPS series power supply. They are around $8.00 at Digikey. I have many of them. All but one are EPS12050 12VDC @ 0.5A. The odd one is an EPS050100, 5VDC @ 1.0A. I wired up a board with a bunch of circuitry, several microcontrollers, and hooked it all up to use the 5V supply. I'm always plugging and unplugging things, so of course on one occasion I unplugged the 5V supply, but plugged in the 12V supply. It took me longer to realize why the LEDs were so bright than it did to cook 3 microcontrollers. I normally always put the power supply on the board first - the proper capacitors, a single blocking diode, and a 5V regulator. It costs about $2.00, and I can use one of the EPS 12V supplies with it. Every so often I like to take a refresher course in basic electronics like this. And it only cost me $20.00 for the first lesson. The problem is I keep taking the first lesson over and over.
So. The answer is yes. You can use a regulated wall wart directly, but either get rid of all of your 12VDC warts, or keep spare microcontrollers on hand. They are part of the supplies you'll need for your basic electronics class.
This question has come up a couple of times. I checked it out because it peaked my curiosity.
Yes. The ATtiny2313 SIRC project board uses 10.98mA when it is running, and only 6.31mA when it is held in reset (I soldered a wire between reset and ground). I have no reset pullup on the board - it uses the internal pullup - but it would in the real world, too, so the measurement is valid. Remember this is the total current required for the board, and there is a TFMS5400 in there with a normally high output connected to a high impedance input. The same high impedance the input presents during reset. The TFMS5400 is not affected by the state of the reset signal. What I was not equiped to determine was what, if anything, does having an analog input active do to the power consumption during reset. The inputs are put into a tri-state mode, but the tri-state mode is a digital input with no pullup. Exactly the mode that is described as bad in the AVR FAQ on the Atmel site for use on analog inputs. There is a DIDR to disable digital inputs, but during reset, it is set to enabled.
The question that comes to mind for me is "What do you do with an AVR that is held in reset?". I'm sure there are reasonable answers, but I would guess they are edge cases.
This question is mine.
Three ways:
I got both the SchmartBoard and the ATmega128 from Mouser. $10 for the board and $7 for the ATmega. If you go with the Sparkfun breakout board, you've got $10 total invested in the board and ATmega128.
Regardless of which oscillator type you use, the clock divde by 8 feature can be set. It is by default, and unless you specifically program a fuse, it will always divide by 8. This is one that bites me a lot. Write a bunch of code, burn it, and nothing works right. Oops. Fuses.
I have had some fairly basic questions about the different versions of 8-bit AVR's. The short answer is there are about 190 different versions of the AVR, differing almost entirely in the peripheral selection. There are basic differences between the ATtiny and the ATmega:
The similarities in the ATmega and ATtiny MCU's can be seen generally in the last digit of the part number. An ATmega324 and an ATmega644 are the same part with different memory sizes. The ATmega324 and ATmega328 are completely different parts. The ATtiny24, 44, and 84 are identical, except for memory sizes. The ATtiny24 and ATtiny25 are different. Exceptions are the ATmega8515 and ATmega8535, which are pinned out like the ATmega162 and ATmegaxx4 (164/324/644/1284) respectively.
The ArduinoISP program can be used to program any AVR having a "normal" SPI programming interface.
AVR ISP programming is done with a low-voltage (5V max nominal) power supply and an SPI interface to the AVR. Most AVR microcontrollers support this interface. Some don't have enough pins, and use a different interface. It is possible to program the fuse bytes in a way that prevents the part from being programmed again. This is done by disabling the reset line, generally by accident, when programming through the SPI interface. If this happens, the part is not reprogrammable. At least not with the SPI interface. There is another interface on most AVR's that is a "high-voltage parallel" interface. The interface is more complicated, since it is parallel, and requires a 12V+ power supply. The AVR can be programmed regardless of the fuse settings, and typically, the only use for the high-voltage parallel interface is to reprogram the fuses. This allows the part to be programmed again using the standard low-voltage SPI interface. Parts that don't have enough pin for SPI certainly don't have enough for the parallel interface, and so they support a high-voltage serial programming interface.
Yes. Modem control, such as RTS/CTS handshake, is just a pair of signals - one input and one output - that the DTE and DCE use to control transmission from the DCE (modem) to the DCE (host). For an example schematic, see the AVR RS232 project. It demonstrates connecting a MAX232 to an AVR for TXD, RXD, RTS, and CTS.