From: Erich W. <ew....@na...> - 2010-08-12 17:25:57
|
For the records: 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 Cheers, Erich > ver amforth 3.8 ATmega328P ok > words i@ (i!) i! e@ e! not s>d up! up@ >< cmove> unloop i sp! sp@ rp! rp@ +! rshift lshift 1- 1+ xor or and 2* 2/ invert um* um/mod m* + - log 2 d< d> 0> u> u< true 0 0< > < 0= = <> r@ >r r> rot drop over swap ?dup dup c@ c! ! @ execute exit -int +int fill show-wordlist order ge t-order get-current environment? environment end-code code abort abort" [char] immediate recurse user constant variable [ ] ; :noname : does> create ?do leave +loop loop do again until repeat while begin then else if literal int! applturnkey +usart baud tx? tx rx? rx is R defer Edefer words s" ." .s u. dinvert d- d+ d2* init-user ee>ram ee-user tib d2/ cmove dnegate dabs d>s j * defer@ defer! icompare find search-wordlist to value unused noop ver ?stack interpret depth rp0 sp sp0 cold pause quit place word /string source cscan parse 2swap >number number char refill accept cskip throw catch handler ' type count spaces space cr icount itype s, digit? ud/mod ud.r ud. . d. .r d.r sign #> #s # <# hold hld within max min abs mod / negate u/mod */ /mod */mod turnkey heap edp bl hex decimal bin ['] , compile ( \ a llot here /key key? key emit? emit pad #tib >in cell+ cells base state f_cpu ok > : one 1 ; ok > 1 2 3 .s 0 2217 3 1 2219 2 2 2221 1 ok > one ok > .s 0 2215 1 1 2217 3 2 2219 2 3 2221 1 ok On 08/07/2010 08:45 PM, Erich Waelde wrote: > Hello, > > playing with an duemilanove board (atmega328p). > > I'm building this from files in amforth/releases/4.0/app/template > not from the arduino directory. This setup is big enough to just > work (tested on atmega32). > > So with the following changes to template.asm > diff -wu template.asm ../../amforth/releases/4.0/appl/template/template.asm > --- template.asm 2010-08-07 20:31:40.000000000 +0200 > +++ ../../amforth/releases/4.0/appl/template/template.asm 2010-07-02 21:16:39.000000000 +0200 > @@ -12,19 +12,12 @@ > ; files include the *def.inc from atmel internally. > .include "device.asm" > > -; fixes for atmega328p > -.equ TXEN = TXEN0 > -.equ UCSZ0 = UCSZ00 > -.equ RXEN = RXEN0 > -.equ RXCIE = RXCIE0 > - > - > ; amforth needs two essential parameters > ; cpu clock in hertz, 1MHz is factory default > -.equ F_CPU = 16000000 > +.equ F_CPU = 8000000 > > ; initial baud rate of terminal > -.include "drivers/usart_0.asm" > +.include "drivers/usart.asm" > .equ BAUD = 9600 > .equ USART_B_VALUE = (1<<TXEN) | (1<<RXEN) | (1<<RXCIE) > .equ USART_C_VALUE = (3<<UCSZ0) > > > and > MCU=atmega328p > in makefile, I can successfully build an amforth, upload it to the controller, > and talk to it: > > > ok > > > ok > > ver > amforth 4.0 ATmega328P ok > > words > i@ (i!) i! e@ e! not s>d up! up@>< cmove> unloop i sp! sp@ rp! rp@ +! rshift lshift 1- 1+ xor or and 2* 2/ invert um* um/mod m* + - log > 2 d< d> 0> u> u< true 0 0< > < 0= =<> r@>r r> rot drop over swap ?dup dup c@ c! ! @ execute exit -int +int show-wordlist +usart baud t > x? tx rx? rx order get-order get-current environment? environment end-code code abort abort" [char] immediate recurse user constant vari > able [ ] ; :noname : does> create ?do leave +loop loop do again until repeat while begin then else if literal int! applturnkey is Rdefer > Edefer words s" ." .s u. dinvert d- d+ d2* init-user ee>ram ee-user tib d2/ cmove dnegate dabs d>s j * defer@ defer! icompare find sear > ch-wordlist to value unused noop ver ?stack interpret depth rp0 sp sp0 cold pause quit place word /string source cscan parse 2swap>numb > er number char refill accept cskip throw catch handler ' type count spaces space cr icount itype s, digit? ud/mod ud.r ud. . d. .r d.r s > ign #> #s #<# hold hld within max min abs mod / negate u/mod */ /mod */mod turnkey bl hex decimal bin ['] , compile ( \ allot here edp > dp /key key? key emit? emit pad #tib>in cell+ cells base state f_cpu ok > > > HOWEVER, after trying to create a new word, it stops working: > > > : one 1 ; > ?? -13 10 > > 1 .s > ?? -13 5 > > .s > ?? -13 3 > > .s > ?? -13 3 > > 1 > ok > > . > ok > > depth > ?? -13 6 > > This looks to me like the pointer to the wordlist has gone off into the wild. > Comparing template.asm to arduino/duemilanove.asm does not show suspicious > differences (see below). > > More ideas? > Erich > > > diff -wu template.asm ../../amforth/releases/4.0/appl/arduino/duemilanove.asm | less > --- template.asm 2010-08-07 20:31:40.000000000 +0200 > +++ ../../amforth/releases/4.0/appl/arduino/duemilanove.asm 2010-07-02 21:16:37.000000000 +0200 > @@ -1,48 +1,23 @@ > -; This is a template for an amforth project. > -; > -; The order of the entries (esp the include order) must not be > -; changed since it is very important that the settings are in the > -; right order > -; > -; first is to include the macros from the amforth > -; directory > .include "macros.asm" > - > -; include the amforth device definition file. These > -; files include the *def.inc from atmel internally. > .include "device.asm" > > -; fixes for atmega328p > -.equ TXEN = TXEN0 > -.equ UCSZ0 = UCSZ00 > -.equ RXEN = RXEN0 > -.equ RXCIE = RXCIE0 > - > + .equ HLDSIZE = $10 ; 16 bit cellsize with binary representation > + .equ TIBSIZE = $64 ; 80 characters is one line... > + .equ APPUSERSIZE = 0 ; size of application user area > > -; amforth needs two essential parameters > -; cpu clock in hertz, 1MHz is factory default > +; cpu clock in hertz > .equ F_CPU = 16000000 > - > -; initial baud rate of terminal > +; baud rate of terminal > .include "drivers/usart_0.asm" > .equ BAUD = 9600 > -.equ USART_B_VALUE = (1<<TXEN) | (1<<RXEN) | (1<<RXCIE) > -.equ USART_C_VALUE = (3<<UCSZ0) > - > - > -.equ HLDSIZE = $10 ; 16 bit cellsize with binary representation > -.equ TIBSIZE = $64 ; ANS94 needs at least 80 characters per line > -.equ APPUSERSIZE = 0 ; size of application specific user area in bytes > - > -; addresses of various data segments > -.set here = ramstart ; initial HERE at compile time, grows upward > -.set rstackstart = RAMEND ; start address of return stack, grows downward > -.set stackstart = RAMEND - 80 ; start address of data stack, grows downward > -.equ amforth_interpreter = max_dict_addr ; the same value as NRWW_START_ADDR > -; change only if you know what to you do > -.equ NUMWORDLISTS = 8 ; number of word lists in the searh order, at least 8 > +.equ USART_B_VALUE = (1<<TXEN0) | (1<<RXEN0) | (1<<RXCIE0) > +.equ USART_C_VALUE = (1<<UCSZ01) | ( 1<<UCSZ00) > > -.equ want_fun = 0 ; in case of an error out print an additional line with an caret indicating the error position > +.set here = ramstart ; start address of HERE, grows upward > +.set rstackstart = RAMEND > +.set stackstart = RAMEND - 80 > +.set amforth_interpreter = max_dict_addr > > -; include the whole source tree. > +.set NUMWORDLISTS = 8 > +.equ want_fun = 0 > .include "amforth.asm" > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |