Hi, i recently read that it is possible to directly burn the .hex file to the atmega8 without burning the arduino bootloader into it. My question is , is it possible to just directly burn the .hex file without considering the lockbit and fusebit settings? or do they have to be set?If they do , could someone guide me wiht the lockbit , fusebit settings for atmega8 for burning .hex files directly. Thanks..
is it possible to just directly burn the .hex file without considering the lockbit and fusebit settings? or do they have to be set?
They have to be set, if they're not already set to an appropriate value. ISP programming requires a "chip erase" as part of the process, which resets the lock bits to their default state. This may be OK, or ... not. The fuse bits stay, so if they are right they do not need to be changed, but they will almost certainly need to be changed at least once if you are starting with a bare brand-new chip, mainly to get the clock options set correctly (IIRC, the default settings cause a 1MHz internal clock.)
There are some "fuse byte" calculators out there, but it's not obvious that they're "easy to use" if you don't already know enough to set the fuses without one...
Note that directly burning the .hex file requires a specialized "programmer" piece of hardware, like Adafruit's USBtinyISP
i do have the ISP programmer.. I think i got the fuse settings right to use an external 16mhz clock.. im not too sure about the lock bits though.. will just give it a try and check...thanks..
The lock bits are relatively less important. The default value (0xFF or 0x3F) won't "protect" anything, but uploaded code should run fine...
thanks for your reply..will give it a shot..
If you have an ISP burner you can indeed upload .hex files to the ATMega8 directly. The m8 comes from the factory without a bootloader. A bootloader is not required to use the thing. Certain values of the fuses are already set by default from the factory. For example it is by default set to the internal oscillator at 1MHz.
You would need to change the fuse settings if you put it into a circuit with an external crystal, or a host of other options. More than I can clearly explain.
I upload files to a tiny85 with default settings similar to the mega8 regularly.
It might be useful to know, you can use the FTDI chip in the Duemilanove board as a ISP. AvrDude can bitbang from the 'X3' port on the board (just need to solder a header to it).
I've been playing with it to directly upload to a surface mount chip via SPI.
THE Fuse Settings for ATmega8 are given as follows use those and you WILL be ON!(reference kimio kosaka):
Use these fuse-bits and lock-bit.(ATmega8) hfuse = CA lfuse = DF unlock = 3F lock = 0F