1
\$\begingroup\$

I would like to know if Atmel microcontrollers come with a bootloader. For example I asked a question earlier where other users were saying that a microcontroller could be used instead of a 555 timer which is old.

I realise you can create a delay by programming the chip using AVRstudio?

Basically do they have a bootloader or libraries installed that run this code or do you need to install it yourself?

\$\endgroup\$
  • \$\begingroup\$ Ask your Atmel FAE. \$\endgroup\$ – Brian Carlton May 23 '12 at 21:56
  • 3
    \$\begingroup\$ @BrianCarlton lol. I am assuming OP doesn't have an Atmel FAE. He could be a hobbyist ;) \$\endgroup\$ – dext0rb May 23 '12 at 22:25
3
\$\begingroup\$

Some do.

From personal experience, I can tell you the ATMEGA32U4 has a USB Bootloader from the factory.

Personal experience aside, this list from ATMEL is more complete.

You can use whatever you want to actually compile the code into a hex file. (ie AVR Studio).
You will then need to use ATMEL's FLIP uploader to program your chip.

Fresh from the factory, the chip will be in "programming mode", ready to accept your file.
If you want to change the program after initial programming, you can put the chip back into "programming mode" by grounding the HWB pin and toggling the RESET pin.

In your circuit, the HWB should be "pulled up" via a resistor to VCC. That way, the pin is not left floating and you will not put the chip into programming mode accidentally.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Usually the microcontroller doesn't come with a bootloader. You have to use a programmer (e.g. AVRISP mkII) to program the device.

Microchip (manufacturer of the PIC micros) can deliver the microcontroller preprogrammed. Dont know whether Atmel offers such a service, too.

Another option is to use Atmel Atmegas microcontroller with a Arduino bootloader pregrogrammed. Some suppliers offer theses, so you dont need a programmer anymore.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks..I have an Arduino and that is what I am practising on...are you saying you could upload an arduino bootloader and you could upload programs from AVRstudio and they would run ok? \$\endgroup\$ – James Hatton May 23 '12 at 20:46
  • \$\begingroup\$ @James Hatton - To upload the Arduino bootloader (on a fresh device) you need a programmer. If the bootloader is already uploaded, you can programm the device like you do with your Arduino (of course you need some hardware, USB or some other serial connection to your pc). I am not sure about AVRstudio, but imo it is not compatible with the Arduino bootloader. \$\endgroup\$ – PetPaulsen May 23 '12 at 20:51
  • \$\begingroup\$ Thanks...just not really sure why you would upload a Arduino bootloader...surely you can only then use the arduino software to upload code on to the chip? \$\endgroup\$ – James Hatton May 23 '12 at 20:59
  • \$\begingroup\$ @James Hatton No. The bootloader should work fine with AVRDude software and you just need the hex file which AVRstudio can make. Here's an article on that. \$\endgroup\$ – AndrejaKo May 23 '12 at 21:04
  • \$\begingroup\$ You can pay Digikey to supply programmed AVRs through their custom department, but it costs a bit more obviously. You have to provide them a HEX file and Fuse Settings. \$\endgroup\$ – vicatcu May 23 '12 at 22:01
1
\$\begingroup\$

In general, they don't.

If you want to buy very large amounts of chips, you could have them preprogrammed by the manufacturer, but that's expensive, as far as I know.

The other options would be to find someone who will sell you chips with bootloader installed.

With the popularity of Arduino platform, it's common to find AVR chips with Arduino bootloader installed. Some can for example be obtained from Sparkfun. Some companies also sell AVR chips with their own bootloaders.

If you can't obtain such a chip, the other option is to obtain a programmer. You could buy the official programmer which is AVRISP mkII or make one yourself. There are numerous guides on the Internet on how to make such a programmer and many of them are very simple and work with PC serial ports. This one worked nice for me, but if used with an USB to serial cable, it can be very slow.

Arduino can be used to program AVR chips, so a cheap option could be to obtain one of the microcontrollers with Arduino firmware and then use it as a programmer. There's a guide on how to do that here.

Another option for AVR development that seems popular is the AVR Dragon development board. It is worth noting that in general AVR programmers can't do debugging, that the debuggers are either old (and don't work with new chips) or expensive. The Dragon can be used to debug newer AVR chips too so that makes it an interesting product.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Wouldn't you have to have a programmer to upload code from AVRstudio anyway? \$\endgroup\$ – James Hatton May 23 '12 at 20:47
  • \$\begingroup\$ @James Hatton Well no. The point of the bootloader is that you can send using serial port image to the microcontroller that contains the program. This way you don't need a programmer and only need one of the serial port interface chips. I haven't used AVRStudio in a while so I can't remember what options need to be used with the bootloader, but it's possible to make a program that will be loaded by the bootloader directly. With a programemr, you don't need a bootloader and that gives you more program memory. \$\endgroup\$ – AndrejaKo May 23 '12 at 20:59
  • \$\begingroup\$ I see, so AVRstudio will upload code to the chip that the chip understands and go from there. \$\endgroup\$ – James Hatton May 23 '12 at 21:02
  • \$\begingroup\$ @James Hatton Actually, I just did a bit of research on that. From what I can see you may need to call avrdude by hand with appropriate command line to actually upload the code. I haven't used new versions of AVRstudio much, so I don't know if there's a nice GUI way to do that, but AVRStudio can make the hex file that needs to be uploaded and in the worst case, you can make a .bat file to call avrdude for the specific hex file you have. \$\endgroup\$ – AndrejaKo May 23 '12 at 21:08

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.