After having got my first arduino, i want to build my own one - to start with, say, i load my sketch and then i pull the aTMEGA168 out of my arduino and plug it on a breadboard and power it up will i be able to use it in the same manner like the arduino board? will i have to plug in any additional components? will i get to use all the digital pins and analog pins? what will be the basic differences? last evening when wiring a seven segment display i happened to short the cathodes on it and this reset the arduino board - any posibilities of the board being damaged?(it seems to work fine to me but then i dont know how to check it)
You will, at a minimum, have to wire a 16mhz crystal (and caps) or a 16mhz resonator (caps are built in) to the micro, both inexpensive components. In additon you will have to wire a pull-up resistor from +5vdc to the reset pin. Also a .1 mfd across the power pins of the micro (Vcc & ground) is always a good practice.
Other then that you are then free to use any pins that your program is utilizing. Keep in mind that to reprogram the chip it will have to be removed from the breadboard and reinstalled onto your Arduino board.
Its even simpler if you use the internal oscillator too. And the reset is pulled high internally BTW when reset is not disabled. Unless you connect the reset pin to something (i.e. fancy auto reset signal on RTS) it shouldn't need to be wired, never had an issue with reset not wired to anything myself in the real world.
I tried this but had no success. I made a 12v to 5v convertor on a stripboard and fed the power into the ATMega168. The 5v was working fine (5.05v precisely), but the BLINK LED sketch did not work when I connected an LED between Pins 13 and Ground.
Putting the chip back into the Arduino confirmed it worked perfectly and LED 13 on the board was blinking merrily away, but when I put it back into my stripboard it does nothing. I have checked all of my soldering with a continuity tester and see no faults there.
I have used a 16MHz resonator. The Reset is connected to +5v as in the diagram, though DCB says it is not necessary. I tried it with and without the reset connected and it made no difference.
Hmm, try connecting a 0.1uF cap near pins 7 and 8 (across Vcc and ground). could be a noisy supply.
Speaking of the supply, does the regulator circuit have the appropriate caps?
Some folks claim that the capacitors on a regulator are really optional, especially if you operate from a battery (since the battery doesn't produce noise like an AC-powered supply does). This is not true - the regulator itself produces some noise, even the linear types.
I reviewed the ATmega168 datasheet for about 20 minutes and am not convinced that RESET can be left floating. Since there are a few hundred pages there I could have overlooked something, though.
MC: Do you know if your crystal was designed for microprocessors? (there's a couple flavors).
Also, if you can burn a bootloader, try switching board to lilypad, burn the bootloader, and loading blink. Then put it on the breadboard. If that works then it is likely the crystal.
I assume your led works? And you have a series resistor with it and the polarity right? If you connect the pin side of that resistor to 5v you get a lighted LED?