1

I generally use sockets for AVRs in standalone circuits, but sometimes I sell my items and therefore I soldier the chip on the circuit. As you guess I can upgrade the code inside the chip with socket simply putting the chip out and putting it into the programmer board, but It doesn't work the same way with the ones which are soldiered on the circuit.

I know there are some ISP devices like USBtinyISP etc., but I want to be more professional and know exactly how an in system programmer work.

Do I have to use Avrdude If I design my own In system programmer? Isn't there any way that is more universal?

I searched the internet for a long time and I found only hobbyist stuff. Can anyone explain or simply direct me to a good source that explains this topic? Thank you in advance.

  • You can still use the Arduino IDE. Just change the "programmer" in the menu. Just add a ISP header to your project. – Gerben Feb 1 '15 at 13:21
1

ISP works by using a serial connection (usually via the SPI and nRESET pins) to the MCU. The programmer talks to the device using the low-level protocol that the device expects, and connects to the host using a different, high-level protocol. The host then directs the programmer to perform the various programming actions on the device, and in turn the programmer reports to the host about its current status.

There are a number of programming protocols that already exist, such as the one described in AVR910. As long as both the connection type and the protocol itself are supported by AVRDUDE it will work transparently once the hardware is assembled.

Further details about ISP are available in both AVR910 as well as the "Serial Programming" section of the datasheet for the device in question.

0

You can use an ISP using the Arduino UI - simply select your programmer (tools->programmer) then "upload using programmer" (under the file menu).

Alternatively, you could use a pre-programmed AVR to do the programming - see http://www.atmel.com/images/doc0943.pdf for the spec. I think an AtTiny would be enough, depending on how big your program is, you might need some external storage. You could set it up with a "read" and a "write" option, so you program your dev AVR normally, then use an AtTiny to suck the data off, then push it up to one of the others. This is left as an exercise to the reader.

In any case, you would just need access to the 6 pins - VCC(power), GND(ground), RST(reset), SCK(clock), MISO(master->slave) and MOSI (slave->master). Note that the RST pin has to go high/low at specific times during the programming, so if programming from another AVR, it will need to be a data pin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.