Foal of un1b0x

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
CunningFellow
Posts: 1445
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Foal of un1b0x

Post by CunningFellow »

Maybe get a small bottle of extra flux or a flux pen.
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

I've been too busy doing overtime this week, I've only found an hour or two to work on the UB. I've got some flux pens now although I don't think the tips are fine enough, but I'm not quite at that stage yet.

I think I've attached enough components now to be able to flash the bootloader via the ISP 6 pin header but I've not been able to do so. I have attached all of the components mentioned up to p13 of the assembly guide. I have tried using both Atmel Studio 7 under Windows 10 (bare metal install of Windows, not running in a VM) and I've also tried using avrdude under Ubuntu 20.04 with no luck either. I have the official MKISPII programmer.

Under the device programming window of Atmel studio, if I click on on 'Read' under Device signature, I get a "Failed to enter programming mode" error and if I I try to program bootloader5.hex onto it I get "Erasing device failed". I have the PSU (9v 600mA) plugged in but only one green light is lit on my AVR programmer and the wiki page says I should see 2 green lights if all is well.

Do I need to attach any more components to use an ISP programmer?
UB-top.jpg
UB-top.jpg (113.38 KiB) Viewed 3929 times

UB-under.jpg
UB-under.jpg (70.77 KiB) Viewed 3929 times
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

I did a very poor job of soldering the SPI header so I ended up filing between the contacts to try to stop them shorting but I might've made matters worse.
spi.jpg
spi.jpg (105.43 KiB) Viewed 3918 times
Is there any hope of that mess working or have I more likely butchered this board?

The only device programming function that works under Atmel Studio is checking the voltage. Reading, programming, erasing and verifying all fail.

The wiki says I should see 2 green LEDs on the programmer when Its connected but I get one green and one blue LED.
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Foal of un1b0x

Post by D3thAdd3r »

Eh, it might still be ok, I think that exposed copper is just a big ground plane which isnt severed? I would do a continuity check between all ISP pins, and the corresponding endpoints according to the schematic. Some clone ISP programmers might have different LED colors like blue? I think you have enough done to use ISP.

Are you using flux core solder? Is the tip really dirty? PCB have some film on it? You want to heat the pin, and the PCB pad/holes for a few seconds, then push solder in. If it doesn't pull the solder, it's not hot enough. The heated parts should suck the solder to them, you are not trying to melt solder to just fall on top. The bigger the metal, the more heat it needs(heat sink). Really important concept of soldering. Not sure what's happening there, but you definitely will need to figure that out before attempting the SD slot(easy to ruin it).

For the encoder, tweezers and super glue could work. If you use minimal solder, even if you solder bridge the pins at first, you should be able to heat individuals and get them to pull the solder out of the bridge. As long as you don't heat it too many times or for too long, you shouldn't hurt the PCB. Get some solder wick, or a de-soldering iron. Definitely do not file, there is no need!! Its easy to remove excess solder with the right tools.
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

Thanks for another comprehensive response DE, although its hard to cover everything I don't know as the perfect newb so yet again I'm back asking for more clarification on the same issue.

Why does the schematic have 2 ISP headers? What would the second optional one be used for? With the PCB I got sent, they seem to be too close together for you to actually add a second ISP header.

The schematic seems to denote the ISP header as required (non optional) and yet the assembly guide doesn't attach an ISP header so technically I'm presuming they're both optional if you have a pre-programmed MCU I suppose? That's not the case for me and so its not optional.

Out of the 6 ISP header pins. I have tested the continuity of the two that connect to the MCU and they're both OK. Two of the pins seem to go to the SD card so I think I can ignore them for the moment but I'm not sure how I should check the continuity for ISP pins 2 (+5V) and 6 (GND)? I presume I check the datasheet for the power jack to check which of its legs is 5V and check the continuity between that and pin 2 on the ISP header?

I wonder if I've already broken the record for the longest time took to build a UB already? I'm not even halfway done yet!
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Foal of un1b0x

Post by D3thAdd3r »

danboid wrote: Fri Dec 31, 2021 2:02 am Why does the schematic have 2 ISP headers? What would the second optional one be used for? With the PCB I got sent, they seem to be too close together for you to actually add a second ISP header.
Only one at a time. The original ISP connection was a straight vertical one, and for the later PCB revision the option for a 90 degree one to the back was added(for the 3d printed case).
danboid wrote: Fri Dec 31, 2021 2:02 am The schematic seems to denote the ISP header as required (non optional) and yet the assembly guide doesn't attach an ISP header so technically I'm presuming they're both optional if you have a pre-programmed MCU I suppose?
Technically you could make a small rig to program the '644 externally from the UB, but it wouldn't make much sense versus just putting it in the PCB for single quantity programming.
danboid wrote: Fri Dec 31, 2021 2:02 am Out of the 6 ISP header pins. I have tested the continuity of the two that connect to the MCU and they're both OK. Two of the pins seem to go to the SD card so I think I can ignore them for the moment but I'm not sure how I should check the continuity for ISP pins 2 (+5V) and 6 (GND)? I presume I check the datasheet for the power jack to check which of its legs is 5V and check the continuity between that and pin 2 on the ISP header?
The schematic does not show complete line segments drawn for all connections, but the pins are listed on the MCU. You should be able to continuity check every one of the 6 ISP pins back to a pin on the MCU. Besides +5 and ground, there is: RESET, SCK, MISO, MOSI which go to 9, 8, 7, 6 respectively on the '644. It doesn't show a complete point to point line segment, but those labeled pins do need to be connected.

Center pin of the +5v regulator is ground BTW.
danboid wrote: Fri Dec 31, 2021 2:02 am I wonder if I've already broken the record for the longest time took to build a UB already? I'm not even halfway done yet!
Maybe, maybe not. When you finish it, you will be far ahead of the many who just gave up and never finished :ugeek:
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

I have now done continuity tests for all of the ISP pins and they all checked out fine plus I did continuity tests between each pair of adjacent pins on the header to check they aren't shorting and that seems OK too but after having another few goes with Atmel Studios device programmer and avrdude I've had no luck getting either to flash the bootloader.

It seems like a long shot to me but I have re-used the MCU from my previous attempt at making a UB instead of using the unused MCU I have spare so I thought the next thing I'd try would be to replace the MCU to see if that gets me going but before that I wanted to check I'm using the right avrdude commands.

The UB wiki has this page for avrdude

http://uzebox.org/wiki/Avrdude

but its incomplete because it doesn't give example commands to flash the bootloader nor set the fuses. I found some example commands to do both in the description of this video:

https://www.youtube.com/watch?v=ydtDAn4TtaM

Flashing the Bootloader:
avrdude -V -p m644 -P usb -c usbtiny -B 1 -U flash:w:Bootloader.hex

AVR fuse settings:
avrdude -V -p m644 -P usb -c usbtiny -B 1 -U lfuse:w:0xD7:m -U hfuse:w:0xD2:m -U efuse:w:0xFF:m

Can anyone confirm these commands are correct? Obviously I'd need to substitute usbtiny with the name of my programmer. Are there any other useful avrdude commands I should know about that might help me and anyone else trying to build a UB? I would prefer to use avrdude because I'm a Linux user and Atmel studio is bloated as hell and takes an age to install. It also supports a lot more device programmers than Atmel studio.

I've also been wondering if these avr programming devices are known to have issues with USB 3? Maybe I'd have more luck if I can find a machine with USB 2 ports? Also, I wonder if I might need to connect stuff up in a specfic order or maybe I need to run the command immediately after connecting it or something?

I applied for a UB wiki account a couple of years ago but I don't believe my request was ever approved. It would be great if someone could update the avrdude page with this info.
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

I've burned the bootloader onto the MCU! Woo fkn hoo! :D

I swapped the MCU over and it worked on my first attempt (w/ Atmel Studio) so I can only presume that I did damage the other MCU with my previous attempt at creating a UB and it seems the AVR ISP mkII does work with USB 3.0 ports.

I've attached the audio jack but it seems my only spare phono cable has died so I've yet to hear the boot sound.
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

I burned bootloader5.hex and configured the fuses as per

http://uzebox.org/wiki/ATmega644_Fuse_Settings

but I don't hear any sound played when I plug it in (with the audio connected to my TV)

Maybe its only the older bootloader that makes a noise? Which bootloader is recommended?
User avatar
danboid
Posts: 1884
Joined: Sun Jun 14, 2020 12:14 am

Re: Foal of un1b0x

Post by danboid »

I thought I'd try burning the old bootloader version instead and now I'm back to Atmel studio not finding anything. It let me burn the bootloader once and set the fuses once and then game over! Just when I thought I was getting somewhere!

I'll try again when someone confirms the right avrdude commands. Is there not a better program for burning + setting fuses than avrdude & Atmel Studio?
Post Reply