From: David K. <dvd...@po...> - 2020-11-23 22:18:10
|
Hi, I've been trying to get AmForth onto this Atmega 8 based platform: https://www.elektronik-labor.de/Lernpakete/Pingong.html https://www.elektronik-labor.de/Elo/ELO.html Which is sold cheaply as a toy: https://de.elv.com/franzis-ping-pong-das-retro-spiel-zum-selberbauen-bausatz-144843 Already soldered the ISP connector and a serial TTL cable. However, AmForth (v6.9) does not seem to compile for Atmega8 in its current version. Copying the template directory and editing makefile to say "MCU=atmega8", I'm getting a lot of compiler errors that indicate an overflow of the RWW dictionary space: ../../avr8\amforth-interpreter.asm(4): error: Overlap in .cseg: addr=0xc00 conflicts with 0x7a:0xc58 ../../avr8\amforth-interpreter.asm(5): error: Overlap in .cseg: addr=0xc01 conflicts with 0x7a:0xc58 [..] If I randomly comment out words in avr/appl_2k.inc, I get a little further. However, then compilation errs out in the UART driver code and complains about stuff in macros.asm: ../../avr8\drivers/usart_0.asm(1): error: Undefined symbol: UBRR0L ../../avr8\drivers/usart_0.asm(2): error: Undefined symbol: UBRR0H ../../avr8\drivers/usart_0.asm(3): error: Undefined symbol: UCSR0C ../../avr8\drivers/usart_0.asm(4): error: Undefined symbol: UCSR0B ../../avr8\drivers/usart_0.asm(5): error: Undefined symbol: UCSR0A ../../avr8\drivers/usart_0.asm(12): error: Undefined symbol: RXC0 ../../avr8\drivers/usart_0.asm(13): error: Undefined symbol: UDRE0 ../../avr8\drivers/usart_0.asm(14): error: Undefined symbol: TXEN0 ../../avr8\drivers/usart_0.asm(15): error: Undefined symbol: RXEN0 ../../avr8\drivers/usart_0.asm(16): error: Undefined symbol: RXCIE0 ../../avr8\drivers/usart_0.asm(17): error: Undefined symbol: UDRIE0 ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 And this is even before I try to resolve all the problems arising from the words that I commented out. Maybe the Atmega8-specific code has been bit-rotting without being used for too long already? What do you think are my chances to make this work again? Any ideas what's wrong about the Uart drivers and how to strip down AmForth to fit into 8 kB of flash? Or has AmForth just gotten too old and fat over the years to render this undertaking unachievable? (I did some experiments with an Arduino Uno clone first, and had no problem compiling and setting up AmForth on it.) Maybe the Arduboy [1] would be better suited to AmForth, but it's also more costly and complex to program. I'm also eyeing the uzebox [2], but getting its video driver into AmForth would be a daunting endevour. cheers, David [1] https://www.reichelt.de/arduboy-arduino-kompatibles-miniaturspielsystem-ard-arduboy-p254388.html?&trstct=pos_0&nbc=1 [2] http://belogic.com/uzebox/index.asp -- GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg Fingerprint: B63B 6AF2 4EEB F033 46F7 7F1D 935E 6F08 E457 205F |
From: tur b. <mai...@gm...> - 2020-11-25 00:43:37
|
David looks like preamble.Inc is not finding device.asm in devices/atmega8 could be to many folders in path. I have used avrstudio4 and enter the avr8/devices/atmega8 in its additional path setting, you may need to look up the serial the chip has and set that in the config file On Mon, 23 Nov 2020 22:18 David Kuehling, <dvd...@po...> wrote: > Hi, > > I've been trying to get AmForth onto this Atmega 8 based platform: > > https://www.elektronik-labor.de/Lernpakete/Pingong.html > https://www.elektronik-labor.de/Elo/ELO.html > > Which is sold cheaply as a toy: > > > https://de.elv.com/franzis-ping-pong-das-retro-spiel-zum-selberbauen-bausatz-144843 > > Already soldered the ISP connector and a serial TTL cable. However, > AmForth (v6.9) does not seem to compile for Atmega8 in its current > version. Copying the template directory and editing makefile to say > "MCU=atmega8", I'm getting a lot of compiler errors that indicate an > overflow of the RWW dictionary space: > > ../../avr8\amforth-interpreter.asm(4): error: Overlap in .cseg: addr=0xc00 > conflicts with 0x7a:0xc58 > ../../avr8\amforth-interpreter.asm(5): error: Overlap in .cseg: addr=0xc01 > conflicts with 0x7a:0xc58 > [..] > > If I randomly comment out words in avr/appl_2k.inc, I get a little > further. However, then compilation errs out in the UART driver code and > complains about stuff in macros.asm: > > ../../avr8\drivers/usart_0.asm(1): error: Undefined symbol: UBRR0L > ../../avr8\drivers/usart_0.asm(2): error: Undefined symbol: UBRR0H > ../../avr8\drivers/usart_0.asm(3): error: Undefined symbol: UCSR0C > ../../avr8\drivers/usart_0.asm(4): error: Undefined symbol: UCSR0B > ../../avr8\drivers/usart_0.asm(5): error: Undefined symbol: UCSR0A > ../../avr8\drivers/usart_0.asm(12): error: Undefined symbol: RXC0 > ../../avr8\drivers/usart_0.asm(13): error: Undefined symbol: UDRE0 > ../../avr8\drivers/usart_0.asm(14): error: Undefined symbol: TXEN0 > ../../avr8\drivers/usart_0.asm(15): error: Undefined symbol: RXEN0 > ../../avr8\drivers/usart_0.asm(16): error: Undefined symbol: RXCIE0 > ../../avr8\drivers/usart_0.asm(17): error: Undefined symbol: UDRIE0 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > > And this is even before I try to resolve all the problems arising from > the words that I commented out. > > Maybe the Atmega8-specific code has been bit-rotting without being used > for too long already? What do you think are my chances to make this > work again? Any ideas what's wrong about the Uart drivers and how to > strip down AmForth to fit into 8 kB of flash? Or has AmForth just > gotten too old and fat over the years to render this undertaking > unachievable? > > (I did some experiments with an Arduino Uno clone first, and had no > problem compiling and setting up AmForth on it.) > > Maybe the Arduboy [1] would be better suited to AmForth, but it's also > more costly and complex to program. I'm also eyeing the uzebox [2], but > getting its video driver into AmForth would be a daunting endevour. > > cheers, > > David > > [1] > https://www.reichelt.de/arduboy-arduino-kompatibles-miniaturspielsystem-ard-arduboy-p254388.html?&trstct=pos_0&nbc=1 > [2] http://belogic.com/uzebox/index.asp > -- > GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg > Fingerprint: B63B 6AF2 4EEB F033 46F7 7F1D 935E 6F08 E457 205F > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |
From: Tristan W. <ho...@tj...> - 2020-11-25 06:41:42
|
Hello David, The ping-pong[1] looks interesting! You are correct the ATMega8 does present some challenges for AmForth 6.9 This issue came up on the mailing list earlier this year. > Any ideas what's wrong about the Uart drivers https://sourceforge.net/p/amforth/mailman/message/37085124/ > and how to strip down AmForth to fit into 8 kB of flash? Or has > AmForth just gotten too old and fat over the years to render this > undertaking unachievable? https://sourceforge.net/p/amforth/mailman/message/37085843/ I think also that the ATMega8 may be missing some assembly instructions that are now relied upon by the current build. Whether it is technically possible to put AmForth 6.9 on a diet such that it would fit in 8k flash I don't know, but faced with the task, I would try to do it on an ATMega328p first. >From a quick look at the ping-pong manual[3] I think it uses the internal RC oscillator as the system clock as I couldn't see a crystal or resonator. Sadly, the manual does not show a nicely socket-ed DIP-28 ATMega8. Otherwise replacing it physically with an ATMega328[2] might have been an option to consider. Best wishes, Tristan [1] https://de.elv.com/franzis-ping-pong-das-retro-spiel-zum-selberbauen-bausatz-144843 [2] https://www.avrfreaks.net/forum/difference-between-atmega8-and-atmega328 [3] https://files2.elv.com/public/14/1448/144843/Internet/144843_manual.pdf On 23Nov20 23:17, David Kuehling wrote: > Hi, > > I've been trying to get AmForth onto this Atmega 8 based platform: > > https://www.elektronik-labor.de/Lernpakete/Pingong.html > https://www.elektronik-labor.de/Elo/ELO.html > > Which is sold cheaply as a toy: > > https://de.elv.com/franzis-ping-pong-das-retro-spiel-zum-selberbauen-bausatz-144843 > > Already soldered the ISP connector and a serial TTL cable. However, > AmForth (v6.9) does not seem to compile for Atmega8 in its current > version. Copying the template directory and editing makefile to say > "MCU=atmega8", I'm getting a lot of compiler errors that indicate an > overflow of the RWW dictionary space: > > ../../avr8\amforth-interpreter.asm(4): error: Overlap in .cseg: addr=0xc00 conflicts with 0x7a:0xc58 > ../../avr8\amforth-interpreter.asm(5): error: Overlap in .cseg: addr=0xc01 conflicts with 0x7a:0xc58 > [..] > > If I randomly comment out words in avr/appl_2k.inc, I get a little > further. However, then compilation errs out in the UART driver code and > complains about stuff in macros.asm: > > ../../avr8\drivers/usart_0.asm(1): error: Undefined symbol: UBRR0L > ../../avr8\drivers/usart_0.asm(2): error: Undefined symbol: UBRR0H > ../../avr8\drivers/usart_0.asm(3): error: Undefined symbol: UCSR0C > ../../avr8\drivers/usart_0.asm(4): error: Undefined symbol: UCSR0B > ../../avr8\drivers/usart_0.asm(5): error: Undefined symbol: UCSR0A > ../../avr8\drivers/usart_0.asm(12): error: Undefined symbol: RXC0 > ../../avr8\drivers/usart_0.asm(13): error: Undefined symbol: UDRE0 > ../../avr8\drivers/usart_0.asm(14): error: Undefined symbol: TXEN0 > ../../avr8\drivers/usart_0.asm(15): error: Undefined symbol: RXEN0 > ../../avr8\drivers/usart_0.asm(16): error: Undefined symbol: RXCIE0 > ../../avr8\drivers/usart_0.asm(17): error: Undefined symbol: UDRIE0 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > > And this is even before I try to resolve all the problems arising from > the words that I commented out. > > Maybe the Atmega8-specific code has been bit-rotting without being used > for too long already? What do you think are my chances to make this > work again? Any ideas what's wrong about the Uart drivers and how to > strip down AmForth to fit into 8 kB of flash? Or has AmForth just > gotten too old and fat over the years to render this undertaking > unachievable? > > (I did some experiments with an Arduino Uno clone first, and had no > problem compiling and setting up AmForth on it.) > > Maybe the Arduboy [1] would be better suited to AmForth, but it's also > more costly and complex to program. I'm also eyeing the uzebox [2], but > getting its video driver into AmForth would be a daunting endevour. > > cheers, > > David > > [1] https://www.reichelt.de/arduboy-arduino-kompatibles-miniaturspielsystem-ard-arduboy-p254388.html?&trstct=pos_0&nbc=1 > [2] http://belogic.com/uzebox/index.asp > -- > GnuPG public key: http://dvdkhlng.users.sourceforge.net/dk2.gpg > Fingerprint: B63B 6AF2 4EEB F033 46F7 7F1D 935E 6F08 E457 205F > > > _______________________________________________ > Amforth-devel mailing list for http://amforth.sf.net/ > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |
From: Erich W. <ew....@na...> - 2020-11-25 18:58:22
|
Hallo David, long time no see :) well, unfortunately ... I have tried to assemble amforth-6.9 for atmega8. The uart thing is quite simple to fix, as has been pointed out: in template.asm: -.include "drivers/usart_0.asm" +.include "drivers/usart.asm" And you made some progress on the "Overlap in .cseg". cont. below ... David Kuehling writes: > Hi, > > I've been trying to get AmForth onto this Atmega 8 based platform: > > https://www.elektronik-labor.de/Lernpakete/Pingong.html > https://www.elektronik-labor.de/Elo/ELO.html > > Which is sold cheaply as a toy: > > https://de.elv.com/franzis-ping-pong-das-retro-spiel-zum-selberbauen-bausatz-144843 > > Already soldered the ISP connector and a serial TTL cable. However, > AmForth (v6.9) does not seem to compile for Atmega8 in its current > version. Copying the template directory and editing makefile to say > "MCU=atmega8", I'm getting a lot of compiler errors that indicate an > overflow of the RWW dictionary space: > > ../../avr8\amforth-interpreter.asm(4): error: Overlap in .cseg: addr=0xc00 conflicts with 0x7a:0xc58 > ../../avr8\amforth-interpreter.asm(5): error: Overlap in .cseg: addr=0xc01 conflicts with 0x7a:0xc58 > [..] > > If I randomly comment out words in avr/appl_2k.inc, I get a little > further. However, then compilation errs out in the UART driver code and > complains about stuff in macros.asm: > > ../../avr8\drivers/usart_0.asm(1): error: Undefined symbol: UBRR0L > ../../avr8\drivers/usart_0.asm(2): error: Undefined symbol: UBRR0H > ../../avr8\drivers/usart_0.asm(3): error: Undefined symbol: UCSR0C > ../../avr8\drivers/usart_0.asm(4): error: Undefined symbol: UCSR0B > ../../avr8\drivers/usart_0.asm(5): error: Undefined symbol: UCSR0A > ../../avr8\drivers/usart_0.asm(12): error: Undefined symbol: RXC0 > ../../avr8\drivers/usart_0.asm(13): error: Undefined symbol: UDRE0 > ../../avr8\drivers/usart_0.asm(14): error: Undefined symbol: TXEN0 > ../../avr8\drivers/usart_0.asm(15): error: Undefined symbol: RXEN0 > ../../avr8\drivers/usart_0.asm(16): error: Undefined symbol: RXCIE0 > ../../avr8\drivers/usart_0.asm(17): error: Undefined symbol: UDRIE0 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > ../../avr8\macros.asm(94): error: jmp k: Unsupported instruction on ATmega8 > > And this is even before I try to resolve all the problems arising from > the words that I commented out. > > Maybe the Atmega8-specific code has been bit-rotting without being used > for too long already? What do you think are my chances to make this > work again? Any ideas what's wrong about the Uart drivers and how to > strip down AmForth to fit into 8 kB of flash? Or has AmForth just > gotten too old and fat over the years to render this undertaking > unachievable? Bitrot is maybe the wrong word for this. AmForth has grown in features and thus in size. 8 kiB flash is imho too small. It was too small for a long time already, because you really need a few kB free space for your own programm, right? Maybe starting with AmForth-4.x is more successful? You may be able to just get it to work, but then what? I would like to see, what needs to be stripped out until it fits. But I guess it is really not worth the effort. Just for the sake of the argument I tried AmForth-4.0 (release 2010-07-01). It does not assemble, even though there is only 1 overlap conflict. Sigh. The atmega8 has worked, but I have no idea which release made it fail the size constraints. Maybe I should place a more prominent warning on the webpage. Currently we have this: webpage> AmForth for the AVR8 needs 8 to 12 KB Flash memory, 80 webpage> bytes EEPROM, and 200 bytes RAM for the core system. > (I did some experiments with an Arduino Uno clone first, and had no > problem compiling and setting up AmForth on it.) > > Maybe the Arduboy [1] would be better suited to AmForth, but it's also > more costly and complex to program. I'm also eyeing the uzebox [2], but > getting its video driver into AmForth would be a daunting > endevour. Arduboy features a atmega32u4. AmForth does not have support for the USB interface, should that be important. uzebox features an atmega644 controller. Now that I use routinely and it has plenty of space. Dear David, you picked a new time sink, it seems. :-) Cheers, Erich > > cheers, > > David > > [1] https://www.reichelt.de/arduboy-arduino-kompatibles-miniaturspielsystem-ard-arduboy-p254388.html?&trstct=pos_0&nbc=1 > [2] http://belogic.com/uzebox/index.asp -- May the Forth be with you ... |
From: David K. <dvd...@po...> - 2020-11-30 12:36:46
|
Hi, thanks to all of you for your helpful replies. Was a little swamped with work and didn't find time to revisit the amForth-on-Pong problem... But with your comments so far, I think I'll give up on that idea. Luckily I now have a half-assembled Uzebox with some first vital signs (including a working grayscale video output), maybe this platform will prove to be more tolerant WRT my amForth ambitions (but maybe not before New Year). >>>>> "Erich" == Erich Wälde <ew....@na...> writes: [..] > Arduboy features a atmega32u4. AmForth does not have support for the > USB interface, should that be important. Good to know, but it looks lika arduboy does not use the physical UART pins [3], so maybe amForth could "just work" using those (at least if you assemble your arduboy yourself anyway). > uzebox features an atmega644 controller. Now that I use routinely and > it has plenty of space. Yes, time invested in getting amForth onto Uzebox will be better spent than trying to make the Atmega-8 port work. Partitioning the memory and adding some inter-call code may even provide a simple way to integrate "official" C/assembler board-support code (i.e. video, sound & controller interface) with amForth. Something like this [1-2] comes to my mind. Uzebox does not have a serial connector by default, but the corresponding pins are unused, so no obstacles there. > Dear David, you picked a new time sink, it seems. :-) Unfortunately, a new time sink picked me :) At least this is making Playstations and Nintendo Switches look very boring in comparison :) cheers, David [1] http://www.complang.tuwien.ac.at/anton/euroforth/ef10/papers/ertl.pdf [2] https://forth-ev.de/wiki/res/lib/exe/fetch.php/vd-archiv:4d2010-04.pdf ; see definition of "call1" [3] https://aws1.discourse-cdn.com/standard14/uploads/arduboy/original/2X/0/0f375e1fd71a1f596d9d182cec7916bceacc50fd.png |
From: Tristan W. <ho...@tj...> - 2020-12-05 17:38:17
|
A very minor item. avr8 has bm-set, bm-clear and bm-toggle as assembler words but does not appear to have bm-test. This is not a big thing as it is easily defined in forth as : bm-test ( c a -- c ) c@ and ; However, I've made myself an assembler version so I have a matching set. It seems only very marginally faster than the forth one above. ; ( bitmask byte-addr -- byte ) ; MCU ; return (byte at addr) AND bitmask VE_BM_TEST: .dw $ff07 .db "bm-test" .dw VE_HEAD .set VE_HEAD = VE_BM_TEST XT_BM_TEST: .dw PFA_BM_TEST PFA_BM_TEST: movw zl, tosl loadtos ld temp0, Z and tosl, temp0 clr tosh ; zero high byte of TOS jmp_ DO_NEXT msp430 is missing bm-toggle and arm, risc-v have none of them. It also seemed a reasonable opportunity to try out tester-amforth.frt I could well be using it incorrectly. Corrections welcomed. \ #include tester-amforth.frt variable v $ffff v ! \ some passes and fails to see what it looks like \ should pass t{ $ff v bm-test -> $ff }t \ should pass t{ $1 v bm-test -> $1 }t \ should pass t{ $0 v bm-test -> $0 }t \ should pass t{ $ffff v bm-test -> $ff }t \ should fail t{ $ffff v bm-test -> $ffff }t \ should pass t{ $ff00 v bm-test -> $00 }t \ should fail t{ $ff00 v bm-test -> $ff00 }t \ Not sure if this is an approved way of using t{ ... }t \ should pass for all values : test.1 #256 0 ?do i v ! #256 0 ?do t{ i v bm-test -> j $ff and i and }t loop loop ; \ intentionally broken word : bm-broken ( mask a -- n ) 2dup c@ dup 23 = rot rot = and if drop drop 0 else bm-test then ; \ should fail only once when i=j=23 : test.2 #256 0 ?do i v ! #256 0 ?do j 23 = if i . cr then t{ i v bm-broken -> j $ff and i and }t loop loop ; Best wishes, Tristan |