AVR Doper problem (HV mode doesn't work)

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Fri Sep 14, 2007 6:12 pm

With one debug -v more I get:

Code: Select all

Reading |                                                    | 0% 0.00savrdude: stk500hv_read_byte(.., signature, 0x0, ...)
avrdude: stk500hv_read_byte(): Sending read memory command: Send: 8 bytes: 1b 0d 00 02 0e 3b 00 21  ".....;.!"
Sending 8 bytes data chunk
Received 29 bytes data chunk of total 9
Receive: 1 bytes: 1b  "."
Receive: 1 bytes: 0d  "."
Receive: 1 bytes: 00  "."
Receive: 1 bytes: 03  "."
Receive: 1 bytes: 0e  "."
Receive: 1 bytes: 3b  ";"
Receive: 1 bytes: 00  "."
Receive: 1 bytes: 1e  "."
Receive: 1 bytes: 3e  ">"
avrdude: stk500hv_read_byte(.., signature, 0x1, ...)
avrdude: stk500hv_read_byte(): Sending read memory command: Send: 8 bytes: 1b 0e 00 02 0e 3b 01 23  ".....;.#"
Sending 8 bytes data chunk
Received 29 bytes data chunk of total 9
Receive: 1 bytes: 1b  "."
Receive: 1 bytes: 0e  "."
Receive: 1 bytes: 00  "."
Receive: 1 bytes: 03  "."
Receive: 1 bytes: 0e  "."
Receive: 1 bytes: 3b  ";"
Receive: 1 bytes: 00  "."
Receive: 1 bytes: 92  "."
Receive: 1 bytes: b1  "."
Reading | #################                                  | 33% 0.02savrdude: stk500hv_read_byte(.., signature, 0x2, ...)
avrdude: stk500hv_read_byte(): Sending read memory command: Send: 8 bytes: 1b 0f 00 02 0e 3b 02 21  ".....;.!"
Sending 8 bytes data chunk
Received 29 bytes data chunk of total 9
Receive: 1 bytes: 1b  "."
Receive: 1 bytes: 0f  "."
Receive: 1 bytes: 00  "."
Receive: 1 bytes: 03  "."
Receive: 1 bytes: 0e  "."
Receive: 1 bytes: 3b  ";"
Receive: 1 bytes: 00  "."
Receive: 1 bytes: 06  "."
Receive: 1 bytes: 24  "$"
Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e9206


As you can see, avrdude sends the same data.

The bottom side conains a lot of text, notably:

Code: Select all

5J5  8585B
D    1P
0613 63


I suppose the "D" means that it's revision "D".


The first command sent by avrdude, "1b 0d 00 02 0e 3b 00 21", means:
1b STX
0d
00 number of bytes high
02 number of bytes low
0e Token
3b Read Signature HVSP
00 signature byte address
21 checksum

When I look at AVR-Doper's code, I see that the data input (chip's SDO) is sampled just before the clock pulse is given. Looking at your LA diagrams, this would not always be 0xff. It's also interesting to see that in the first diagram SDO changes level just before the rising edge of SCI.

Have you checked the supply and RESET voltages with a scope during programming? Maybe there are spikes which confuse the chip. It's definitely doing SOMETHING, but not the right thing.

duni
Posts: 11
Joined: Mon Sep 03, 2007 11:50 am
Location: Munich, Germany

Post by duni » Mon Sep 17, 2007 4:58 pm

Code: Select all

 sudo avrdude -c stk500hvsp -P avrdoper -p t45
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.04s
avrdude: Device signature = 0x1e9206
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

I can't be that naive. The transistor for the Vcc was fooling me all the time. Its soldering pad had became loose, so that when I turn the board around to check the connections on the bottom the gravity makes the connection, but when I turn it back the Vcc signal is poor and discontinuous - as one can see on the fifth picture, where Vcc flutters for a moment.
I'm so sorry for bothering you so long for such a stupid problem.
Well, according to the murphy's laws - if a pad could get loose, it gets loose, so solder it good.
And thank you for your support!

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Sep 17, 2007 6:03 pm

Thanks for the very positive information! I'm glad to hear that it was something simple (although hard to find). At least we don't have to fix anything in the firmware...

Post Reply