Arduino nano standalone schematic - ICSP questions

Using EasyEDA I've designed a standalone Arduino nano and plan to have a small PCB manufactured by jlcpcb. I've used the Nano's user manual as a reference for the PCB; within this scope I've used the same microcontroller (ATMEGA168-20AU) and kept close to the original design.

The circuit is modestly basic and will use a blank target ATMEGA168 placed by jlcpcb, which will have an Arduino sketch uploaded to it - my questions are*

[1] Can the ICSP be used for flashing the bootloader and then uploading the sketch with no extra wiring?

[2] Can an external Arduino flash the bootloader and then upload the sketch? (or is specialist equipment needed if these actions are done over ICSP)

[3] For a blank target microcontroller to recognise a sketch I understand the bootloader must be flashed first?

[4] Is the circuit schematic sufficient to work within the above context? So it'll be a basic PCB, bootloader flashed and sketch uploaded once only (hopefully if sketch is found to be stable)

*I'm sure it the answers are y in each question, I'm looking for confirmation before I press the order button on jlcpcb

Thanks

Your questions are related and I will try to answer in general. The bootloader is needed by the microcontroller to self-programing. Because you don't have a USB2TTL chip like the CH340G, for example, your microcontroller can't self-program. When you program it through ICSP, you use a programmer - for example, an Arduino with the 'Arduino as ICSP' program uploaded. When you do not have a bootloader, you have the advantage that you have all the memory of the microcontroller. I have personally used Arduino Nano as a programmer and with it I have programmed a standalone ATmega88 chip through ICSP. Before you do anything you have to program fusebits but this is done only once and then you upload the program. Fusebits set whether to use a built-in or external oscillator as in your case, at what frequency to operate depending on the divider, etc.I don't know exactly what kind of battery you will use, but if it's similar to the CR2032, it's hardly a good idea because you also have a display to power it.

1 Like

Hi, thanks for the reply, is the answers are y to all of the 4 questions? just looking for confirmation, not being facetious.

Regarding the power, the booster IC gives 3.3V at 100mA when driven by an alkaline battery, this should be enough.

See reply inline

1 Like

Many thanks hzrnbgy, that's exactly what I was hoping for - I suspected as much, was seeking confirmation.

Lastly though, I thought a blank ATMEGA168 required the bootloader in order to recognize an Arduino sketch(?), obviously not then. That's even better, it saves a 2k for the nano/ATMEGA168 - great stuff and thanks again

A boot loader is not needed if you have a way to upload a sketch (using an ICSP programmer). Bootloaders are usually used by folks that don't have access to an ICSP programmer or an extra Arduino that can act as an "ICSP" programmer

1 Like