Can I pull the ATMEGA from an Arduino and use it on a PCB?

Hello,

I have an Arduino uno R3 (ATMEGA328P-PU), working just fine. The other day I found a local store that sells the ATMEGA328 chips with the bootloader already in them, and also sells a kit with the crystal and caps.

So the question comes to mind... let's say I want to make a circuit on a PCB that runs Arduino code. Can I simply buy the chip + caps + crystal, put it in my Arduino socket, upload the sketch, and once everything is up and running fine, pull the chip from the socket and put it on the PCB?

I've seen several documents on ISP and FTDI, including the ArduinoToBreadboard on this site. But it seems a whole lot easier to just stick the new chip in the socket for a few minutes and upload the sketch, as long as the chip already has a bootloader on it.

Yes you can. You can even burn the fuses while it's on your arduino board so that it runs on it's own internal 8 MHz clock. Then you don't even need the crystal on your "pcb" If you take this step, however, I think the bootloader will fail from that point forward, until you reset the fuses back to normal.

Yes, see:

Yup! 100% possible. I've been working on getting my circuit onto a breadboard.

I got one of these with the boot loader already on it: ATmega328 with Arduino Optiboot (Uno) - DEV-10524 - SparkFun Electronics

All I had to do was stick it on the the arduino, program it and then place it on the circuit board :slight_smile:
There are plenty of tutorials online as well, to get the exact same functionality as the board. I started with this:

Need to pay attention to signature byte differences between '328 and '328P when programming them initially.