Need crystal for processor in the ATmegaxx8 target board?

edited June 2015 in General
Hi,
I am having trouble with my ATmegaxx8 target board together with the adafruit USBTinyISP. It was suggested that i might need a crystal since the processor in the dev kit might be configured for external crystal and not internal. Can anyone confirm if the processor in the ATMegaxx8 target board dec kit is configuted for an external crystal? I get the same failure to write boot loader when I use the same 328P processor with I bought from RS.

Comments

  • A "raw" ATmega328 from the factory is configured to run from its internal clock, and does not require an external crystal. Our ATmegaXX8 mini dev kits come with a raw chip, unless specially ordered otherwise.

    However, once it is programmed with a bootloader that expects an external crystal (or technically, once its "fuse" bytes are set to require one-- which happens as part of that programming process), it does require a crystal.

    If you do not have a crystal on your target board, and you tried to program a bootloader, it's possible that you may have *succeeded* once, which will make it so that it cannot be reprogrammed, at least until you add the crystal and caps.
  • Thanks,
    I got the same result with one other processor that I bought from RS and also should be with factory settings. I think it is unlikely that both would write halfway once, even if it might happen.

    I have resolve red every joints and checked that the processor have correct vcc. The green light on the programmer is lighted and the red flashes once before I get error message rc=-1
  • There are a few things that all need to work correctly for it to program:

    - The programmer
    - The chip
    - The connection between them
    - The software

    There's not much that I can say, except that you need to check each of those things to find out where the error is.  I've been there a few times, and I usually feel pretty silly after finding the error that I missed (backwards cable? no power? wrong software command?).

    Do you have the external crystal installed? And, are you trying to install a bootloader that requires one?
  • edited June 2015
    Hi again,
    I know all to well what you mean by feeling silly after finding an error... Arduino is s re experience for me though.

    I did not have an external crystal installed, since the processor is not supposed to need one, I did not install it.
    I think that might be second on my todo list..

    First is to try to make an install on a Windows laptop and see how that work, I have been trying on My iMac up until now.
    This will give me a full new setup and different software installation so if the result is replicated I can look into the programmer or cable.

    As I said, I am beginner so I have mainly used the Arduino IDE to send write boot loader command to the programmer.
  • With this setup, you'll need to be very careful, since most of the bootloaders in the IDE *do* require a crystal. Which bootloader have you been writing?
  • ah.. well thats a problem, too. I just wrote the one default in the IDE...

    Arduino: 1.6.4 (Mac OS X), Board: "Arduino Uno"
    /Applications/Arduino 1.6.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino 1.6.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cusbtiny -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 
    avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch
             System wide configuration file is "/Applications/Arduino 1.6.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
             User configuration file is "/Users/stefangutehall/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
             Using Port                    : usb
             Using Programmer              : usbtiny
    avrdude: usbdev_open(): Found USBtinyISP, bus:device: 020:008
             AVR Part                      : ATmega328P
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PC2
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
               flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
  •         Programmer Type : USBtiny
             Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
    avrdude: programmer operation not supported
    avrdude: Using SCK period of 10 usec
    avrdude: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.
    avrdude done.  Thank you.
    Error while burning bootloader.
  • Yes; the Uno bootloader does require the external crystal. If you try (even once with partial success) to burn this bootloader, it can convert your chip to the state of requiring an external crystal.
  • Thanks,

    After i tried on a windows machine I will order a crystal (and caps unless i have them) from RS here in Hong Kong, with luck Ill have it tomorrow.

    Instead of Arduino IDE, what method would you recommend to burn boot loader?
  • The Arduino IDE is a fine method to burn a bootloader-- one of the easiest and most reliable. Just make sure that your hardware setup is matched to the bootloader that you choose.
  • Update: Just installed crystal and capacitors on the board and tried to burn boot loader again. 

    Success on both processors. Thanks for all the help!
  • Awesome-- glad to hear it!
Sign In or Register to comment.