|
From: Erich W. <ew....@na...> - 2010-08-13 18:34:09
|
Hi Christian,
On 08/13/2010 09:35 AM, Christian Kellermann wrote:
> Hi Erich!
>
> * Erich Waelde<ew....@na...> [100812 19:26]:
>> With help from Matthias it was found that the fuse settings were causing this.
>>
>> Using
>>
>> avrdude: reading hfuse memory: 0xd9
>> avrdude: reading lfuse memory: 0xff
>> avrdude: reading efuse memory: 0x05
>>
>> everything works as expected.
>> Please note that the above settings are different from what is found in
>> releases/4.0/appl/arduino/readme.txt
>
> Many thanks for debugging this! In which way apart from the fuses
> does your setup differ from the default one in the release/subversion
> repository?
use the files found in releases/4.0/appl/arduino
and move the line
.include "dict_minimum.inc"
from dict_appl_core.inc to dict_appl.inc
create a makefile (stolen from appl/template :-)
Please find a diff appended.
Cheers,
Erich
diff -Naur ../amforth/releases/4.0/appl/arduino/dict_appl_core.inc arduino//dict_appl_core.inc
--- ../amforth/releases/4.0/appl/arduino/dict_appl_core.inc 2010-07-02 21:16:37.000000000 +0200
+++ arduino//dict_appl_core.inc 2010-08-13 20:25:35.000000000 +0200
@@ -6,8 +6,6 @@
.include "words/istore_nrww.asm"
.include "words/ifetch.asm"
-.include "dict_minimum.inc"
-
.include "words/d-2star.asm"
.include "words/d-plus.asm"
.include "words/d-minus.asm"
@@ -31,4 +29,4 @@
.include "dict_compiler.inc"
.include "words/show-wordlist.asm"
-.include "device.inc"
\ No newline at end of file
+.include "device.inc"
diff -Naur ../amforth/releases/4.0/appl/arduino/dict_appl.inc arduino//dict_appl.inc
--- ../amforth/releases/4.0/appl/arduino/dict_appl.inc 2010-07-02 21:16:37.000000000 +0200
+++ arduino//dict_appl.inc 2010-08-13 20:25:48.000000000 +0200
@@ -2,3 +2,5 @@
; they may be moved to the core dictionary if needed
.include "dict_usart.inc"
+.include "dict_minimum.inc"
+
diff -Naur ../amforth/releases/4.0/appl/arduino/makefile arduino//makefile
--- ../amforth/releases/4.0/appl/arduino/makefile 1970-01-01 01:00:00.000000000 +0100
+++ arduino//makefile 2010-08-13 20:23:46.000000000 +0200
@@ -0,0 +1,87 @@
+# simple makefile for building the
+# template project.
+
+# sometimes the login shell causes trouble
+SHELL=/bin/bash
+
+# --- edit these values ------------------------------------
+# Name of your application (useful, if you rename template.asm)
+TARGET=duemilanove
+
+# versions before 2.1 may produce some warnings
+# but should produce a running system. You should
+# _always_ use the trunk.
+
+AMFORTH=../../amforth/releases/4.0/core
+#AMFORTH=../../core
+
+# the MCU should be identical to the device
+# setting in template.asm
+MCU=atmega328p
+
+# set the fuses according to your MCU
+LFUSE=0xFF
+HFUSE=0xD9
+# some MCU have this one, see write-fuses target below
+EFUSE=0x05
+
+# serial port
+CONSOLE=/dev/ttyUSB0
+
+# directories
+DIR_ATMEL=~/wine/AvrAssembler2
+
+# programms / flags
+SP12=-c sp12 -i 10 -P /dev/parport0
+USB=-c avr911 -P /dev/ttyUSB3
+PP=-c stk200 -P /dev/parport0
+JTAG=-c jtag2 -P /dev/ttyUSB2
+BURNER=$(SP12)
+AVRDUDE=avrdude
+AVRDUDE_FLAGS=-q $(BURNER) -p $(MCU)
+
+AVRA=avra -I $(DIR_ATMEL)/Appnotes2
+
+AVRASM=wine $(DIR_ATMEL)/avrasm2.exe -I $(DIR_ATMEL)/Appnotes
+
+# ----------------------------------------------------------
+
+INCLUDE=-I $(AMFORTH) -I $(AMFORTH)/devices/$(MCU)
+
+default: $(TARGET).hex
+
+erase:
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -e
+
+marker:
+ amforth-upload.py -t ${CONSOLE} lib/misc.frt lib/bitnames.frt lib/ans94/marker.frt devices/atmega328p.frt
+
+install: $(TARGET).hex
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -e -U flash:w:$(TARGET).hex:i -U eeprom:w:$(TARGET).eep.hex:i
+
+upload_file:
+ cat $(TARGET).fs | unfold_fs > $(TARGET).fs.unfold
+ trim_fs $(TARGET).fs.unfold > $(TARGET).fs.upload
+upload: upload_file
+ amforth-upload.py -t ${CONSOLE} $(TARGET).fs.upload
+
+$(TARGET).hex: $(TARGET).asm $(AMFORTH)/*.asm $(AMFORTH)/words/*.asm $(AMFORTH)/devices/$(MCU)/*.asm
+# $(AVRA) $(INCLUDE) --listmac -l $(TARGET).lst -m $(TARGET).map $(TARGET).asm
+ $(AVRASM) $(INCLUDE) -fI -v0 -e $(TARGET).eep.hex -l $(TARGET).lst $(TARGET).asm
+
+$(TARGET).back:
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:r:$(TARGET).hex:i -U eeprom:r:$(TARGET).eep.hex:i
+
+clean:
+ rm -f $(TARGET).hex
+ rm -f $(TARGET).eep.hex
+ rm -f $(TARGET).lst
+ rm -f $(TARGET).map
+ rm -f $(TARGET).cof
+ rm -f $(TARGET).obj
+
+write-fuse:
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -U efuse:w:$(EFUSE):m -U hfuse:w:$(HFUSE):m -U lfuse:w:$(LFUSE):m
+
+read-fuse:
+ $(AVRDUDE) $(AVRDUDE_FLAGS) -U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h -U lock:r:-:h
|