On 09.09.2021 09:37, Tristan Williams wrote:
Hi Helge,
A mystery, but given that, as far as I know, every (modern) build
eventually uses avrasm2.exe to create the hex files, one that should
be solvable.
I absolutely agree. And the Studio 7 comes with avrasm2. There is a
version update from 2.1.52 as you can find in
appl\atmega2561\atmega256.lst to the current version 2.2.8. But this is
not important.
Given that you have an UNO build working, I can only
think that your atmega2560 build is not finding all the needed files
(or finding some it shouldn't) or that the build target is not
actually an atmega2560.
The target is an atmega2560. The device signature is 0x1e9801, and C
programs run fine.
I use a Makefile based build (on macos) that is based on the one that
is part of the distribution. I can send you an archive with the
Makefile, list file, etc. for you to check over. I don't have access
to a Windows machine or I would try to replicate what you are doing.
It was not a question of the build environment (make/Studio) or the OS.
The main difference between the ATmega328P and the ATmega2560 is the is
that the file appl_8k.inc is included, if the flash size is > 8000. The
asmforth.asm can't be used in that case as it is described in
http://amforth.sourceforge.net/UG/windows.html
Instead of "amforth.asm" the file "asmforth-low.asm" must be included.
This can also be found at appl\atmega2561\atmega256.asm. But this
example is not for Arduino ATMEGA256. It uses a different USART for the
terminal.
Here is my working example:
; First is to include macros and default settings from the amforth
; directory.
.include "preamble.inc"
; amforth needs two essential parameters
; CPU clock in hertz, 1MHz is factory default
.equ F_CPU = 16000000
; and the actual USART port.
.include "drivers/usart_0.asm"
; Include the whole source tree.
.include "amforth-low.asm"
And here are the avrdude parameter to flash the device
-c usbasp -p m2560 -V -u -U flash:w:my.hex -U eeprom:w:my.eep \
-U efuse:w:0xFD:m -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m
I am happy that I can now start Forth on my ATMEGA2560 Arduino.
Best regards,
Helge
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel