USBasp firmware for ATmega328

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, sorry for my English but I wanted to ask a question.
Where I live, I do not get the ATmega8.
I have the ATMega328 could USBasp compile the code for this microcontroller?
What considerations should be taken into account?
If possible, how I can do?
sorry for so many questions
Thank you very much :roll:

Last Edited: Wed. May 10, 2017 - 09:17 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

could USBasp compile the code for this microcontroller?

Yes.

The tar.gz already has source for mega48 - just rebuild that for mega328.

By the way you STILL need an ISP programmer to start with to load the USBAsp code into the 328 in the first place.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then all I have to do is recompile the firmware for the ATMega328? No I have to change anything in the main program or any library?
Another question, the process of recompilation is done by AVRstudio + WinAVR?
Thanks for your help

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why don't you download the .tar.gz and find out for yourself - read all documentation files.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok, thank you for your help

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a question. I could successfully compile the code for the microcontroller ATmega328p USBasp. But when he says USB connection to USB device not recognized.
68R resistors in conjunction with 3.3v zener diodes are really critical or can be omitted?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The zener diodes stop 5Volts going back to your computer.

USBasp is based on V-USB and if you get the V-USB tarball and open it there is a good explaination with circuit diagrams.

Please tell us more about who he was that said it.
Was it Linus or Billy?

I use USBasp regularly.
Fond of it.

John

If all else fails, read the instructions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JonhyAVR wrote:
I have a question. I could successfully compile the code for the microcontroller ATmega328p USBasp. But when he says USB connection to USB device not recognized.
68R resistors in conjunction with 3.3v zener diodes are really critical or can be omitted?

I have usbasp running on a 16MHz Arduino.
It is not difficult to port the project.

I would not omit the 3.3V zeners. Your PC is expensive.

If you have soldered a proper usbasp circuit using the proper schematic, everything works fine.
From memory, all you need is to change ATmega48 to ATmega328P in the Makefile. (check the spelling)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

At this early stage (I'm using Windows) - I have NO idea how to recompile the code for the 328 - I've not used the make files or associated tools. I do have an AVR dragon to put the hex file into the chip.

Could someone give a step by step from getting the original zip file to blowing the hext file? I can't be the only one as I've seen no USBASP code for the 328 on the web?

Would really appreciate the help.

david.prentice wrote:
JonhyAVR wrote:
I have a question. I could successfully compile the code for the microcontroller ATmega328p USBasp. But when he says USB connection to USB device not recognized.
68R resistors in conjunction with 3.3v zener diodes are really critical or can be omitted?

I have usbasp running on a 16MHz Arduino.
It is not difficult to port the project.

I would not omit the 3.3V zeners. Your PC is expensive.

If you have soldered a proper usbasp circuit using the proper schematic, everything works fine.
From memory, all you need is to change ATmega48 to ATmega328P in the Makefile. (check the spelling)

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Could someone give a step by step from getting the original zip file to blowing the hext file?

1) I went here: http://www.fischl.de/usbasp/

2) I downloaded and unpacked usbasp.2011-05-28.tar.gz (which appears to be the latest available right now).

3) In the usbasp.2011-05-28\firmware directory I edited the Makefile and changed the TARGET=atmega8 line to be TARGET=atmega328

4) In a command prompt I used CD to switch to the usbasp.2011-05-28\firmware directory

5) At the command prompt I typed the command:

make main.hex

6) It said:

E:\usbasp.2011-05-28\firmware>make main.hex
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -c usbdrv/usbdrv.c -o usbdrv/usbdrv.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -x assembler-with-cpp -c usbdrv/usbdrvasm.s -o usbdrv/usbdrvasm.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -c usbdrv/oddebug.c -o usbdrv/oddebug.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -c isp.c -o isp.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -c clock.c -o clock.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -x assembler-with-cpp -c tpi.s -o tpi.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -c main.c -o main.o
avr-gcc -Wall -O2 -Iusbdrv -I. -mmcu=atmega328  -o main.bin usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o isp.o clock.o tpi.o main.o -Wl,-Map,main.map
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.bin main.hex

7) At the end of the process I found it had built me a main.hex with 13,682 bytes (this was built using WinAVR2010110):

E:\usbasp.2011-05-28\firmware>dir main.hex
 Volume in drive E is VBOX_windows
 Volume Serial Number is 0000-0805

 Directory of E:\usbasp.2011-05-28\firmware

12/07/2012  15:05            13,682 main.hex

That's the file you would then program into the AVR that is destined to become a USBAsp.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

HI. THANK YOU FOR DESCRIBING HOW TO DO THIS PROJECT. I FALLOWED YOUR STEPS. AND I PUT A FIRMWARE TO MY CHIP 328P USING USBTINYASP PROGRAMMER THROUGH THE BITBURNER. I LEAVE THE FUSER BITS THE WAY IT HAS IN MAKE FILE (BELONGS TO THE ATMEGA8). THEN I TRIED TO PROGRAM ARDUINO UNO USING NEWLY CREATED USBASP PROGRAMMER THROUGH THE ARDUINO IDE AND THE BITBURNER. BUT IT GIVE ME ERROR WITH "RC=-1". THEN I CHANGED THE FUSER BITS TO LFUSE=62, HFUSE=D9, EFUSE=FF, THEN THE COMPUTER CANNOT RECOGNIZED THE PROGRAMMER. THEN I TRIED TO INTALL THE DRIVERS AND IT COULDN'T (I'M USING WINDOWS 8.1 AND I TURNED OFF THE SIGNATURE SECURITY). PLEASE CAN YOU HELP ME TO RESOLVE THIS PROBLEM. 

THARINDU GURUSINGHE

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't cross post - as this is the older of the two threads you posted that too I will lock this one.

 

Moderator

Topic locked