If you hate reading then maybe a video is suitable for you so please check the above video.

Needed Supplies

To ensure successful ISP programming of an AVR microcontroller, you will need the following essential hardware:

In the upcoming steps, I will guide you on how to produce these adaptors, ensuring that you have the necessary hardware for a successful ISP programming experience. Stay tuned for detailed instructions!

Why ISP

First, let's start with a brief explanation of ISP. In-System Programming is a technique used in electronics to program microcontrollers or other embedded devices without requiring the removal of the chip from the circuit board. This is a very convenient and cost-effective way to program chips and update firmware or software.

One of the biggest benefits of using ISP is that it can greatly reduce development time and lower costs as you will not need extra electronics components to upload your code to the MCU.

Some microcontrollers support ISP via a standard communication protocol such as SPI or I2C, while others uses some specific protocols, the most commonly used protocol for ISP programming for AVRs is the SPI protocol where you need four pins of your microcontroller plus the two pins for power and shared ground, and since most AVRs are equipped by SPI port then this is the most reliable way for programing them.

To perform ISP, you will need the right hardware and software. This includes a programmer device, which is used to communicate with the microcontroller, as well as software that is compatible with both the programmer and the microcontroller. Considering the social media shared projects, the USBASP programmer is the most popular for AVRs and by connecting it to the microcontroller SPI pins you can easily upload codes.

What To Consider While Designing

If you are willing to use the USBASP programmer then you need to consider this on your PCB design by providing access to the microcontroller SPI pins and make this access exposed somehow and this technique is the most suitable to keep a small programming area in the PCB layout, by placing some surface pads arranged in 2 by 3 array of 2.54mm spacing you could access the SPI port using some pogo pins, this technique requires an adaptor that you connect it to USBASP JTAG connector to link the SPI pins of programmer and the SPI pins of the microcontroller, you must consider the pins order of SPI based on the adaptor order pins.

IMG_20230619_085250.jpg

I considered this pins array of 2.54mm spacing as example but you could go for smaller array of 1.27mm spacing and then you need a smaller programming adapter.

How To Produce The ISP Adapter

We can't use the USBASP itself to upload codes, but it has to be connected to the board ISP pins and since a JTAG connector is a bit big part then it will take a larger space then using ISP pins technique and in order to connect the USBASP JTAG connector to the ISP pins of our circuit design then we need an ISP adapter that has a JTAG Male connector where we place the USBASP JTAG Female connector and some pins that could touch the surface ISP pads of the circuit board,

Here I designed two adapter for the two pads spacing so the small one is for ISP pins of 1.27mm spacing and the big one is for ISP pins of 2.54mm spacing.

I get to order these adapters from JLCPCB and the small adapter size gave me the advantage to place my order for a very cheap price.

You could use these GERBER files to place an order of the same adapter and let me know in the comments section if you need any further assistance about them!

GERBER Files for 2.54mm adaptor (1.2mm PCB Thickness)

GERBER Files for 1.27mm adaptor (0.6mm PCB Thickness)

You can order the pins for the adapter and JTAG Connector by following these links:

Pogo Pins for 2.54mm ISP adaptor

Pogo Pins for 1.27mm ISP adaptor

IDC JTAG Connector

Practicing Example

Now that we've covered the basics of ISP, let's move on to some practical examples of ISP in action. I will use this PCB design from Alexandra Covor to program a ATtiny13 using USBASP programmer as hardware and Arduino IDE as software,

I must add the MicroCore to my boards manager in order to bring the ATtiny13 microcontroller, and her are the needed steps: 

  1. Open the Arduino IDE.
  2. Open the File > Preferences menu item.
  3. Enter the following URL in Additional Boards Manager URLs: https://mcudude.github.io/MicroCore/package_MCUdude_MicroCore_index.json
  4. Open the Tools > Board > Boards Manager... menu item.
  5. Wait for the platform indexes to finish downloading.
  6. Scroll down until you see the MicroCore entry and click on it.
  7. Click Install.
  8. After installation is complete close the Boards Manager window.

Now we move to the hardware, the design has ISP pins of 2.54mm spacing so I will use my big adaptor with the programmer JTAG, the pogo pins fits perfectly on the ISP exposed pins and now I could plug my USBASP to computer to burn the ATtiny13 bootloader, I set the programmer as USBASP Slow and my target is ATtiny13 then by clicking burn bootloader I get it transferred to the microcontroller.

I will use the same code provided by Alexandra to demonstrate the programming concept, this code will alternatively glow some LEDs connected to ATtiny13, I keep the same board settings as well as the adaptor pogo pins connected to the board and simply by clicking upload I get the sketch compiled and uploaded.

To ensure successful ISP, there are some important tips and tricks to keep in mind. For example, it's crucial to ensure that the circuit is properly powered and that the programming voltage is correct. It's also important to follow the manufacturer's guidelines for the specific microcontroller you are working with.