Lauszus / Sanguino

Sanguino add-on for the Arduino IDE, based on http://code.google.com/p/sanguino/
https://lauszus.github.com/Sanguino/
185 stars 96 forks source link

Reprap motherboard #2

Closed timknapen closed 11 years ago

timknapen commented 11 years ago

Hi, I've just tested your Sanguino library with Arduino 1.5.2 and a Reprap motherboard v1.2 ( http://reprap.org/wiki/Motherboard_1.2 ) I couldn't get my sketch to upload until I changed https://github.com/Lauszus/Sanguino/blob/master/avr/boards.txt to include this:

## Reprap Motherboard v1.2
menu.cpu.sanguino.reprap=Reprap Motherboard v1.2

menu.cpu.sanguino.reprap.upload.maximum_size=63488
menu.cpu.sanguino.reprap.upload.speed= 38400

menu.cpu.sanguino.reprap.bootloader.low_fuses=0xFF
menu.cpu.sanguino.reprap.bootloader.high_fuses=0x9A
menu.cpu.sanguino.reprap.bootloader.extended_fuses=0xFF
menu.cpu.sanguino.reprap.bootloader.file=atmega/ATmegaBOOT_168_atmega644a.hex

menu.cpu.sanguino.reprap.build.mcu= atmega644p
menu.cpu.sanguino.reprap.build.f_cpu=16000000L
Lauszus commented 11 years ago

What kind of microcontroller is there on your board? I'm asking because you have selected the bootloader for the ATmega644A, but your build mcu is set to ATmega644P. Also is it running at 16MHz or 8MHz? Because you have selected the upload speed to be 38400, but it should be 57600 for the 16MHz version - note that you have selected 16000000L for the clock speed.

timknapen commented 11 years ago

yes, I know it's a bit weird. The silkscreen on the Reprap motherboard says ATMEGA644A, but the chip on the board says ATMEGA644P and the silkscreen says 16Mhz but it won't upload with 57600, I will get "avrdude: stk500_getsync(): not in sync: resp=0xcc" if I try. The settings above are actually working.

Lauszus commented 11 years ago

Okay, then select "ATmega644P (16 MHz)": https://github.com/Lauszus/Sanguino/blob/master/avr/boards.txt#L74 and then burn the bootloader. I guess that you havn't done that, right? Please also confirm that it's a 16MHz crystal that is connected to the microcontroller by looking at the number on top of the crystal.

timknapen commented 11 years ago

Ok, I've tested again. ATmega644P (16 MHz) gives "avrdude: stk500_getsync(): not in sync: resp=0xcd" the crystal has 16.0C84 on top. like here: http://farm4.static.flickr.com/3359/3408137493_aa06e56150.jpg (except the image has 85 instead of 84)

please tell me if you need me to test anything else.

Lauszus commented 11 years ago

Okay. Have you tried uploading a new bootloader to the microcontroller, by selecting the "ATmega644P (16 MHz)" and then selecting tools>Burn Bootloader. You can read more about it here: http://arduino.cc/en/Hacking/Bootloader?from=Main.Bootloader and here: http://arduino.cc/en/Tutorial/ArduinoISP.

timknapen commented 11 years ago

No I haven't. why would I want to do that?

Lauszus commented 11 years ago

Because that's the hole point of the hardware addon I provided. I have no idea of whats running at your device right now.

Also if you upload the new bootloader the upload speed will be faster meaning you don't have to wait that long for a sketch to upload. If you don't want to upload a new bootloader you can simply change this line: https://github.com/Lauszus/Sanguino/blob/master/avr/boards.txt#L77 to 38400.

timknapen commented 11 years ago

hm I think I see. The problem is I don't have an AVR ISP so I can't test that.

Lauszus commented 11 years ago

If you have a second Sanguino or Arduino you can simply upload the ArduinoISP sketch by navigating to File>Example>ArduinoISP and then use your other microcontroller as a programmer. You can read more about it here: http://arduino.cc/en/Tutorial/ArduinoISP.

timknapen commented 11 years ago

Alright! thanks for all the help, I will probably be able to try that tomorrow. plenty of arduinos lying around here :-)

Lauszus commented 11 years ago

You are welcome :) I will close this issue for now, feel free to send another message if you need more help!