user43720: I've got a project where I need to program an ATmega328P on an Arduino Uno board, then transplant it into a custom PCB - however, this board does not have an oscillator installed, and so I need to run the microcontroller off its internal clock.
My goal here is to be able to code my software with the Arduino IDE, insert a factory-fresh ATmega328P straight from the tube into the socket on the Arduino Uno board, then move the device from the board to the PCB without any changes along the way. What's the best way to go about this?

user10794: You can set the fuses to run on the internal oscillator easily enough. You can still run at 8 MHz which the IDE supports (choose Lilypad in the IDE) and then the delays, serial prints, etc. will still work properly.
As for programming a new chip, you can use an Arduino as ISP, an external ISP programmer (available cheaply from eBay), or see my page about uploading hex files which just needs a few hook-up cables, and a $15 SD card adapter like this:

You upload the sketch onto your Uno to make it into a programmer. Then you compile the code for your target chip and get the .hex file that the compiler produces.
Example setup:

The hex uploader sketch also lets you change fuses.
The AVR Fuse Calculator page will help you with getting the correct fuse settings.

user2881: That will not work. To change the clock source, you'd need to change the fuses. I don't know of any way to do this while the chip is inside the UNO. 
Secondly, a factory fresh 328P won't work in an UNO board, because it doesn't have the correct fuses, and doesn't have the bootloader programmed. 
I'd suggest placing the 328P chips in a breadboard; connect the ISP pin to the UNO, and use the Arduino-as-ISP to change the fuses, and upload your program.
PS why run at 1Mhz. The internal oscillator runs at 8Mhz. By default the divide-by-8 fuse is set, so it runs at 1Mhz out of the factory, but you can unset this fuse.
PPS use this website http://www.engbedded.com/fusecalc/ to generate the right fuse settings for your project.

43720: <p>I've got a project where I need to program an ATmega328P on an Arduino Uno board, then transplant it into a custom PCB - however, this board does not have an oscillator installed, and so I need to run the microcontroller off its internal clock.</p>

<p>My goal here is to be able to code my software with the Arduino IDE, insert a factory-fresh ATmega328P straight from the tube into the socket on the Arduino Uno board, then move the device from the board to the PCB without any changes along the way. What's the best way to go about this?</p>
 10794: <p>You can set the fuses to run on the internal oscillator easily enough. You can still run at 8 MHz which the IDE supports (choose Lilypad in the IDE) and then the delays, serial prints, etc. will still work properly.</p>

<p>As for programming a new chip, you can use an Arduino as ISP, an external ISP programmer (available cheaply from eBay), or see <a href="http://www.gammon.com.au/uploader" rel="nofollow noreferrer">my page about uploading hex files</a> which just needs a few hook-up cables, and a $15 SD card adapter like this:</p>

<p><a href="https://i.stack.imgur.com/5PcdO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5PcdO.png" alt="SD card adapter"></a></p>

<p>You upload the sketch onto your Uno to make it into a programmer. Then you compile the code for your target chip and get the .hex file that the compiler produces.</p>

<p>Example setup:</p>

<p><a href="https://i.stack.imgur.com/u8gOG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u8gOG.jpg" alt="Hex uploader"></a></p>

<p>The hex uploader sketch also lets you change fuses.</p>

<p>The <a href="http://www.engbedded.com/fusecalc" rel="nofollow noreferrer">AVR Fuse Calculator</a> page will help you with getting the correct fuse settings.</p>
 2881: <p>That will not work. To change the clock source, you'd need to change the fuses. I don't know of any way to do this while the chip is inside the UNO. </p>

<p>Secondly, a factory fresh 328P won't work in an UNO board, because it doesn't have the correct fuses, and doesn't have the bootloader programmed. </p>

<p>I'd suggest placing the 328P chips in a breadboard; connect the ISP pin to the UNO, and use the <a href="https://www.arduino.cc/en/Tutorial/ArduinoISP" rel="nofollow noreferrer">Arduino-as-ISP</a> to change the fuses, and upload your program.</p>

<p>PS why run at 1Mhz. The internal oscillator runs at 8Mhz. By default the divide-by-8 fuse is set, so it runs at 1Mhz out of the factory, but you can unset this fuse.</p>

<p>PPS use this website <a href="http://www.engbedded.com/fusecalc/" rel="nofollow noreferrer">http://www.engbedded.com/fusecalc/</a> to generate the right fuse settings for your project.</p>
