1
\$\begingroup\$

I have been working with Arduino for a while now i thought of using AVR micro-controllers in the bread-board . I saw several tutorials on how to transfer .hex file to the AVR micro-controller . They showed how to use the USB programmer to transfer the .hex file but if i say i want to know how to make a USB programmer works , what is the structure of a USB programmer ? I found nothing , can anyone give me a good answer of how the .hex file is transfered into the micro-controllers memory , i.e code-segment in the memory .

Thanks,

\$\endgroup\$
0
2
\$\begingroup\$

There are two ways of programming an AVR device.

The first is via an external programmer that interfaces with "hidden" hardware on the chip. The most common form of this is ISP, described in AVR910. Other methods exist, see the datasheet of the relevant AVR device for details.

The other is self-programming, which involves code running on the AVR device to accept the data to be programmed through one or more pins on the chip and then using special opcodes to write the data to flash and EEPROM. This is described in AVR109.

Note that "programming by USB" is actually self-programming where the bootloader opens a serial connection and the programming software sends the data through this serial connection. This is true both on devices with a separate USB interface chip such as the Arduino Uno as well as devices with integrated USB support such as the Arduino Leonardo.

\$\endgroup\$
2
  • \$\begingroup\$ Self-programming updates an AVR that has been previously programmed to support this feature (like Arduino); but a brand-new, never-programmed AVR chip requires ISP (In System Programming), correct? \$\endgroup\$
    – MarkU
    Nov 1 '14 at 10:05
  • \$\begingroup\$ @MarkU: It depends on which device you're talking about. Certainly the ATmega328 comes from the factory completely blank, but the ATmega32U4 comes preprogrammed with a USB-based bootloader. \$\endgroup\$ Nov 1 '14 at 12:19

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.