MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

Need help flashing uBraids ATMega
MUFF WIGGLER Forum Index -> Music Tech DIY  
Author Need help flashing uBraids ATMega
OB1
Hi,
I'm trying to flash the ATMega328P in my newly built uBraids with the display code.
I have tried to get the Arduino IDE (v 1.8.6) to talk to the programmer on 3 different machines now -
2011 MacBook Pro running Sierra
2013 MacBook Pro running High Sierra
2013 MacBook Air running Windows 10
On the macOS machines, I have tried installing various drivers (the FTDI VCP driver, a CH340 driver and a SiLabs driver), all of which various Arduino forum posts suggested would be the silver bullet, none of which actually made any difference. All I see in Tools/Port is /dev/cu.Bluetooth-Incoming-Port.
On Windows, the Port menu item is greyed out completely.

The programmer I have is a USBASP V2.0 (cheap, Chinese, from eBay) and I'm using a 6 pin AVRisp adapter.
The macOS system report lists USBASP as a USB device.
I have tried rebooting with the programmer connected.
I have seen various error messages along the way including "An error occurred while uploading the sketch" or "programmer is not responding". Now, when I attempt to burn the bootloader (or upload the sketch using either menu option), I see this message on all 3 machines:
"avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check."
I am powering the module from the rack while doing this.
I have checked my soldering about 100 times and reflowed the ATMega.

Other than the display, the module is fully functional (and sounds amazing!).
*Please* can anyone help me to resolve this issue? Could the programmer itself be at fault? Do I need to have a working programmer for Arduino to list the port?
amir
usbasp provides power to the board.. you shouldn't have it hooked up to your modular at the same time. Also, usbasp boards usually have a 3.3v and 5v power output jumper. make sure you have that connected right.

Did the chinese seller send you a disc with it? They usually send one of those mini cds with a panda on it. The correct drivers for your board will be on it.
OB1
Didn’t get a disc with it. It does have a jumper, which I haven’t moved - it’s set to 5V - is that right? I have also tried without powering it from the rack with the same result.
amir
If you didn’t get a disc then follow driver instructions here and it should work:

https://www.fischl.de/usbasp/

I am pretty sure it should be set to 5v. Make sure the 6 pin adapter that you have is wired correctly also. There are plenty of pin outs diagrams on google. Just as a warning though, the person providing the code for the screen used some weird Arduino app method to distribute the code and didn’t provide clear instructions on how to set the fuses or proper boot loader to be used in something like avrdude. Therefor when you use a usbasp and the Arduino app to upload the code be prepared for some missing lines in the graphics. It’s annoying but still usable.
Altitude909
you have to upload the arduino 328 bootloader firsts, then the sketch. Bootloader sets all the fuses. That being said, if that device PROVIDES bus power (which programmers shouldnt for the exact reason your about to learn) and you had that hooked up and the module powered externally, you just put 10V on the 5V power rail and likely murdered every chip on that bus
feedbackl00p
I had nothing but trouble with my cheap USBASP.

I splurged on the Olimex AVR and haven’t had a single problem since.
keninverse
I've had nothing but problems with macOS. Try burning the bootloader in the Arduino IDE and then burn the hex in terminal/avrdude. Enable verbose output when flashing to make sure fuse bits were written correctly. As others have suggested try a different programmer. I have both a AVRISP mkII and bus pirate. Sometimes one will work and at other times it won't so the other is used.
amir
This isn't a programmer problem but a code provided problem. The usbasp works as intended and I've used one to program tons of different projects successfully. The issue here is that the developer didn't provide a boot loader and tried to use the arduino boot loader. It doesn't work correctly because of arduino app not wanting to work with the usbasp. The usbasp therefor is not the problem but rather the method. The fuses are not being set correctly because if they were, the chip would be use the correct clock speed and the screen could refresh at the right rate to update.

If someone with a working screen could post a read of the fuses / lockbit using avrdude and post their full hex from avrdude, that would help everyone else that doesn't want to deal with the arduino boot loader method. Nobody has done this yet though.
Altitude909
amir wrote:
This isn't a programmer problem but a code provided problem. The usbasp works as intended and I've used one to program tons of different projects successfully. The issue here is that the developer didn't provide a boot loader and tried to use the arduino boot loader. It doesn't work correctly because of arduino app not wanting to work with the usbasp. The usbasp therefor is not the problem but rather the method. The fuses are not being set correctly because if they were, the chip would be use the correct clock speed and the screen could refresh at the right rate to update.

If someone with a working screen could post a read of the fuses / lockbit using avrdude and post their full hex from avrdude, that would help everyone else that doesn't want to deal with the arduino boot loader method. Nobody has done this yet though.


That's nonsense. Code works fine, hundreds of uBraids have been built by flashing Arduino bootloader and then the sketch in Arduino just like any other 328 based ardunio device. 99.9% of the time when there is a code upload issue it's a hardware problem, uBraids has been out for how many years now? If he had power over the programmer on and plugged it into his rack, anything that isnt 10V tolerant on the 5V rail is dead. So the 328 and 4067 are toast
OB1
The issue was the cheap Chinese programmer. Tried today with a genuine AVR ISP mk2 on my High Sierra machine. Worked first time with no issues, no drivers needed installing, it just worked.
OB1
And, for the record, I needed power from the rack and nothing got cooked.
Altitude909
OB1 wrote:
And, for the record, I needed power from the rack and nothing got cooked.


There is usually a jumper u have to set for bus power from the programmer, thankfully it looks like that was set to off be default..
amir
hmm maybe not nonsense then?!?? the arduino app just doesn't work well with the usbasp. If someone could just upload the full hex with the bootloader then we could just use avrdude to upload it with any programmer.
MUFF WIGGLER Forum Index -> Music Tech DIY  
Page 1 of 1
Powered by phpBB © phpBB Group