Pages: [1]   Go Down
Author Topic: Burn arduino .hex file directly to atmega8 without bootloader  (Read 5782 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The lock bits are relatively less important.  The default value (0xFF or 0x3F) won't "protect" anything, but uploaded code should run fine...

Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for your reply..will give it a shot..
Logged

Norman, OK, USA!
Offline Offline
Full Member
***
Karma: 0
Posts: 127
Klingon Machinist
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

M.S.

London, England
Offline Offline
Newbie
*
Karma: 1
Posts: 49
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1619
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Pages: [1]   Go Up
Jump to: