I'm returning to one of the specific 'side topics' discussed in the long thread resulting from my first post a couple of weeks ago
https://forum.allaboutcircuits.com/threads/starting-arduino-but-no-micro-controller-programming-skills.159472/page-3
In that thread I said:
Looking ahead, assuming I can learn enough to design my own circuits, what is the recommended practical approach? After getting something working on the kit breadboard, I assume I can then make a permanent, cased version by buying the appropriate chip and socket, and soldering up on veroboard, my usual approach?
The project that I was about to attempt with traditional stuff would have needed 10 successive 555 monostables (each one driving either a solenoid or some sort of motor, to press a Polaroid CUBE camera button). Hopefully the Arduino will make that task easier - eventually!
I've now completed the sketch for my first project. So I now want to take the MEGA 328 chip away from the UNO R3 board onto veroboard for further work.That will let me continue learning from a variety of sources on what is currently my only UNO. (I gave up trying to repair the original one. You may recall that it worked apart from the upload, implicating a h/w issue with the USB chip. I also posted in the Arduino Forum but never found a solution.)
So I'm now re-reading the advice I received, pasted below for convenience:
djsfantasi
The Arduino also includes power regulation on board. You have already implied that you’re aware of such niceties. It would be required on your custom board.
One area that may foil your efforts is the Arduino family includes an onboard FTDI USB interface. On your roll-your-own boards, you’d have to add this functionality. Or otherwise provide hardware serial communications. This is necessary because it’s the only way to program a bare chip. First, to install a boot loader and second to upload the microprocessor with your sketch (program).
Secondly (because I’ve yet to attempt what your suggestion) the PIN numbers in the Arduino IDE may not match the pins on a raw ATMega328. YMMV
So no, it not as simple as getting something to work on an Arduino and then plugging a bare chip into your custom board.
How are you going to reset the chip if necessary? Do you want some indication of power or serial communications? Do you need a built-in status indicator (in unison now, PIN 13)!
But don’t worry about that now! I’ve embedded Arduino UNOs in several projects and that was it.
Your first challenge is to learn how to use the Arduino. Connecting inputs and outputs. Programming in the Arduino variant of C++. Have fun with it for a while. Besides the kit projects, try all the example code provided with the IDE, read it until you understand exactly what it does. Browse the Arduino, AdaFruit and SparkFun web sites. Learn what a shield is and look at the many shields available from those three resources.
But above all... have fun!
Wolframore
Hey @Terrypin congrats! I love these uC's they certainly make things easier in terms of hardware... I've lost count of how many UNO's and nano's I have... I also have DIP chips and exploring other options for permanent projects. The chips are easy to use. You can basically power them and go. DIP chips can be exchanged on the DIP version of UNO which makes them easy to program... otherwise it's just a little more complicated... JTAG, other arduino.... so on.
djsfantasi
Fine. But you have to know to order chips with the boot loader pre-installed. The TS is an acknowledged µP noob. We have to be specific
Wolframore
You don't need the bootloader pre-installed if you already have an Arduino... you can use it to burn a bootloader on any Arduino IC.
SamR
Actually you don't. The IDE is supposed to be able to do that for you. Havn't tried it yet, but it is there to use.
Wolframore
Plus if you don't mind running at 8Mhz there's an internal clock so basically you just decouple VCC put power to it and go.
I've done it... $1.20-$150 per chip... burn bootloader... solder to board and go. Or better yet put in a DIP socket for options.
--------------------
I've bought these 'ATmega328P-PU Atmel AVR Microcontroller' chips:
https://www.amazon.co.uk/gp/product/B019ILOE5I/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1
From the customer review I read "As expected these are (it seems) genuine ATMEL chips without the Arduino bootloader programmed. I've tried 2 of them and programmed them with the optiboot bootloader with no issues. For those that may care they report 0x1e950f as the signature and avrdude doesn't complain."
Q1: What are the exact steps I should take to burn the bootloader to one of these please? Do I start by carefully removing my UNO 328 and inserting the fresh one then using the IDE as I did before when attempting to repair the original chip?
Q2: Assuming I then have a new bootloaded 328, with my CUBE sketch uploaded to it, can I then place it on my veroboard (in a socket - I'd never dream of soldering it!) and simply add a regulated 5V supply? No need for a crystal or anything else other than my MOSFET components?
Q3: @Wolframore: Can you expand a bit on those 8 MHz chips please? Are they like these?
https://www.ebay.co.uk/i/173226212681?chn=ps
Terry, East Grinstead, UK
https://forum.allaboutcircuits.com/threads/starting-arduino-but-no-micro-controller-programming-skills.159472/page-3
In that thread I said:
Looking ahead, assuming I can learn enough to design my own circuits, what is the recommended practical approach? After getting something working on the kit breadboard, I assume I can then make a permanent, cased version by buying the appropriate chip and socket, and soldering up on veroboard, my usual approach?
The project that I was about to attempt with traditional stuff would have needed 10 successive 555 monostables (each one driving either a solenoid or some sort of motor, to press a Polaroid CUBE camera button). Hopefully the Arduino will make that task easier - eventually!
I've now completed the sketch for my first project. So I now want to take the MEGA 328 chip away from the UNO R3 board onto veroboard for further work.That will let me continue learning from a variety of sources on what is currently my only UNO. (I gave up trying to repair the original one. You may recall that it worked apart from the upload, implicating a h/w issue with the USB chip. I also posted in the Arduino Forum but never found a solution.)
So I'm now re-reading the advice I received, pasted below for convenience:
djsfantasi
The Arduino also includes power regulation on board. You have already implied that you’re aware of such niceties. It would be required on your custom board.
One area that may foil your efforts is the Arduino family includes an onboard FTDI USB interface. On your roll-your-own boards, you’d have to add this functionality. Or otherwise provide hardware serial communications. This is necessary because it’s the only way to program a bare chip. First, to install a boot loader and second to upload the microprocessor with your sketch (program).
Secondly (because I’ve yet to attempt what your suggestion) the PIN numbers in the Arduino IDE may not match the pins on a raw ATMega328. YMMV
So no, it not as simple as getting something to work on an Arduino and then plugging a bare chip into your custom board.
How are you going to reset the chip if necessary? Do you want some indication of power or serial communications? Do you need a built-in status indicator (in unison now, PIN 13)!
But don’t worry about that now! I’ve embedded Arduino UNOs in several projects and that was it.
Your first challenge is to learn how to use the Arduino. Connecting inputs and outputs. Programming in the Arduino variant of C++. Have fun with it for a while. Besides the kit projects, try all the example code provided with the IDE, read it until you understand exactly what it does. Browse the Arduino, AdaFruit and SparkFun web sites. Learn what a shield is and look at the many shields available from those three resources.
But above all... have fun!
Wolframore
Hey @Terrypin congrats! I love these uC's they certainly make things easier in terms of hardware... I've lost count of how many UNO's and nano's I have... I also have DIP chips and exploring other options for permanent projects. The chips are easy to use. You can basically power them and go. DIP chips can be exchanged on the DIP version of UNO which makes them easy to program... otherwise it's just a little more complicated... JTAG, other arduino.... so on.
djsfantasi
Fine. But you have to know to order chips with the boot loader pre-installed. The TS is an acknowledged µP noob. We have to be specific
Wolframore
You don't need the bootloader pre-installed if you already have an Arduino... you can use it to burn a bootloader on any Arduino IC.
SamR
Actually you don't. The IDE is supposed to be able to do that for you. Havn't tried it yet, but it is there to use.
Wolframore
Plus if you don't mind running at 8Mhz there's an internal clock so basically you just decouple VCC put power to it and go.
I've done it... $1.20-$150 per chip... burn bootloader... solder to board and go. Or better yet put in a DIP socket for options.
--------------------
I've bought these 'ATmega328P-PU Atmel AVR Microcontroller' chips:
https://www.amazon.co.uk/gp/product/B019ILOE5I/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1
From the customer review I read "As expected these are (it seems) genuine ATMEL chips without the Arduino bootloader programmed. I've tried 2 of them and programmed them with the optiboot bootloader with no issues. For those that may care they report 0x1e950f as the signature and avrdude doesn't complain."
Q1: What are the exact steps I should take to burn the bootloader to one of these please? Do I start by carefully removing my UNO 328 and inserting the fresh one then using the IDE as I did before when attempting to repair the original chip?
Q2: Assuming I then have a new bootloaded 328, with my CUBE sketch uploaded to it, can I then place it on my veroboard (in a socket - I'd never dream of soldering it!) and simply add a regulated 5V supply? No need for a crystal or anything else other than my MOSFET components?
Q3: @Wolframore: Can you expand a bit on those 8 MHz chips please? Are they like these?
https://www.ebay.co.uk/i/173226212681?chn=ps
Terry, East Grinstead, UK