Reputation: 19
I've written code below for a flasher led! in CodeVision as my first program!! with ATmega16.
but I can't program it with extreme burner.CodeVision compiles it with 0 errors and 0 warnings. Extreme burner loads the .hex file successfully. But when I click on the Read all
button, I can't continue. I see this report: powering on => power on failed => can not communicate with target chip
. and at in the end I got this message: No data read!
I don't know what is correct the value of fuse bits and how to set them correctly.
#include <mega16.h>
#include <delay.h>
void main(void)
{
PORTA=0x00;
DDRA=0x01;
while (1)
{
PORTA.0 = 1;
delay_ms(200);
PORTA.0 = 0;
delay_ms(500);
}
}
Upvotes: 1
Views: 2683
Reputation: 11
New chips need slow programming.there is mode in usbasp to do that.then use new fusebit setting and write them with slow.then you will be able to use normal
Upvotes: 1
Reputation: 148
the problem is not in the coding / compiling process . the error you got indicates that the programmer is recognized and it's working , and that leaves you with the following possible problems :
the connection between the the programmer and the chip ,
the chip has been programmed before and it won't operate without external crystal .
if you can change the programmer speed set it to the slowest. "Usbasp has a jumper for slow devices programming , check your programmer guide ".
try different chip if available .
Upvotes: 2
Reputation: 620
It looks like your problem lies with the ATmega16 simply not being powered up. Keep in mind that your programmer specifically applies power to the target, then you need to power it yourself. This can be a problem with many cheap development boards.
While it is weird that you are pressing Read all
rather than Program
or Write
or whatever your programming program would have, this error would have popped up either way considering the issue.
To find out if it is powered, generally a development board will have a power LED but in case you don't have that kind of indication, check with a multimeter on the VCC and GND pins of the atmega16. From the picture below, you can see that you could check those pins at pin 10 and 11, but I would recommend checking rather at pin 10 and 31 to avoid shorting them together by accident.
If it turns out that your device is powered on, then you do need to check your SPI connections as the AVR is programmed through the SPI port. If they are connected just fine, you can check to see if they are actually sending data by using a logic analyzer. If they aren't sending data, then you have a problem with your actual programmer
If it turns out that those are fine and functional, then I would bet that your Atmega16 is faulty or counterfeit.
Upvotes: 2
Reputation: 6891
why do you want to "Read All"? i thought your intention is to program your device and not to read out its memories.
But your true problem is the connection to the device is not working. look at the manual or tutorial of your programming adapter on how to use it.
The following (incomplete) list may contain the most common errors:
Upvotes: 1