USBtinyISP issue

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
Post Reply
rv6502
Posts: 23
Joined: Mon Feb 11, 2019 4:27 am

USBtinyISP issue

Post by rv6502 » Fri May 03, 2019 5:58 am

I just finished assembling my Uzebox kit and it all works fine (tried bunch of games) except for the ISP programming with USBtinyISP.

I tested the USBtinyISP with an ArduinoMega2560 both before and after, and that worked fine.

I tried with external power & jumper off, and also with the USBtinyISP powering the Uzebox without a power brick.
With the SD card, without the SD card, with nothing plugged in (no TV, no gamepad).

All give the same result.

It's almost 2am, I'll check the traces again tomorrow but if someone spots something I missed or have seen this issue...

Code: Select all

avrdude -C/home/xuser/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf -v -v -v -v -pm644 -F -cusbtiny -D -Uflash:w:result/executable.hex:i

avrdude: Version 6.3
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/xuser/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
         User configuration file is "/home/xuser/.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: 005:013
         AVR Part                      : ATmega644
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10   128    0 no       2048    8      0  9000  9000 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    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
CMD: [ac 53 00 00] [ff ff ff ff]
CMD: [ac 53 00 00] [ff ff ff ff]
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x102fa9
avrdude: Expected signature for ATmega644 is 1E 96 09

avrdude done.  Thank you.

https://i.imgur.com/uOwiw17.jpg

Photo isn't great, the reflection makes it looks like half the extension connector pins aren't soldered properly.
https://i.imgur.com/bMM0FhX.jpg

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: USBtinyISP issue

Post by Jubatian » Fri May 03, 2019 9:40 am

It should definitely work, I have USBTinyISP myself, and had no problem programming the V1.3.1 revision of the board (neither E-Uzebox). It doesn't seem to be the problem here, but pay attention to whether it is an ATmega644 or an ATmega644P to use the appropriate part identification (ATmega644A and ATmega644PA are also OK for Uzebox). The chip has to be powered, other connections (TV, whether SD is in or not or the SNES controllers) shouldn't matter. By the line "Using SCK period of 10 usec" it seems to me that the programming clock is OK, 100KHz.

I was using commands like "avrdude -c usbtiny -P usb -p m644 -U flash:w:bootloader.hex", AVRdude itself installed from the Debian repo, not needing any particular configuration before use.

rv6502
Posts: 23
Joined: Mon Feb 11, 2019 4:27 am

Re: USBtinyISP issue

Post by rv6502 » Fri May 03, 2019 3:15 pm

Forgot to mention I did try -pm644p too, same result.

I got a ATmega644 20PU on it. (can be seen on the photo)

There's 2 sets of 6-pins through holes for the ISP connector on my board revision but they looked identically wired. I assume it's for the underside ISP cable connector for Uzebox in plastic cases.

The ISP cable powers & resets the Uzebox when programming so that's 3 out of 6 pins that I know are wired okay. :P

User avatar
Janka
Posts: 213
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: USBtinyISP issue

Post by Janka » Fri May 03, 2019 3:45 pm

The device id does not match. This looks like crosstalk. You should check the soldering, and if you had a scope at hand, the rising edges of the signals.

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: USBtinyISP issue

Post by nicksen782 » Fri May 03, 2019 6:06 pm

But, do you consistently get the same device id? This is more indicative of having a different chip. Look on the top of the chip to make sure you have one of the known compable ATMEGA644 chips.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: USBtinyISP issue

Post by Jubatian » Fri May 03, 2019 6:11 pm

rv6502 wrote:
Fri May 03, 2019 3:15 pm
There's 2 sets of 6-pins through holes for the ISP connector on my board revision but they looked identically wired. I assume it's for the underside ISP cable connector for Uzebox in plastic cases.
It looks fine to me on your board, I have the same arrangement (same v1.3.1 PCB, only in black), and just verified that it still works (didn't play around with bootloader stuff since a long while). So like what Janka mentioned, possibly it could even be a short in the communication signals, so you may not even need a scope to spot it. If you are not wholly sure, check whether the ISP cable is wired right (if you used it for the ATmega256 project then it should be, though).

(By the way is it certain that the device ID reported actually came from the device? By experience? Just that there is an initialization failed notification before, makes me think that it could even be a result of printing out uninitialized memory, I don't know. EDIT: Nicksen: It doesn't appear to match anything AVR to me, if it is from the device, it feels more like if it was indeed crosstalk).

rv6502
Posts: 23
Joined: Mon Feb 11, 2019 4:27 am

Re: USBtinyISP issue

Post by rv6502 » Fri May 03, 2019 11:41 pm

I missed one of the USBtinyISP instructions:

Image
If you're not using the USBtiny to talk to a SpokePOV kit, and if you are using a target that has some load on the SCK and MOSI pins, you may need to replace R4 and R7 with jumpers as the 1.5K resistors will have trouble driving the load!
The clock was barely 2Vpp.

Well, that's here for the next person...

User avatar
nicksen782
Posts: 667
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: USBtinyISP issue

Post by nicksen782 » Sat May 04, 2019 12:20 am

So, now do you have it working?

I also have the USBtiny programmer. There is a jumper on it and I have mine connected. I've used mine many times on my Uzebox which is the official hardware. Perhaps you could check the SPI part of your circuit for pull-up resistors?

rv6502
Posts: 23
Joined: Mon Feb 11, 2019 4:27 am

Re: USBtinyISP issue

Post by rv6502 » Sat May 04, 2019 1:11 am

Yeah, it's working now.

The 1.5K resistors were dropping the voltage way too low.

Replaced them with jumper wires.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: USBtinyISP issue

Post by Jubatian » Sat May 04, 2019 10:30 am

rv6502 wrote:
Sat May 04, 2019 1:11 am
Yeah, it's working now.

The 1.5K resistors were dropping the voltage way too low.

Replaced them with jumper wires.
Wow, nice find! I forgot to mention as I wasn't even exactly aware of it: my programmer is actually a Pocket AVR Programmer, which is only based on USBTiny, possibly somewhat different in HW. By the way that SpokePOV also looks to be some wicked thing, a weird interesting "display" with polar coordinates.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest