Go Down

Topic: Atmega168 bootloader internal 8Mhz (Read 10410 times) previous topic - next topic

Brad Burleson

I checked the Arduino boards and thought they would all use external crystals. The LilyPad got one too?

All but the ATmega168 version, yes (which means the '328 version uses an external crystal/resonator).

I didn't mean to muddy the waters here, I was just trying to point out that if you want to burn a bootloader for an ATmega168 to run at 8MHz (with the internal oscillator) don't pick the pro mini but select the "LilyPad Arduino w/ ATmega168" (then "Burn Bootloader" from the menu).  That will work on a stock install, out of the box so to speak.

If it's not a software problem as westfw suggests, perhaps it's time to post a picture of your setup?




I am on 1.0.1.

@Brad: Thanks for the info, I'll keep it in mind!
I have several Atmega168A but they all show the same behaviour by now.

Burning bootloader for external 8Mhz or 16Mhz: everything works as supposed to (with the crystal of course), ASCII example works fine, serial flashing works

Burning Lilypad bootloader with internal 8Mhz: Clock seems pretty off. ASCII example at 115200 works fine but this is at 9600 (anything below 115200 is not much better)
Maybe that is why it cannot be flashed with 19200 bauds via serial.
But how come?
There is not much to see: a 10k pull up, the SPI pins and Rx,Tx and the blick cable I use to reset the bootloader.

Internal 8Mhz at 9600bauds:
Code: [Select]
Áª¥É¢?b«~¡a®ôY.j?pC¡b V:?3 Â?x'?± zt'¢1 ?¥n'?0?0LHHb"?c'?4 B?x'?2,zt'¢2 ¥n'?0?1j
$ "?ã'?5 B?x'?³ zt'¢3 ¥n'?0?1LH$ ¢?c'?6 Â?ø'?´ úô'¢4 ¥n'?0?0j?I ¢?c'?ºbB?áé 2M zt'¢ªb¥¹é 10?0LHÈb"?é 38, hYé & zt'¢²b¥n'?0?1j
 "?é 39,B?x'?7 zt'¢ºbbZË?±?1Ìj??dY,4b «á:?8 zt'ª0 ¥n'?0L?0C¡? "?c'¢1 Â?x'?9 zt'ª1 ¥n'?0L?1
!?dY,4& B?á: 2A, oct:ª2 ¥¹:??????j
+ "?c'¢3 B?áé 2B zt'ª3, bin: L?0Lj??dY,4 B?áé 2C zt'ª¢b¥¹é 101100
-, dec: 45, hex: 2D zÑé 55, bin: 10L??
!?dY,4 B?á:?Å út'ª6 ¥n'?0L?0C¡?dec: 47,B?á:?2± oct: 57, bin:?01L?
!b VÖé b «áé 30,zt'²0 ¥n'??0000
1, dec:¢9 B?áé 31, kÑ:²1, bin: 110001
& "?c'ª0 B?x'?2 zt'²2 ¥¹é 110010
3 "?: 51, hex: 33,zt'²3 ¥¹é L?0Lj
 "?c'ª2 B?x'?´ zô'²4 ¥¹:?1?0j
M "?c'ª3,B?ø'?µ zt'²5 ¥n'?1?°ÌH6 "?c'ª4 Â?ø'?¶ zt'²6 ¥î'?1?1j
 "?c: M B?ø'?7 zt: Ób ¬Ëé L?1Lj
b V:ª6 B?x'?8 zt'º0 ?¥î'?±L?0C¡bdY,5 B?x'?9 zt'º1 ¥n'?1L?1C!â Öºª8 B?x'?A zô'º2 ¥î'?1L?0C¡b V:ª9, hex: 3( zt'º3 ¥¹é 111?1C!b V:²0, hex:?C zt'º¢b¥n: 111100
=, dec: 61, hex: & zÑé 75, bin: 11LL?j
>, dec: 62, hYé 3E, oct: 76, bin: L????j
?, dY,63 B?x'?2± oct: 77, bin:??11Lj
± V:²4 B?x: 40, oct'?0b ¬ËK1000000
¡± V:²5, hex: 41, oc?1?b ¬ËK???????j
( "?: 66, hex'¢2 zt:?02, bin: 1?0?0
¡± dec: 67, heé Ób oct: 103, biK1?0??j
D, dec:²8 B?á: 44, oct: 104, bin: 1000100
E,"?c'²9, hex: 45, oct: 105, bin: 1000101
F "?c'º?bB?áé 46, oct:??²b¥¹é 1000L?j
G, dec: 71, hex: 47, oct: 107, bin: 1000111
H, dec: 72, hex: 48, oct: 110, bin: 1001000
I, dec: 73, hex: 49, oct: 111, bin: 1001001
J, dec: 74, hex: 4A, o,????,¥n'?0?0Lj
K, dec: 75, hex: 4B, oct: 113, bin: L??0LLHL, dec: 7 Â?x'¢C, oct: 114, bin: 1001100
M, de,7 B?áé 4D, oct:?15 ¥n'???????j
N "?é 78, hex: 4E, oct'??²b¥¹é 1001110
O, dec: 79, hex: 4F zt'??ºb¥¹é 1?1L?j
P, dec: 80, «á:ª0 zÑé 120, bin'?0L?0j
T "?é ?,B?x:ª1, oct: L¦b ¬Ëé 1010001
R "?c'Â2 B?x'ª?bzt:?22, bin: 1010?0C¡ÅdY,'Â?, hex: 53 zt'???b¥¹é 10100LLC! "?é 84, heé M zÑ: 124, bin:?0L???j
U, dec: 85,B?á: 55, oct: 125,¥n: 1010101
V, V:Â6 B?x: 56, o,?1& ¥¹: 10L?1j
 "?é º,B?áé 57, kÑ: 1¦ ¥¹é 10101LLHX "?c'Â8 B?x'ª8 zt'?3b¥¹é 1011000
Y, dec: 89, hex: 59, oct: 131, bin: 1011001
Z, dY,9b «á:ª
± oct: 132, bin: 1011010
[, V: NbB?áé 5B, kÑé 133, bin: 1011011
Å"?é N& B?x'ªC zÑé 134,¥¹é L?1L?
¡ÅdY,'Ê3 B?x'ª"± o,?1¦ ¥n'?0L?0LHÈÅdY,'Ê4 B?x'ªE,zt'?3 ¥n'???1L?
¡ÅdY,9M B?x: 5F, kѺ?³ ¥n: 1??1Lj
± ÖºÊ6 B?x:²0 úô'?4b ¬Ëé LL?0?
¡± V:Ê7 B?x'²± zt'?4L ¥n'?1?0?
!± dY,9b «á:²?bzÑé 14& ¥n'?1?010
c, de,9N B?x'²3 zt'?´& ¥¹é 1100011
! "?c'???bB?áé 64, kÑ:?4 ¥n'????1?
¡ "?: L?bB?áé 65, oct: 145, bin: LL????j
f, dec: 102, hex: 66, oct: 146,¥¹é 1100110
g, dec: 103, hex: 67, oct: 14 ¥n'???0111
h, dec: L¢b heé b kÑé 150, bZK1L?000
i, dec: 105, hex: 69, oct: 151, bZK1L?0?j
j, dec'?0 B?áé S± oct: 1M& ¥n'???1010C¡?dY,1º,B?x:²± kÑ: 153, bin: 11?0Lj
?dY,'??ÂbB?áé Ó± kÑé 154,¥n'?1?1?
¡? "?é 109, hex: 6D, oct: 155 ¥n'?1?1?j
n, dY,1Lb «áé S zt'?5 ¥¹: 1101LLj
?dY,1LL B?áé 6F, oc?1M ¥¹é L?±Ì?
!± dY,'???bB?áé 70, oct: 160, bin'?110000
q, dec: 113, hex: 71, oct: 1Sb ¬Ëé 1110001
. "?c'??¢bB?áé 72, oct: 162, bin: 11100Lj
s, dec: 115, hex'º3 zt: 163, bin'?1L???
! "?c'?1 B?x'º¢bzÑé 164,¥¹é 1110100
u, dec: 117, hex: 75, oc?1Sb bin: 111?0LHv ¢?c'??ÂbB?áé 76 zt'?6 ¥¹é L?0L?
¡ "?é 119, hYé Ó zÑ:?6 ¥n'?1L???j
x, dec: 120, hex: 78, oct: 170 ¥n'?111000
^ "?c'?21, hex: 79,zt'?71 ¥¹é 1L?0?
¡± V:?2& B?x'º
± oct: 172, bin'?1L???j
{, dec: 123, hex: 7B, oct: 173, ¬Ëé LLLL??j
|, dec: L& B?x'ºÃ zt: 17 ¥¹é 11LLL?
¡± Vé 125, hex: 7D, kÑé 175, bin: 1111101
~, dec: 126, hex:º*± oct: 176, bin: 1111110


If the chip fuses set to external oscillator, you can't upload any bootloader but with external oscillator connected, even if you tring to set fuses for internal oscillator.
?????? ?????? ?????, ??? ??? - ??????????!


Why not?
If I use the Lilypad bootloader, it should use the internal osc?


A clock is required for the ISP circuitry to function, so if the chip fuses are set to use an external oscillator (or external crystal, which is not the same thing), it MUST have one before you can even set the fuses back to use the internal oscillator.


I had an external osc attached, otherwise the fuse burning would not have been successful, as you said.


Hello. I'm new on ARDUINO but with a lot of experience in SHARK, FPGA and others. I has a KK V2 board with ATMEGA168PA without external oscillator. I program is using USBasp ISP programmer and eXrteme Burner as burinig program. Now what happens I burn the file "ATmegaBOOT_168.hex" and everything was OK. After I burn also the fuses values with values that eXrteme Burner generate them (it has a window that you define the internal RC oscillator frequency and so on) the processor "disappear". The burning program can't connect to the processor, cant read the internal FLASH or anything else.
So what happens and what can be done now ? Somebody can explain ?


In order to  talk to a programmer via ISP, the AVR chip needs to have a valid clock.  The fuses control the source of the clock, and by error it is possible to set that source to something that doesn't exist (typically "external oscillator" when you meant "external crystal", or "extern crystal" when there isn't one connected.)  At that point, the programmer can no longer talk to the chip.

You can usually recover from this by injecting a clock signal into the appropriate pin.


Go Up