I've made standalone Atmega2560(ATmega 2560-16PA, 2*22pF ceramic capacitors, 16MHz crystal resonator,100nF capacitor between GND and VCC) board, but I can't write any arduino code to it. I sucessfully wrote bootloder with my usbasp programmer from ARDUINO IDE(from Win7 x64 and ArchLinux), then I tried upload sketch(Blinky led - ledpin=13, ATmega pin=26) also with USBasp -
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
NOTHING HAPPENS.
Then I tried programm sketch without bootloader - also nothing happens. (Changed necessary files)
preferences.txt:
upload.using=usbasp
and also boards.txt:
###mega2560.upload.protocol=wiring
###mega2560.upload.maximum_size=258048
###mega2560.upload.speed=115200
mega2560.upload.using=usbasp
NOTHING HAPPENED Then I tried burn bootloader, using avrdude:
$ avrdude -c usbasp -p m2560 -P usb -b 115200 -e -u -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xD8:m -U efuse:w:0xFF:m
$ avrdude -c usbasp -p m2560 -P usb -b 115200 -V -U flash:w:stk500boot_v2_mega2560.hex
$ avrdude -c usbasp -p m2560 -P usb -b 115200 -U lock:w:0x0F:m
ALSO NOTHING HAPPENED, then I wrote simple programm in AVR Studio 6, uploaded with my USBasp programmer
#define F_CPU 16000000UL
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB=0xFF;
while(1){
PORTB=0x00;
_delay_ms(500);
PORTB=0x80;
_delay_ms(500);
}
return 0;
}
Uploaded, and LED blinks without any problems. So there is no errors in schematic.
Then I followed these instructions:
- http://www.jayconsystems.com/tutorial/atmerpt1/
-
http://www.jayconsystems.com/tutorial/cat/Arduino/post/atmerpt2/
Also nothing happens. I have already developed some piece of code with Arduino libraries so I don't want to re-write everything in C, using AVR Studio.