Programming problem (Can I use a USBasp?)

Post Reply
Ausi1972
Posts: 17
Joined: Sat Apr 14, 2012 9:03 pm

Programming problem (Can I use a USBasp?)

Post by Ausi1972 »

I have a Crius MWC Light.
My FTDI programmer has died so I thought I could use one of my USBAsp programmers instead.

Problem being I am using a Mac. I have Arduino 1.0.1.
When I select programmer > USBAsp and upload it asks for the serial port which the USBAsp is not listed.

So I thought well I use the KK Multicopter flash tool for me KK Boards and that works fine with the USBAsp. I set it to Atmega 328P (32K) which seems to program it.
So I used the Arduino to compile the MultiWii 2.1 code that I made made the relevant config changes to then grabbed the generated hex file and fed that into the KK Flash tool and flashed it to the MWC Light board using the ISP header and the UABAsp programmer. It programmes fine and confirms OK in the flashing software.
However the MWC board will not boot or work with that code loaded (I tried the ESC calibration mode which normally goes through a nice ESC callibration routine so I know everything is working OK). But no luck with this.

Has anyone else managed to use a USBASP to program a MultiWii board?

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Programming problem (Can I use a USBasp?)

Post by doughboy »

I use usbasp, but I built my FC board myself, but it should not be different from Crius or any atmega328 based FC board.

in IDE, you selected board as UNO and programmer as USBAsp? If you selected USBAsp, it should not ask for a serial port.

Another option is to add this entry to boards.txt file in hardware/arduino folder (this is the old procedure before arduino ide 1.0, but should still work)
################################################################
usbasp328.name=[usbasp]ATmega328
usbasp328.upload.using=usbasp
usbasp328.upload.maximum_size=32768
usbasp328.build.mcu=atmega328p
usbasp328.build.f_cpu=16000000L
usbasp328.build.core=arduino
usbasp328.build.variant=standard

then restart IDE, and you should see a selection called [usbasp]ATmega328

Ausi1972
Posts: 17
Joined: Sat Apr 14, 2012 9:03 pm

Re: Programming problem (Can I use a USBasp?)

Post by Ausi1972 »

OK That has got a bit further.
I added that to the bottom of my boards.txt file and restarted then selected the new entry in Tools > Board > [usbasp]ATmega328
That flashed to the MWC but has an error at the end:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Programming problem (Can I use a USBasp?)

Post by doughboy »

yes, you can ignore that. its just a warning and not an error. you just flashed successfully using usbasp!

note that once you program using usbasp, your bootloader is gone.
in order to use ftdi or usb again, you must select UNO as board, then select burn bootloader (with usbasp connection of course).
after this, you can use ftdi or usb to program the board again.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Programming problem (Can I use a USBasp?)

Post by copterrichie »

Doughboy, just for clarity, how are you connected the usbasp to the arduino? In other words, what pins etc.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Programming problem (Can I use a USBasp?)

Post by doughboy »

copterrichie wrote:Doughboy, just for clarity, how are you connected the usbasp to the arduino? In other words, what pins etc.


I used to use 6 single jumper wires to connect the +5,gnd,rst, mosi, miso, sck to the arduino. but I won an auction for one of these for $0.65 so have been using this since.

Image

just use this usbasp pinout to ICSP pinout to connect the 6 lines. (note pin 1 is the square pad)

Image

Ausi1972
Posts: 17
Joined: Sat Apr 14, 2012 9:03 pm

Re: Programming problem (Can I use a USBasp?)

Post by Ausi1972 »

Excellent. That worked now.
So the last bit of the puzzle. Can I use the USBAsp with the MultiWii Conf program as well?

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Programming problem (Can I use a USBasp?)

Post by doughboy »

Ausi1972 wrote:Excellent. That worked now.
So the last bit of the puzzle. Can I use the USBAsp with the MultiWii Conf program as well?


unfortunately, no.

are you sure the ftdi is broken? unless you see physical damage like it got stepped on, I can't imagine it to not work.
now perhaps when you were trying usbasp in between, the bootloader may have been deleted, at which point, the ftdi will not work for programming anymore. but if ftdi is not damaged, you can still use mutiwin configurator on the FC.

Ausi1972
Posts: 17
Joined: Sat Apr 14, 2012 9:03 pm

Re: Programming problem (Can I use a USBasp?)

Post by Ausi1972 »

Excellent thanks for that. I have got the FTDI connector to work in the MultiWii Conf but not in the Arduino. It used to work fine but has stopped working now. I get this error:
avrdude: stk500_recv(): programmer is not responding

Not a problem. I'll try putting new wires on it (connecting the FTDI board to the FC) as the old plastic connector fell apart so I used some servos leads.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Programming problem (Can I use a USBasp?)

Post by copterrichie »

@Doughboy, Thank you.

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: Programming problem (Can I use a USBasp?)

Post by doughboy »

Ausi1972 wrote: I get this error:
avrdude: stk500_recv(): programmer is not responding


you can get that error due to
the DTR line is disconnected. - make sure the DTR line from FTDI is connected to RESET pin on the FC board FTDI connector.
or the FC bootloader is gone.

The DTR or reset is not needed for multiwii configuration to work, but is needed in order to upload the program.

Post Reply