So recently I have been looking into prototyping my arduino project and there are a lot of tutorials online on how to take your Arduino and using a software such as Eagle to make a PCB layout but I was wondering how you would get the Arduino program onto that PCB. Surely in large scale circuit manufacturing they wouldn't have a usb attached so that they upload a program into each and every one of their circuits?
Well ok ... they might not connect a USB to each one as there are faster ways - flyingProbe/PogoPins on a "bed of nails"
This type of temporary connection speeds up testing & pre-programming considerably.
Each card that is made has to go through some form of test process at the end (flying probe or manual).
On boards that require programming or calibration, additional steps are taken to load code and verify the output.
For commercial products where very large quantities are produced, a microcontroller will be "mask programmed" - the (well-debugged) program will be built into the microcontroller as part of the IC production process.
For smaller quantities, the microcontroller may be programmed in a special fixture before being installed on the PC board. Also, most current microcontrollers have "In System Programming (ISP)" capability, which typically requires a 6 - 10 pin connector on the board, and a special programmer to plug into that board.
I think it is highly unlikely that an Arduino-based program would be used in any commercial product.
Actually, they generally do load a program into each and every one of their devices individually. They can do a lot more than that as well. Ever heard of something called JTAG? For large circuit boards, most of the large ICs are connected to a JTAG scan chain. Once the board is assembled, they connect a JTAG cable to the scan chain. Special test software controls the scan chain through the JTAG cable, possibly connected to the control computer via USB. The software can take control over the I/O pins on the ICs on the scan chain and set test patterns to check for opens or shorts. It can also perform more complex testing in concert with external test equipment, even including temporarily loading special diagnostic firmware. Once the test passes, the computer can then initialize ROMs, load firmware, set serial numbers, etc.
This is done one board at a time. Often, special test and/or programming jigs are built that allow boards to be connected and disconnected quickly, and usually multiple jigs are used in parallel for higher throughput.
For some chips, they can be programmed before installation either with mask ROM or with a standalone programmer. This is done when volumes are large and testing is not required, or if the devices must be programmed for the automated testing to work correctly.
cheers Brandan :)
I would suggest for you to make your own programmer. Then you will know a lot about programming and so on. If you want to program a chip on pcb, you have to have output pins of ISP. Throw these pins you will pump your code to Atmega chip.
Hardware USBasp There are ready pcb layouts in eagle. Building your own HW will be a bit more expensive than buying one, but if we count in experience it will be priceless :)
Also you can use bootloader. Check in google there are plenty of tutorials.