un1b0x - 2020 EUzebox BOM

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: Unibox - WIP 2020 EUzebox BOM

Post by danboid »

The seller of the programmer replied and suggested I use the -B 7 avrdude option and that seems to have fixed it. He said:
JP1 is only used if you want to update the firmware of the USBasp itself.
If you're flashing a new microcontroller you'll need to set the bit clock using the -B flag to e.g. -B7 as new microcontrollers are clocked at 1 MHz and AVRDUDE expect it to be at least 4MHz. Alternatively, it should also work if you close JP3 which is used to select Slow-SCK.
Let me know if this works.
I got it to work by having no jumpers connected on the USBasp power jumper (JP21) and using the following command:

Code: Select all

 $ sudo avrdude -v -c USBasp -P usb -p m644 -U flash:w:Bootloader5.hex -F -B 7

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 "/etc/avrdude.conf"
         User configuration file is "/home/local/ISDADS/sgs548/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : USBasp
         Setting bit clk period        : 7.0
         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
           flash         33     6   256    0 yes     65536  256    256  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: set SCK frequency to 93750 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9609 (probably m644)
avrdude: safemode: hfuse reads as 99
avrdude: safemode: efuse reads as FF
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: set SCK frequency to 93750 Hz
avrdude: reading input file "Bootloader5.hex"
avrdude: input file Bootloader5.hex auto detected as Intel Hex
avrdude: writing flash (65536 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 65536 bytes of flash written
avrdude: verifying flash memory against Bootloader5.hex:
avrdude: load data flash data from input file Bootloader5.hex:
avrdude: input file Bootloader5.hex auto detected as Intel Hex
avrdude: input file Bootloader5.hex contains 65536 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 65536 bytes of flash verified

avrdude: safemode: hfuse reads as 99
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:99, L:62)

avrdude done.  Thank you.
I had to use the -F switch to get it to work plus I've had no luck in setting the fuses, even when using -B 7 so I'm still not entirely convinced everything is OK. Would those current fuse values (E:FF, H:99, L:62) not allow me to boot or use the UB properly?
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: Unibox - WIP 2020 EUzebox BOM

Post by danboid »

It definitely looks like I need to order a different AVR programmer.

I've just been through the extensive ordeal of installing Atmel Studio 7 under Windows 10... Oh dear!

Despite me using its web installer, only choosing the install the 8-bit stuff and running it on an i7 w/ 16GB RAM, SSD using a 100+Mb wired broadband connection it still took over an hour to install, mainly because it wants to install a 5 year old version of Visual Studio and a 6 year old version of MS SQL server alongside god knows what else. The bloat of most modern commericial software really irks me. Yuck!

Windows supposedly recognised and installed a driver for my USBasp when I plugged it in but when I finally got to open Atmel Studio, I opened the device programmer window but it didn't list my USBasp in the Tools dropdown. I tried using an app called zadig to try installing an older libUSB for the usbasp but that didn't help. Atmael studio still didn't list any tools. I was trying under bare metal Windows 10, not under a VM btw.

Is there a standalone tool for windows just to do the chip programming, like avrdude but for Windows? I almost exclusively run Linux so I'll be using avrdude mainly but its good to know what options I've got for testing my programmers etc.
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: Unibox - WIP 2020 EUzebox BOM

Post by danboid »

I have updated the BOM to 0.9.2 to list the ARCELI Atmel AT AVRISP mkii XPII AVR ISP mk2 USB AVRISP instead of 'any old AVR programmer' which are available new for £17 on Amazon and are sold as being compatible with AVR Studio.

Isn't this the one you use artcfox? I'm presuming it will work fine with avrdude.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Unibox - WIP 2020 EUzebox BOM

Post by Artcfox »

Yes, I use an official mkII from ATMEL that I bought from Digikey. I haven't tried any of the clones, so I don't know. I don't think they make the mkII anymore, but on their website they should list the currently supported replacement if you don't want to mess with clones.
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: un1b0x - 2020 EUzebox BOM

Post by danboid »

Yesterday I got avrdude to flash the bootloader without using -F and I was also successful in getting it to flash the fuse values, after soldering an unconnected wire and re-soldering a couple of other connections. It's still temperamental but I have to undo about 7 of the wires now anyway as they're obstructing points I need access to add the SCART, which I'm hoping to get done today.

I have updated the picture of the UB programmer schematic on p6 with a better quality one.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: un1b0x - 2020 EUzebox BOM

Post by Artcfox »

Hooray! Progress!
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: un1b0x - 2020 EUzebox BOM

Post by danboid »

I've updated the BOM to 0.9.3. I needed to buy a file to remove some small plastic lips on the SCART connector to get it to glue properly and I also added super glue to list of required tools.

My Arceli AVRISP mkii has arrived and I can confirm that it shows up in the tools dropdown of Atmel Studio 7 without having to install any drivers under Windows 10 although I have not fully tested it yet. I'm hoping I don't need to use it and that avrdude has already properly flashed my 644 with the bootloader and required fuses.

Now that I've attached the SD card and the SCART connectors its starting to look much more like an actual console.
IMG_20200727_151349-small.jpg
IMG_20200727_151349-small.jpg (279.32 KiB) Viewed 8625 times
User avatar
Jubatian
Posts: 1561
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: un1b0x - 2020 EUzebox BOM

Post by Jubatian »

danboid wrote: Mon Jul 27, 2020 3:29 pmI needed to buy a file to remove some small plastic lips on the SCART connector to get it to glue properly and I also added super glue to list of required tools.
How it didn't occur to me that I could have superglued a few things to the board... :lol:

With the Scart, there is a trick I found (the unneded tab I just snipped off), bend one of the pin rows outwards at 90 degrees. The spacing is so that you can shove two pins into adjacent perfboard holes this way, skip one hole, then shove in another pair of pins and so on. This would make a pretty solid mechanical connection, could be helped further with superglue, though, but I really wouldn't worry about the Scart socket ever coming off! :D

Never used the Studio myself. Only avrdude for programming and avr-gcc for compiling (on Linux). Bloat, certainly agree, especially considering you have that multi gigabyte package just to program chips with a few dozen kilobytes of ROM :P
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: un1b0x - 2020 EUzebox BOM

Post by danboid »

I've made quite a lot a progress in the last few days. I think I have wired up enough to be able to get a picture now but alas it did not work on my first attempt. That would've been beyond lucky!

I have tested the TV with a PS2 but I have only tested the RCA/composite input. I have not tested the SCART input nor the cable I am using yet. I have also been successful in setting the fuses using Atmel Studio using the AVRISP MKII.

Here's what I have (supposedly) wired up so far:
30th-July-un1b0x-schem.jpg
30th-July-un1b0x-schem.jpg (225.92 KiB) Viewed 8564 times
un1b0x-30th-July-bottom.jpg
un1b0x-30th-July-bottom.jpg (227.33 KiB) Viewed 8564 times
un1b0x-30th-July-top.jpg
un1b0x-30th-July-top.jpg (255.91 KiB) Viewed 8564 times
So, presuming all that has all been wired up correctly (although I have a special doubt I'll come onto in the next post) ie everything required to program the chip plus all of the SCART connections and with the bootloader flashed but no SD card or controllers wired up, should I expect to see the bootloader complaining about no files being found? Should I be able to get a picture at this point or does the SD card (and controllers) need to be wired up too?
User avatar
danboid
Posts: 1935
Joined: Sun Jun 14, 2020 12:14 am

Re: un1b0x - 2020 EUzebox BOM

Post by danboid »

In the last couple of days I realised I took a 'shortcut' that may not be valid when I was wiring up the crystal.

The Euzebox schematic shows the following highlighted connections when wiring up the crystal:
Screenshot from 2020-07-30 19-47-21.png
Screenshot from 2020-07-30 19-47-21.png (63.71 KiB) Viewed 8564 times
I presumed that those connections were only required if you are using MIDI which I presume requires a second crystal, hence if you're not adding MIDI you could ignore these connection points and instead connect one leg of the crystal to one leg of the 22pf cap and connect that point to one of the XTAL inputs on the MCU. I did that for both of the crystal connections.

Is that a valid space saving technique or do I need to undo this, if possible? I hope I'm describing what I've done clearly enough.
Post Reply