Glad to hear that AVR is alive again. By the way I use same embedded
calculator, it never let me down :)



2014-04-25 19:01 GMT+02:00 YuGiOhJCJ Mailing-List <
[email protected]>:

> On Fri, 25 Apr 2014 15:16:23 +0200
> Martin Stejskal <[email protected]> wrote:
>
> >  I know I just repeat Ormund answer, but.... do You have connected 8 MHz
> > crystal (or any from 8 to 20 MHz) to your attiny2313 (pin 4 and pin 5)?
> > Reason why AVR stop responding to avrdude is, that fuses changed clock
> > source to external crystal. Until You not connect crystal, AVR will not
> > have clock source, so it can not run!  Meanwhile in default factory
> > settings is used internal clock source (so AVR have clock without need
> any
> > external components). So connect crystal to pin 4 and pin 5 and then
> > connect programming signals. Then AVR should respond. Rule of thumb: do
> not
> > change fuses until you really know what are you doing. At least look at
> > some fuse calc.
> >
> >
> > 2014-04-25 14:38 GMT+02:00 YuGiOhJCJ Mailing-List <
> > [email protected]>:
> >
> > > On Thu, 24 Apr 2014 23:26:06 -0400
> > > Ormund Williams <[email protected]> wrote:
> > >
> > > > On Fri, 2014-04-25 at 02:45 +0200, YuGiOhJCJ Mailing-List wrote:
> > > > > avrdude: error: programm enable: target doesn't answer. 1
> > > > ...snip...
> > > > > I was able to do it just before I typed this:
> > > > > $ sudo avrdude -p t2313 -c usbasp -U hfuse:w:0xdb:m -U
> lfuse:w:0xef:m
> > > > >
> > > > Are the fuse settings what you intended? an lfuse of 0xef means that
> you
> > > > have a high frequency crystal attached, do you?
> > > >
> > >
> > > In fact, it is the first time I change the fuse settings on a
> > > micro-controller.
> > > My objective was to build an USBtinyISP programmer (it uses an
> attiny2313
> > > micro-controller).
> > > I read that I have to do two things :
> > > - send the firmware to the flash memory of my attiny2313
> > > - change its fuse settings to have a high frequency
> > >
> > > Also, in the Makefile I found in the USBtinyISP firmware archive, I can
> > > read:
> > > $ cat usbtinyisp/spi/Makefile | grep avrdude
> > > FLASH_CMD       = avrdude -c avrisp -pt2313 -U flash:w:main.hex
> > > FUSE_CMD        = avrdude -c avrisp -pt2313 -U hfuse:w:0xdb:m -U
> > > lfuse:w:0xef:m
> > >
> > > So that is why I have used these settings.
> > > But now, I am unable to use avrdude again to send a program to my
> > > attiny2313 flash memory.
> > > Is there a way to come back to the previous state where my attiny2313
> was
> > > perfectly working ?
> > >
>
> Thank you Martin you found.
> Indeed, it was necessary to connect crystal to pin 4 and pin 5.
> In fact, I have not used exactly a crystal but a ceramic resonator (ZTA
> 12.00MT).
> Anyway, now it works:
> ---
> $ sudo avrdude -p t2313 -c usbasp -U flash:w:main.hex
>
> avrdude: warning: cannot set sck period. please check for usbasp firmware
> update.
> avrdude: AVR device initialized and ready to accept instructions
>
> Reading | ################################################## | 100% 0.00s
>
> avrdude: Device signature = 0x1e910a
> avrdude: NOTE: FLASH memory has been specified, an erase cycle will be
> performed
>          To disable this feature, specify the -D option.
> avrdude: erasing chip
> avrdude: warning: cannot set sck period. please check for usbasp firmware
> update.
> avrdude: reading input file "main.hex"
> avrdude: input file main.hex auto detected as Intel Hex
> avrdude: writing flash (2038 bytes):
>
> Writing | ################################################## | 100% 1.08s
>
>
>
> avrdude: 2038 bytes of flash written
> avrdude: verifying flash memory against main.hex:
> avrdude: load data flash data from input file main.hex:
> avrdude: input file main.hex auto detected as Intel Hex
> avrdude: input file main.hex contains 2038 bytes
> avrdude: reading on-chip flash data:
>
> Reading | ################################################## | 100% 0.64s
>
>
>
> avrdude: verifying ...
> avrdude: 2038 bytes of flash verified
>
> avrdude: safemode: Fuses OK
>
> avrdude done.  Thank you.
>
> ---
> After that, as I want to be able to set the default attiny2313 fuse
> settings, I have typed this:
> $ sudo avrdude -p t2313 -c usbasp -U lfuse:w:0x64:m -U hfuse:w:0xdf:m -U
> efuse:w:0xff:m
>
> Thanks to the calculator [1] that gave me the default values.
>
> Now, my attiny2313 works fine like before.
> It does not need anymore to put a ceramic resonator between pins 4 and 5.
>
> Problem solved.
>
> [1] http://www.engbedded.com/fusecalc
>
> _______________________________________________
> AVR-chat mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/avr-chat
>
_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to