Some basic question about AVR chips and Arduino

respected sir/madam,

i am new to arduino i want to make a arduino board (Arduino Single-Sided Serial Board (version 3)). i have few questions

  1. i have atmega8L. will i have to burn something known as firmware or boatloader in it.

  2. if yes please give me links for that and also tell me how do burn them.

  3. can i burn them with serial usb programers for avr chips.

please help me i really want to learn it.

thanking you

Erm, I mean if I burn the bootloader to the chip, it will change the fuse bits of the AVR chip right ? So how about if I delete the existing bootloader in the AVR chip ??Will the HIGH fuse and LOW fuse changed or remain the same as in the bootloader file ?

The fuses and the bootloader are not directly related. Although the fuses usually are set when "burning" the bootloader, they can also be set independant of that as well as the opposite: updating a bootloader without changing the fuses.
You cannot delete a bootloader but you may overwrite it. So if you overwrite the Arduino bootloader with anything (a program or simply zeros), the fuses are not changed except you explicitly specify to do so. The fuses are not specified in the bootloader file, that's only program code. If you use the Arduino IDE to update a bootloader, the fuse bits are specified in the boards.txt file where you also find the bootloader file used when you select "Burn Bootloader" from the menu.

pylon:

Erm, I mean if I burn the bootloader to the chip, it will change the fuse bits of the AVR chip right ? So how about if I delete the existing bootloader in the AVR chip ??Will the HIGH fuse and LOW fuse changed or remain the same as in the bootloader file ?

The fuses and the bootloader are not directly related. Although the fuses usually are set when "burning" the bootloader, they can also be set independant of that as well as the opposite: updating a bootloader without changing the fuses.
You cannot delete a bootloader but you may overwrite it. So if you overwrite the Arduino bootloader with anything (a program or simply zeros), the fuses are not changed except you explicitly specify to do so. The fuses are not specified in the bootloader file, that's only program code. If you use the Arduino IDE to update a bootloader, the fuse bits are specified in the boards.txt file where you also find the bootloader file used when you select "Burn Bootloader" from the menu.

Ya, I can manually change the fuse bits also without uploading the bootloader, for eg the UNO bootloader. I can refer to the board.txt file to see what should I change to for the HIGH fuse and LOW fuse configuration. Correct ? Oh, so means once I burnt a bootloader inside, it for example changed the fused . But how do I remove the bootloader ? Any method ? Because once I tried before, I upload the bootloader, then the atmega 328 I can upload code into it through USB. But once I delete it, I cant upload through USB. But I noticed that the fuse bits remain the same. If the fuse bits is the same, why I cant upload using USB once deleted ?

Thank you

Vincent19:
But how do I remove the bootloader ? Any method ?

Updload your code through the ICSP, and it will get rid of the bootloader.

But once I delete it, I cant upload through USB.

Delete what?

But I noticed that the fuse bits remain the same. If the fuse bits is the same, why I cant upload using USB once deleted ?

Delete what?

The bootloader allows you to program the chip through the serial pins on the micro. Without the bootloader, you will need to program it through the ICSP pins.

Delete the bootloader.

Well, the bootloader is to enable serial communication through USB ? Not to change the fuse bits so as to use the external 16MHz crystal ?? LOL

Well, the bootloader is to enable serial communication through USB ?

Again, no.

The bootloader allows you to program the micro using the serial pins. That doesn't specifically mean it has to be done through USB. Also, just because the bootloader is not on there, doesn't mean it can't be programmed through USB (See USB ICSP Programmers).

Not to change the fuse bits so as to use the external 16MHz crystal ?? LOL

Burning the bootloader is the Arduino way of changing the fuse bits. It can be done in AVR Studio without burning the bootloader. I don't see the big deal in burning the bootloader on there just to set the fuse bits. Unless you are programming it using the bootloader (meaning using the serial pins), then the bootloader will get wiped out the next time you program it.

ern, can i say the bootloader as serial to USb downloader? enable the code to be downloaded through usb

Vincent19:
ern, can i say the bootloader as serial to USb downloader?

Grammatically, no.

enable the code to be downloaded through usb

You would actually be uploading it through USB, not downloading it.

uploading it to 5he chip right ? if no then what is bootloader actually?

Vincent19:
uploading it to 5he chip right ? if no then what is bootloader actually?

See reply #8

Vincent19:
uploading it to 5he chip right ? if no then what is bootloader actually?

Yes, code is uploaded to the chip.

How can I know that 2kb is used for the bootloader file ? I want to see for the difference when I upload bootloader and remove bootloader but I cant see it ><

The optiboot (used on an UNO) is 1467 bytes (hardware/arduino/bootloaders/optiboot/optiboot_atmega328.hex). That's how you can know it.

I mean for the total available size for the sketch. When I burn bootloader, the chip memory would be reduced by approximate 2kb right ? But where can I see it ?

Vincent19:
How can I know that 2kb is used for the bootloader file ? I want to see for the difference when I upload bootloader and remove bootloader but I cant see it ><

See the difference in what? The size? Add 2K if you are using the bootloader to upload the sketch, don't if you are not.

I mean I want to see the difference in the size..LOL. Cause I want to experiment something..Heheh..

Vincent19:
I mean I want to see the difference in the size..LOL. Cause I want to experiment something..Heheh..

Well you could always look at the maximum upload memory size defined for each entry in the arduino core file 'boards.txt'.

You can see that the Uno has a value of:
uno.upload.maximum_size=32256

While the Duemilanove has a value of:
atmega328.upload.maximum_size=30720

The difference is the size of the bootloader memory size protection options used to hold the two different bootloaders used by these too boards.

Lefty

I mean I want to see the changes on the same chip..Is it possible ?

The situation is like this :

Now I have a fresh atmega 328, So I want to see the maximum memory

Next, I burn bootloader into the fresh atmega chip. Then I want to see the maximum memory for now.

Is it possible ?

In the same vein, I have a similar question but not so technical. I ended up blasting the analog channels and now I get "processor out of sync" and it won't accept a program or run the existing one. Clearly this is bad. If I install a new Atmega328 chip on the card, (assuming that nothing else is destroyed), can I program it in-situ using the Arduino software and get a working unit once more? Just curious. The chips are only a couple of bucks versus a new card being 20-30 dollars.

Thanks.

thorargent:
In the same vein, I have a similar question but not so technical. I ended up blasting the analog channels and now I get "processor out of sync" and it won't accept a program or run the existing one. Clearly this is bad. If I install a new Atmega328 chip on the card, (assuming that nothing else is destroyed), can I program it in-situ using the Arduino software and get a working unit once more? Just curious. The chips are only a couple of bucks versus a new card being 20-30 dollars.

Thanks.

Yes, assuming no other components got zapped a simple replacement of the 328p chip will get you operational, that's one of the greatest advantages of a arduino board that uses a socketed DIP uP chip. However to save you some greef if you haven't already learned how to burn bootloaders onto blank chips or if you don't own a hardware programmer or a second functioning arduino board I would suggest you buy your chip with a bootloader already burned into the chip for just a few dollars more. SparkFun has them as well as other speciality vendors.

Lefty