# Tag Info

10

Take a look at the compiler output here https://godbolt.org/g/TxZSgt. Notice that the inner for loop and the asm("nop") lines correspond to 3 assembly instructions, two of which (sbiw and brne) take two cycles (for brne when taken). So instead of taking one cycle per inner loop like you predicted, it takes 5. And actually, if you multiply your measured ...

5

Found the solution, which is of course dead simple once you know... In Zadig, you can select the driver. Default selected is (in my case) the WinUSB driver. When I select the libusb driver, and install that driver, it works like a charm. Yeey. avrdude -vvv -c USBasp -p m32u4 -u -U flash:w:Duroduino.ino.hex:i avrdude: Version 6.3, compiled on Feb 17 2016 ...

5

You can't test the speed of a microcontroller by measuring how long it takes to execute unknown numbers of instruction. There is no guarantee what exact instructions the compiler generates from your code. Either look in some kind of machine code output listing, or write your test in assembler. Either way, you need to know exactly what instructions are ...

4

I was pulling my hair out as I had received 20 Atmega328P's and the first one I was able to get programmed with my USBasp Programmer, but swapping the processors I was not able to program on breadboard or within an UNO. Thanks to some posts I felt confident it was a fuse setting where it was speaking too fast. I have an external 16MHz crystal in my setup so ...

3

The error message you are seeing means that the chip is not responding to the "enable programming mode" command that the programmer is sending. Either you have got the connections wrong, or the programmer is sending the commands too quickly (programming frequency too high). New AVR chips come configured to use the chip's internal oscillator as a clock ...

2

You could, but it makes more sense to ditch the USBASP AVR programmer between the USB charger and the ATmega altogether, and power the ATmega from the USB charger directly. The USB supply voltage is 5 V, just what the ATmega needs. If the charger has a removable cable you can just take some old USB cable, cut off the slave side (B, mini-B, micro-B) ...

2

Your setup might just be flawed. I have programmed not specifically the ATmega8, but I have done an ATmega16 which is the same process. I note the article on my website which has been used by many. At one point in the article I list a command: -c usbasp -p atmega16 -B12 -U flash:w:"$(ProjectDir)Debug\$(ItemFileName).hex":i You will change this to -c ...

2

If I will purchase new Atmega32 from local store will it come with Bootloader? No If no, Is it compulsory to install Bootloader on it? No If not compulsory then why people sometimes install Bootloader? I read somewhere that Bootloader is installed for field programming but I am not sure what that means. Example: Arduino bootloader: When the ...

2

You could program it before you solder it in, using a ZIF socket programmer. If making many of the board, then your supplier can program them for you. ZIF socket programmers are available for QFN and MFN packages. Alternatively you can provide an ISP header on the PCB, or equivalent pads for pogo-pins to program in circuit. Using just pads for pins takes up ...

2

What could be the problem here. Some of the possible problems include: I place the IC on top of the pads [...] I am sure this is making a valid electrical connection. I respectfully disagree that you can be sure every (necessary) pin is making a good-enough electrical connection, with the ATmega328P TQFP package just "laying" on top of the breakout PCB....

2

You do not. You buy the development board, in your case the MSP-EXP432P401R, and you use wires to the breadboard. Or you buy a development board you can breadboard, mbed has some. Putting this category of chips on a breadboard gives you a deluxe package of problems, if you are going that way, you'd better start funding this website. You program that chip ...

2

The delay functions calculate the clock cycles by looking at the F_CPU macro. You have to set the #define F_CPU 16000000UL so it matches the actual CPU speed. That actual CPU speed is set by programming the fuses correctly. I think you forgot that step.

1

The problem is given in the error message: target doesn't answer Possible reasons are: Incorrect/slacky wiring: Might seem unlikely if you did not change anything since you've successfully programmed the avr before. However, expecially if using a breadboard or jumper cables: Double-Check your connections. Also test for short-circuits between signals. ...

1

I have been pulling my hairs with a similar issue and since your information helped me get started, I thought I would share my result and hope it can help you. First of all, I am using a USBASP that looks like yours. I had success with attiny13 and 45. I had no issues with the attiny13 but the attiny45 I got where set by default to use an external clock. ...

1

Is the microcontroller you are trying to program set up with the right clock source? When they come from the factory, their fuse bits are normally set so that they run at a clock speed of 1 MHz, using the internal RC oscillator. If you have scavenged it from somewhere, it might be set to expect an external clock source or crystal (and won't do anything ...

1

The problem with the cheap Chinese USBasp modules is that they come with a custom firmware, so they can be sold cheaper. I had the same problem, and after some research, asking some friends, they insisted me the following solution which worked for me. The prerequisite is to have another working programmer handy or make an Arduino as AVRisp and fix the ...

1

I had created the Standalone Arduino, but when trying to program it with a USBasp, I received the OP's error. After following cyberx86 clue about reverifying the pins, I found that MOSI, from the AVR Programming adapter, was shown incorrectly wired up in the photo although, the written description of the pin out was correct: Be sure to refer to the ...

1

Recently, I was trying to make a little project using my atmega8, but I faced with this problem. I thought that the chip had flaws because of its using time, but I remembered that the last time I write code inside it, I programed the fuses to make it work with its internal oscillator! And I tried to program it (again) but this time with a crystal and…. Ta ta ...

1

if you are using windows os there are avr studio 4 is available. in this ide you can modify your fuse bits and it is one type gui based software which indicates your all fuse bytes and all.

1

First, you need to figure out what the problem is, then you may able to find a solution. you need to make sure that the ic is not bad, by say, putting it into another board. If the IC is okay, but it still doesn't work, then It could be the problem originate from the board. Last but not least, avrdude is not the best software out there. Try to find another ...

1

Even when fused to use a crystal, the ATmega328P will accept a clock signal injected into XTAL1 when being programmed by ISP. The USBasp does not provide such a signal so you will need to set up another circuit to generate a clock signal fast enough for programming. The programmer should work with such a slow clock assuming the programmer uses a slow clock ...

1

You can replace the 10-pin ISP socket with a 6-pin ISP socket, they are functionally identical. The original USBASP design brings out an additional 2 signals (the TX and RX pin of the programmer MCU) to normally unused pins of the ISP-10 connector because the USBASP creator planned to add support for access to the target UART for debugging to the firmware, ...

1

The pins do exactly what the MCU datasheet says they do in the "Memory Programming" section. Which means that yes, you need a different pinout per device series. Use the MCU datasheet to decide where each ISP connection needs to be routed.

1

If you can afford buying an Arduino UNO board (about 20EUR, original, but you may find compatible ones which are cheaper), you can use it to program another Atmel MCU, in particular an ATMega328. See this article on Arduino as ICSP and this one (programming breadboarded MCUs with an Arduino). I've personally done that and it is seamless (Arduino UNO ...

1

It turned out the problem was how I compiled the C code to hex. This website has simple and very clear instructions for how to do so on a mac. How to AVR with OSX

Only top voted, non community-wiki answers of a minimum length are eligible