avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] attiny10 with ftdi and bitbang


From: Darell Tan
Subject: Re: [avrdude-dev] attiny10 with ftdi and bitbang
Date: Sat, 30 Jun 2012 01:17:02 +0800

Hi Matt,

Here's my command line (on my Mac):

avrdude -vv -p t10 -P /dev/tty.usbserial-A6007ul6 -c dasaftdi

And the working output should be:

...
bitbang_cmd_tpi(): [ 72 ] [ 00 ]
bitbang_cmd_tpi(): [ F3 00 ] [ ]
bitbang_cmd_tpi(): [ 68 C0 ] [ ]
bitbang_cmd_tpi(): [ 69 3F ] [ ]
bitbang_cmd_tpi(): [ 24 ] [ 1E ]
bitbang_cmd_tpi(): [ 24 ] [ 90 ]
Reading | #################                                  | 33% 0.40s
bitbang_cmd_tpi(): [ 24 ] [ 03 ]
Reading | #################################                  | 66% 0.47s
Reading | ################################################## | 100% 0.47s

avrdude: Device signature = 0x1e9003

The last 3 cmd_tpi should return the device signature bytes, which in
your case are all zeroes. The odd thing is, your tiny10 seems to be
correctly framing those zeroes. If the tiny10 had just not responded
all the way, you would see an error that says "stop bits not received
correctly".

If it's stuck in that loop, it's basically calling program_enable,
which sends CMD_SKEY and expects the NVMEN bit in the TPISR register
to be set.

--
Regards,
Darell Tan


On Fri, Jun 29, 2012 at 11:22 PM, matthew venn <address@hidden> wrote:
> Hi all,
> I've been working to reproduce work I found here:
> http://irq5.wordpress.com/2010/07/15/programming-the-attiny10/
>
> I'm using avrdude 5.11 on ubuntu10.04
>
> I've added this to avrdude.conf:
>
> programmer
>  id    = "dasaftdi";
>  desc  = "tiny10 no reset, sck=!rts mosi=!txd miso=!cts";
>  type  = serbb;
>  sck   = ~7;
>  reset = ~1;
>  miso  = ~8;
>  mosi  = ~3;
> ;
>
> The command I'm using is:
> ./bin/avrdude -p attiny10 -c dasaftdi -P /dev/ttyUSB0 -v -v -v -v
>
> I've got to the stage where I can see the clock and mosi/miso lines going
> (with a scope) but avrdude always times out.
> Looking through the code (bitbang.c) and adding some debugging I found it's
> in a loop waiting for something to happen:
>
> tries = 0;
>    do {
>      rc = pgm->program_enable(pgm, p);
>      if ((rc == 0)||(rc == -1))
>        break;
>      pgm->highpulsepin(pgm, pgm->pinno[p->retry_pulse/*PIN_AVR_SCK*/]);
>      fprintf(stderr, "retry pulse\n");
>      tries++;
>    } while (tries < 65);
>
> But I'm afraid I can't work it out. The comment above say's its waiting for
> a response of 0x53 but I can't see that referenced in the code, the
> attiny10 config or in Atmel's tpi pdf:
> http://www.atmel.com/Images/doc8373.pdf
>
> If I return 0 before this code then avrdude continues but never receives
> anything back from the chip:
>
> avrdude: Calibrating delay loop... calibrated to 306 cycles per us
> doing MOSI-MISO link check
> MOSI-MISO link present
> avrdude: AVR device initialized and ready to accept instructions
>
> Reading |                                                    | 0%
> 0.00sbitbang_cmd_tpi(): [ 72 ] [ 00 ]
> bitbang_cmd_tpi(): [ F3 00 ] [ ]
> bitbang_cmd_tpi(): [ 68 C0 ] [ ]
> bitbang_cmd_tpi(): [ 69 3F ] [ ]
> bitbang_cmd_tpi(): [ 24 ] [ 00 ]
> bitbang_cmd_tpi(): [ 24 ] [ 00 ]
> Reading | #################                                  | 33%
> 9.00sbitbang_cmd_tpi(): [ 24 ] [ 00 ]
> Reading | ################################################## | 100% 10.45s
>
> avrdude: Device signature = 0x000000
> avrdude: Yikes!  Invalid device signature.
>         Double check connections and try again, or use -F to override
>         this check.
>
> However, the TPI ident tag is being read correct, and the MOSI-MISO link is
> working.
>
> I've also tried using -i with values from 1 to 100000.
>
> I'm giving up for today, but if anyone can think of something to try next
> I'd appreciate it!
>
> Matt
>
> --
> Matthew Venn
> mattvenn.net
> _______________________________________________
> avrdude-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avrdude-dev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]