Pages: [1]   Go Down
Author Topic: boards.txt entry for atmega128  (Read 1266 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can somebody please help me to set up a boards.txt file for atmega128? I'm using a USBasp programmer to program my AVR's.
My current setup is as follows:
Code:
atmega128.name=ATmega128 (USBasp)
atmega128.upload.using=arduino:usbasp
atmega128.upload.maximum_size=129024

atmega128.bootloader.low_fuses=0xFF
atmega128.bootloader.high_fuses=0xDC
atmega128.bootloader.extended_fuses=0xFF
atmega128.bootloader.path=atmega
atmega128.bootloader.file=ATmegaBOOT_128.hex
atmega128.bootloader.unlock_bits=0x3F
atmega128.bootloader.lock_bits=0x2F

atmega128.build.mcu=atmega128
atmega128.build.f_cpu=8000000L
atmega128.build.core=arduino
atmega128.build.variant=standard

Actually this allows me to upload sketch to the microcontroller, but my code just doesn't gets executed.

Here's my test code:
Code:
void setup() {
 // output
 DDRD |= 1<<PD1;
}

void loop() {
 // toggle
 PORTD ^= 1<<PD1;
 delay(200);
}

Once I upload it, my LED just does not start to blink. However, if I try to write the same in AVR studio and upload binary with khazhama programmer, connected LED blinks just fine.
Here's code from AVR studio that works just fine:
Code:
#define F_CPU 8000000
#include <avr/io.h>
#include <util/delay.h>

int main() {
// output
DDRD |= 1<<PD1;
while(1) {
// toggle
PORTD ^= 1<<PD1;
  _delay_ms(200);
   }
  return 0;
}

So, can anybody tell me what's wrong with my arduino's setup? Why doesn't my sketch gets executed if uploaded by Arduino IDE?
« Last Edit: April 02, 2012, 12:29:52 am by Zandis » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12285
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The ATmega128 timer 0 is considerably different from the "normal" ATmega timer 0.  My suspicion is the Arduino Core is not initializing it correctly.
Logged

Pages: [1]   Go Up
Jump to: