avrdude: Version 6.1, compiled on Jan 22 2015 at 01:13:43 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf" User configuration file is "/home/dzhus/.avrduderc" User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0 Using Programmer : buspirate AVR Part : ATtiny13 Chip Erase delay : 4000 us PAGEL : P00 BS2 : P00 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 :
Could you check if it works with avrdude built from SVN trunk? http://savannah.nongnu.org/svn/?group=avrdude There've been several changes regarding BP support in avrdude over the last few months, judging by commit history.
avrdude: Version 5.11svn, compiled on Apr 7 2013 at 03:02:38 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "avrdude.conf" User configuration file is "/home/dzhus/.avrduderc" User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0 Using Programmer : buspirate AVR Part : ATtiny2313 Chip Erase delay : 9000 us PAGEL : PD4 BS2 : PD6 RESET disposition : possible i/o 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 :
avrdude: Version 5.11svn, compiled on Apr 7 2013 at 03:02:38 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "avrdude.conf" User configuration file is "/home/dzhus/.avrduderc" User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0 Using Programmer : buspirate Setting bit clk period : 32.0 AVR Part : ATtiny2313 Chip Erase delay : 9000 us PAGEL : PD4 BS2 : PD6 RESET disposition : possible i/o 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 :
I've rechecked my AVR chips using my Arduino acting as a STK500v1-compatible programmer and they all respond just fine, producing expected device signatures. I hear clicking noise on SPI lines when using BusPirate (I use a piezo buzzer as a poor man's oscilloscope), though the pattern differs from that when using Arduino as an ISP.
I noticed this in the avrdude manpage:
Quote
It may be a good idea to decouple the BusPirate and the AVR's SPI buses from each other using a 3-state bus buffer. For example 74HC125 or 74HC244 are some good candidates with the latches driven by the appropriate reset pin (cs, aux or aux2). Otherwise the SPI traffic in one active circuit may interfere with programming the AVR in the other design.
What is this all about and what other traffic appear on SPI line when I simply connect my BP to a bare AVR chip?
I also tried falling back to ascii mode of BP, it fails as well:
Detecting BusPirate... avrdude: buspirate_readline(): # avrdude: buspirate_readline(): RE avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC avrdude: buspirate_readline(): Firmware v6.1 r1676 Bootloader v4.4 avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3) avrdude: buspirate_readline(): http://dangerousprototypes.com avrdude: buspirate_readline(): HiZ> ** avrdude: buspirate_send(): W avrdude: buspirate_readline(): W avrdude: buspirate_readline(): Command not used in this mode avrdude: buspirate_readline(): HiZ> avrdude: warning: did not get a response to PowerUp command. avrdude: warning: Trying to continue anyway... avrdude: buspirate_send(): { avrdude: buspirate_readline(): { avrdude: buspirate_readline(): ERROR: command has no effect here avrdude: buspirate_readline(): Syntax error at char 1 avrdude: buspirate_readline(): HiZ> avrdude: buspirate_send(): 0xac 0x53 0x00 0x00 avrdude: buspirate_readline(): 0xac 0x53 0x00 0x00 avrdude: buspirate_readline(): WRITE: 0xACERROR: command has no effect here avrdude: buspirate_readline(): avrdude: buspirate_readline(): Syntax error at char 4 avrdude: buspirate_readline(): HiZ> avrdude: error: SPI has not read 4 bytes back avrdude: initialization failed, rc=-2 Double check connections and try again, or use -F to override this check.
avrdude: buspirate_send(): w avrdude: buspirate_readline(): w avrdude: buspirate_readline(): Command not used in this mode avrdude: buspirate_readline(): HiZ> avrdude: warning: did not get a response to PowerDown command. avrdude: buspirate_send(): # avrdude: buspirate_readline(): # avrdude: buspirate_readline(): RE avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC avrdude: buspirate_readline(): Firmware v6.1 r1676 Bootloader v4.4 avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3) avrdude: buspirate_readline(): http://dangerousprototypes.com avrdude: buspirate_readline(): HiZ>
avrdude done. Thank you.
But I suspect it's just avrdude not switching BusPirate to SPI mode properly.
The whole problem persists with avrdude built from current SVN trunk (r1139) too.
avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.
avrdude done. Thank you.
and sometimes (4 times out of 5) it fails with yet another error:
Programmer Type : STK500V2 Description : Atmel STK500 Programmer Model: AVRISP Hardware Version: 2 Firmware Version Master : 2.10 Vtarget : 5.0 V SCK period : 199.7 us
avrdude: stk500v2_command(): command failed avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check.
avrdude done. Thank you.
I tried with various values of -B but it never reads device signature properly. Same when using BP firmware.
Since MISO/MOSI and CS pins are confirmed to work on my BP, it's either SCK pin or my wires being just too long.
avrdude: Version 5.11.1, compiled on Jul 1 2012 at 15:16:59 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf" User configuration file is "/home/dzhus/.avrduderc" User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyUSB0 Using Programmer : buspirate AVR Part : ATtiny13 Chip Erase delay : 4000 us PAGEL : P00 BS2 : P00 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 :
Programmer Type : BusPirate Description : The Bus Pirate
Detecting BusPirate... avrdude: buspirate_readline(): # avrdude: buspirate_readline(): RE avrdude: buspirate_readline(): Bus Pirate v3.b clone w/different PIC avrdude: buspirate_readline(): Firmware v6.1 r1676 Bootloader v4.4 avrdude: buspirate_readline(): DEVID:0x044F REVID:0x3003 (24FJ64GA004 A3) avrdude: buspirate_readline(): http://dangerousprototypes.com avrdude: buspirate_readline(): HiZ> ** BusPirate: using BINARY mode BusPirate binmode version: 1 BusPirate SPI version: 1 avrdude: initialization failed, rc=-2 avrdude: AVR device initialized and ready to accept instructions avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. avrdude: Expected signature for ATtiny13 is 1E 90 07 BusPirate is back in the text mode
avrdude done. Thank you.
I tried this with ATtiny13A, ATtiney 2313 and several ATmega 328P's. Still I can burn these chips using ArduinoISP programmer, so it looks like the problem is really with connections.
I'm trying to find out if my circuit is correct. Datasheets on AVR chips I have (ATmega 328P, ATtiny 2313 and 13A) all describe similar procedure for serial programming:
Quote
1. Power-up sequence: Apply power between VCC and GND while RESET and SCK are set to “0”. In some sys- tems, the programmer can not guarantee that SCK is held low during power-up. In this case, RESET must be given a positive pulse after SCK has been set to “0”. The pulse duration must be at least tRST (miniumum pulse widht of RESET pin, see Table 18-4 on page 120 and Figure 19-58 on page 153) plus two CPU clock cycles.
2. Wait for at least 20 ms and enable serial programming by sending the Programming Enable serial instruction to pin MOSI.
3. The serial programming instructions will not work if the communication is out of syn- chronization. When in sync. the second byte (0x53), will echo back when issuing the third byte of the Programming Enable instruction. Whether the echo is correct or not, all four bytes of the instruction must be transmitted. If the 0x53 did not echo back, give RESET a positive pulse and issue a new Programming Enable command.
So I switch to SPI mode, power the chip with 'W', enable pull-ups on SPI lines 'P', then issue a reset pulse by pulling reset pin up with 'A' and then low with 'a' (AUX pin of BP is connected to RESET). Now I try to send the byte enable command and see if it echoes back:
SPI>v Pinstates: 1.(BR) 2.(RD) 3.(OR) 4.(YW) 5.(GN) 6.(BL) 7.(PU) 8.(GR) 9.(WT) 0.(Blk) GND 3.3V 5.0V ADC VPU AUX CLK MOSI CS MISO P P P I I I O O O I GND 3.26V 5.02V 0.00V 5.02V H L L H H SPI>A AUX HIGH SPI>a AUX LOW SPI>0xAC 0x53 r 0x0 WRITE: 0xAC WRITE: 0x53 READ: 0xFF WRITE: 0x00 SPI>
I take it as no success. It always reads back 0xFF instead of 0x53. What could possibly go wrong?
Yes, it works as expected in Transparent bridge mode. When RX/TX are disconnected, nothing appears on the console but random garbage; shorting the pins makes it echo typed characters back.
[quote author="Sjaak"]You could use the uart mode and connect mosi and miso together. It should echo everything you send. [/quote] I tried connecting mosi and miso, leaving other wires unconnected, switched to UART mode in BP console, but after I send any string it reads rubbish: