More ATmega644 problems!

Well, some of you may know I've been struggling to get a bootloader onto a set of ATmega644s, and I'm happy to say that I've succeeded (or at least the IDE thinks I have).

Now that I've (apparently) got a bootloader on the chips, I'm trying to upload a program, but whenever I compile a script with the Sanguino board selected, I get an Error with a very long file path followed by

undefined reference to 'main'

As you can imagine, this is quite frustrating. I have no idea what to do.

As a side thought, does the Sanguino bootloader flash an LED (like the 328's pin 13) when it resets? I've tried both attaching an LED to pin 13 (as seen by the IDE) and pin 7 (which is the SCK pin; I thought maybe that would work because Arduino's pin 13 is the SCK).

Thanks :expressionless:

  1. did you get a crystal off of 6 inch long wire
  2. I would check to see which pin the Sanguino is actually toggling, it should be easy to spot in the schematic
  1. did you get a crystal off of 6 inch long wire

Yes. As it turns out, I had the crystal on the wrong pins anyways, but it also now only about an inch away.

  1. I would check to see which pin the Sanguino is actually toggling, it should be easy to spot in the schematic

Well, here's the schematic. Looks like pin 1 on the 644. I'll go attach an LED there and tell you what happens.

[edit]Yay! Now I get 4 flashes as I push the reset button. Now I just need to figure out what the reference to 'main' error is...[/edit]

good question, outside of interpreted languages and wrapped up arduino like stuff I am really bare bones DURH! with C and any other language that is not a pretty little package for me to sandbox with

I'm the same way :(. The way the Arduino IDE translates my "digitalWrite()"s into a port manipulation is closeto magic in my eyes. I'll just have to hope someone else comes along, or else I stumble upon the solution.

I had the problem not so long time ago with Arduino 0018.

Copy the main.cpp file of the standard Arduino core to the Sanguino core.

If you are not using 644Ps then you need to modify the sanguino stuff for the 644.

Look on this site: Redirect Notice
There is some info on there about changing the sanguino loader for 644s.

Mowcius

how yes, for that you need to change the boards.txt file:

sanguino.name=Sanguino
sanguino.upload.protocol=stk500
sanguino.upload.maximum_size=63488
sanguino.upload.speed=38400
sanguino.bootloader.low_fuses=0xFF
sanguino.bootloader.high_fuses=0xDC
sanguino.bootloader.extended_fuses=0xFD
sanguino.bootloader.path=atmega644p
sanguino.bootloader.file=ATmegaBOOT_644.hex
sanguino.bootloader.unlock_bits=0x3F
sanguino.bootloader.lock_bits=0x0F
sanguino.build.mcu=atmega644
sanguino.build.f_cpu=16000000L
sanguino.build.core=sanguino
sanguino.verbose=false

I build a Sanguino board and there are only a couple things
I needed to do to get it to work with the Arduino tools.

  • added a compile switch for the LED
    pin. I connect the LED to PORTD Pin 7.
  • changed the clock frequency in the Makefile. My board
    runs at 12MHz (3.3V system).
  • Added the Sanguino libraries
  • Added an entry block to boards.txt

The board is called an NB2A. There is some application information
on my website. See Loading...
Also I have a DAC and RTC application hint.

(* jcl *)


www: http://www.wiblocks.com
twitter: http://twitter.com/wiblocks
blog: http://luciani.org

Awesome! I had already changed all the files to reflect the 644 instead of the 644p, but it seems that it was the lack of main.cpp that was screwing it up! The script compiled fine, I'll let you know how it uploads!

HUZZAH! It all works! My 644 is happily flashing an LED on pin 0! :slight_smile:

Thanks so much! :slight_smile: