External crystal on fuses

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, i'm a rookie in electronic (never touched an avr until now) and i'm having trouble with the fuses selection to flash my atmega88

as instruction from a circuit that i'm making i've:

The ATmega88 should be configured for a 20 MHz crystal oscillator and no
internal clock divider. This corresponds to the following fuse bits:

    LOW:        11100111    (write e7, read e7)
    HIGH:        11011111    (write df, read df)
    EXTENDED:    xxxxx001    (write f9, read 01)

You need to program the LOW fuse byte with e7. Keep the factory defaults for
the others fuse bytes.

I'm using avr studio 4 and i have no idea of how should i configure the fuses as i've always a warning verification message.

instruction told that i should select 20Mhz and no clock but on the SUT_CKSEL list there is no external 20Mhz ?

Ext. Clock; Start-up time PWRDWN/RESET: 6 CK/14 CK + 0 ms;  
Ext. Clock; Start-up time PWRDWN/RESET: 6 CK/14 CK + 4.1 ms;
Ext. Clock; Start-up time PWRDWN/RESET: 6 CK/14 CK + 65 ms;  
Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 0 ms;  
Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 4.1 ms;
Int. RC Osc. 8 MHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 65 ms;  
Int. RC Osc. 128kHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 0 ms;  
Int. RC Osc. 128kHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 4.1 ms;
Int. RC Osc. 128kHz; Start-up time PWRDWN/RESET: 6 CK/14 CK + 65 ms;  
Ext. Low-Freq. Crystal; Start-up time PWRDWN/RESET: 1K CK/14 CK + 0 ms;  
Ext. Low-Freq. Crystal; Start-up time PWRDWN/RESET: 1K CK/14 CK + 4.1 ms;
Ext. Low-Freq. Crystal; Start-up time PWRDWN/RESET: 1K CK/14 CK + 65 ms;  
Ext. Low-Freq. Crystal; Start-up time PWRDWN/RESET: 32K CK/14 CK + 0 ms;  
Ext. Low-Freq. Crystal; Start-up time PWRDWN/RESET: 32K CK/14 CK + 4.1 ms;
Ext. Low-Freq. Crystal; Start-up time PWRDWN/RESET: 32K CK/14 CK + 65 ms;  
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 258 CK/14 CK + 4.1 ms;
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 258 CK/14 CK + 65 ms;  
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 1K CK /14 CK + 0 ms;  
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 1K CK /14 CK + 4.1 ms;
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 1K CK /14 CK + 65 ms;
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 16K CK/14 CK + 0 ms;  
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 16K CK/14 CK + 4.1 ms;
Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms;
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 65 ms;
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 0.4-0.9 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms;
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 0.9-3.0 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 3.0-8.0 MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 258 CK/14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 1K CK /14 CK + 65 ms;  
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 0 ms;  
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 4.1 ms;
Ext. Crystal Osc.; Frequency 8.0-    MHz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms;  

what's should i select ?

 

Regards

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use "Ext. Full-swing Crystal; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms;"

 

Full swing is needed for 8MHz and above, the other parameters may be different but I always use the longest start up time so that other peripherals, if any, have time to wake up.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks js, it worked !

Also now i have another problem related to the firmware binaries, i have no problem to program the flash but i've an issue to upload the raw eeprom.

AVR Studio continue to told me:

Getting isp parameter.. SD=0x02 .. OK

The specified file is not a valid Intel HEX file

do i need to convert the 'raw' eeprom to 'hex' to have a file like flash.hex ?

I've found a solution by using directly avrdude but i'd like to know if there is something to do on avr studio ?

C:\WinAVR-20100110\bin>avrdude -c usbtiny -p m88 -U eeprom:w:eeprom.raw

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e930a
avrdude: reading input file "eeprom.raw"
avrdude: input file eeprom.raw auto detected as raw binary
avrdude: writing eeprom (459 bytes):

Writing | ################################################## | 100% 2.52s

 

avrdude: 459 bytes of eeprom written
avrdude: verifying eeprom memory against eeprom.raw:
avrdude: load data eeprom data from input file eeprom.raw:
avrdude: input file eeprom.raw auto detected as raw binary
avrdude: input file eeprom.raw contains 459 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 0.45s

 

avrdude: verifying ...
avrdude: 459 bytes of eeprom verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

do i need to convert the 'raw' eeprom to 'hex' to have a file like flash.hex ?

Yes, the eeprom.raw in that eeprom.zip is clearly binary. What build system did you use to generate this?

 

The fact that you quote avrdude from WinAVR suggests you might be using avr-gcc but if that is the case surely your makefile has a rule to generate a "program.eep" file with the EEPROM data? If it is avr-gcc what rules are in the Makefile that mention "objcopy"? The chances are you might only need to change a "-O binary" to be "-O ihex".