Pages: [1]   Go Down
Author Topic: Loading hex-file  (Read 651 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.
I want to load a bootloader.hex file in my POB-168 module but the problem is i can not load these hexfile in the Arduino 022. these say: only a .pde file .
How can i load the bootloader in my POB-168?
Thanks.
              Jackpo.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33321
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need a programmer. It is a separate piece of hardware, there are lots about to make or buy, you can even use an arduino:-
http://www.arduino.cc/playground/Code/Programmer2
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes i have a programmer. Can i use bascom and programmer to load these hex file into the POB-168?
What abour fuse settings befor and after loading the hex file?

Jackpo.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33321
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know what bascom is so I can't say.
Do not change the fuse settings at all keep them the same.
Logged

Fresno, CA, USA
Offline Offline
Full Member
***
Karma: 1
Posts: 153
Arduino rocks (literally, with a WaveShield!)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A hex file is a precompiled, ready to run program in hex format... it can't be compiled in Arduino since it's already compiled. Sadly, the Arduino IDE isn't robust enough to acknowledge the existence of precompiled code, so it has to be uploaded manually, outside Arduino.

Not sure what a POB-168 is, but by "168" I'm guessing you've got an old ATmega168 chip you need to program the bootloader for? In that case, you might just want to open your Arduino folder, go to hardware\arduino\bootloaders\atmega, rename ATmegaBOOT_168_diecimila.hex to ATmegaBOOT_168_diecimila.hex.bak, and copy your HEX file into there as "ATmegaBOOT_168_diecimila.hex", then you can use the Arduino IDE to program it... but be sure to open hardware\arduino\boards.txt to verify that your fuses for "diecimila.bootloader" are correct! It could prevent your chip from working at all if you don't use a 16MHz crystal on the board, since Arduino changes the fuses in order to program it.

If you decide to do it manually, you have to change the lock bits in order to reprogram the bootloader. The only way to use the bootloader to upload a program is to "lock" the bootloader section so it *itself* is not erased every time a program is uploaded with it. So the bootloader needs to be "unlocked" (lock bits 0x3F) to erase and reprogram it, then "locked" (0x0F) to prevent accidental erasure when a program is loaded.
Logged

Pages: [1]   Go Up
Jump to: