[Amforth] Fwd: can not compile amforth for atmega2560

2014-11-12 Thread Ronny Suy


Hi

I can succesfully compile amforth for atmega644 and atmega1284 , but for 
atmega2560 I get a lot of almost identical errors , see below copy/paste.
I'm working under ubuntu , but trying your solution for windows + 
avrstudio6.1 , it looks the same errors are produced.

Does anybody know what the problem could be ?

Thanks !

Ronny Suy
Belgium

ronny@ronny-Aspire-X3475:/media/ronny/16GB 
USB3/amforth-5.5/appl/atmega2560 board$ make
wine ../../Atmel/avrasm2.exe -I ../../Atmel/Appnotes2 -I ../../core -I 
../../core/devices/atmega2560 -fI -v0 -e template.eep.hex -l 
template.lst template.asm
../../core\words/store-i_big.asm(38): error: Overlap in .cseg: 
addr=0x1f000 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(42): error: Overlap in .cseg: 
addr=0x1f001 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(43): error: Overlap in .cseg: 
addr=0x1f002 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(44): error: Overlap in .cseg: 
addr=0x1f003 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(45): error: Overlap in .cseg: 
addr=0x1f004 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(46): error: Overlap in .cseg: 
addr=0x1f005 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(47): error: Overlap in .cseg: 
addr=0x1f006 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(49): error: Overlap in .cseg: 
addr=0x1f007 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(50): error: Overlap in .cseg: 
addr=0x1f008 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(51): error: Overlap in .cseg: 
addr=0x1f009 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(55): error: Overlap in .cseg: 
addr=0x1f00a conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(56): error: Overlap in .cseg: 
addr=0x1f00b conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(57): error: Overlap in .cseg: 
addr=0x1f00c conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(60): error: Overlap in .cseg: 
addr=0x1f00d conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(61): error: Overlap in .cseg: 
addr=0x1f00e conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(62): error: Overlap in .cseg: 
addr=0x1f00f conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(63): error: Overlap in .cseg: 
addr=0x1f010 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(68): error: Overlap in .cseg: 
addr=0x1f011 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(70): error: Overlap in .cseg: 
addr=0x1f012 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(71): error: Overlap in .cseg: 
addr=0x1f013 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(72): error: Overlap in .cseg: 
addr=0x1f014 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(74): error: Overlap in .cseg: 
addr=0x1f015 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(75): error: Overlap in .cseg: 
addr=0x1f016 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(78): error: Overlap in .cseg: 
addr=0x1f017 conflicts with 0x1f000:0x1f3b8
../../core/devices/atmega2560\device.asm(11): error: Overlap in .cseg: 
addr=0x1f018 conflicts with 0x1f000:0x1f3b8
../../core/devices/atmega2560\device.asm(12): error: Overlap in .cseg: 
addr=0x1f019 conflicts with 0x1f000:0x1f3b8
../../core/devices/atmega2560\device.asm(13): error: Overlap in .cseg: 
addr=0x1f01a conflicts with 0x1f000:0x1f3b8
../../core/devices/atmega2560\device.asm(14): error: Overlap in .cseg: 
addr=0x1f01b conflicts with 0x1f000:0x1f3b8
../../core\macros.asm(57): error: Overlap in .cseg: addr=0x1f01c 
conflicts with 0x1f000:0x1f3b8
../../core/devices/atmega2560\device.asm(16): error: Overlap in .cseg: 
addr=0x1f01d conflicts with 0x1f000:0x1f3b8
../../core/devices/atmega2560\device.asm(17): error: Overlap in .cseg: 
addr=0x1f01e conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(81): error: Overlap in .cseg: 
addr=0x1f01f conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(82): error: Overlap in .cseg: 
addr=0x1f020 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(83): error: Overlap in .cseg: 
addr=0x1f021 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(84): error: Overlap in .cseg: 
addr=0x1f022 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(85): error: Overlap in .cseg: 
addr=0x1f023 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(86): error: Overlap in .cseg: 
addr=0x1f024 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(88): error: Overlap in .cseg: 
addr=0x1f025 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(89): error: Overlap in .cseg: 
addr=0x1f026 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(91): error: Overlap in .cseg: 
addr=0x1f027 conflicts with 0x1f000:0x1f3b8
../../core\words/store-i_big.asm(92): 

[Amforth] Amforth News

2014-11-12 Thread Matthias Trute
Hi,

It's time to disclose the secret around the license change.

A few months ago I started playing with the naken_asm by
Mike Kohn to get rid of the Atmel assembler. The first 
changes were easy, some things were difficult to achieve
but one show stopper finally kncked me out: The naken_asm 
cannot generate a hex file for initialized EEPROM content.

Around the same time I re-found an old TI Stellaris
Lauchpad that I got a year or two ago from my
friends at the German Forth society and spent a few
hours with 4€4th and camelforth for the msp430. It was not
that difficult to get them working, the differences to amforth
are small but annoying (for me at least). The source code was a 
real surprise: almost like amforth. The same implementation
strategy (indirect threaded) and even the pre-assembled
forth code for many words is *really* close.

So I started to closely examine the camelforth sources
(Brad ported them to naken_asm earlier this year) to follow
the amforth style (that is: many small source files with XT_*
labels). A month ago or so I found a solution to have the 
same source code for both assemblers: the naken_asm for the 
MSP430 part and the Atmel assembler for the AVR8's.

Since Brad's code is GPLv3 I had to change the amforth license
to that level too to be compliant, not that I really liked
or enjoyed it, but law is law and beer is beer.

Finally: rev 1702 is a huge patch. It compiles and generates
working images (for me at least). People who come from
camelforth get a new command prompt. Exceptions and double
cell number output (no input yet) are working too. Recognizers
are almost done (need a way to put the recognizer stack
into the INFO flash).

Amforth users may find a long list of missing features, I'll
work on it to make it shorter. Maybe, sometimes both controllers
will have an identical feature set. Maybe this is impossible.
Future will tell. For now the new code is highly experimental
and not suitable for serious work, regressions are likly ;)

Matthias

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] Blinkenlichts.

2014-11-12 Thread Hannu Vuolasaho
Hello!

Every system needs lights. Well With this driver there can be a lot of lights. 
I wrote this against 5.5
Today's big merge might make this useless or at least require some tweaking.

While writing this driver I spend some time finding from .lst file which 
registers are allowed to use and how the word should be written. I think there 
should be some documentation or tips at least how to write assembler words. I 
wrote some notes.

It was my own stupidity to try sbiw temp0, 1 but took a while to notice and 
then think the alternative for it. Link to this kind of quirks and workarounds 
would be nice to have in docs too.

I wrote some kind of ugly delay macro. Something like that could be useful.

I noticed make doesn't start compilation if words/foo.asm is edited in project. 
Might be good idea to add that to the line.

The driver can be used like this:

21 buffer: rgb
: rgb-test 21 0 do rgb i + c! loop rgb 21 ws2811.write ;

$ff $ff $ff
$ff $ff 0
$ff 0 $ff
0 $ff $ff
$ff 0 0 
0 $ff 0
0 0 $ff
rgb-test 5000 ms 21 ws2811.off


ws2811.asm:


; Hannu Vuolasaho 2014

;This program is free software: you can redistribute it and/or modify
;it under the terms of the GNU General Public License as published by
;the Free Software Foundation, either version 2 of the License, or
;(at your option) any later version.

;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program.  If not, see http://www.gnu.org/licenses/.

; Device driver for WS2811 LED drivers.

; Rather stupid delay system.
; The 1000ns macro takes care the half clocks from 250ns delay.
eight_cycle_delay:
ret

.macro wait_cycles
  .set busy_wait =  ((@0 * @1) / F_CPU)
  .if (busy_wait  16)
call eight_cycle_delay
call eight_cycle_delay
.message 16 cycle
  .endif
  .if   (busy_wait  8)
call eight_cycle_delay
.message 8 cycle
  .endif
  .if   (busy_wait  4)
.message 4 cycle
rjmp  pc+1
rjmp  pc+1
  .endif
  .if   (busy_wait  2)
.message 2 cycle
rjmp  pc+1
  .endif
  .if   (busy_wait  1)
.message 1 cycle
nop
  .endif
.endmacro

.if (F_CPU  800)
.error WS2811 800 kHz driver can't work. F_CPU too slow
.endif
.macro ns250_fill_delay
  wait_cycles 3, 2000
.endmacro
.macro ns1000_fill_delay
  wait_cycles 9, 2000
.endmacro

.set WS2811_DDR=(WS2811_PORT-1)

;f* WS2811.WRITE
; NAME
;   WS2811.WRITE
; SYNOPSIS
;   WS2811.WRITE ( addr len -- ) Write array of 8-bit RGB values to LED chain.
; DESCRIPTION
;   Write RGB values to WS2811 device chain.
;**
; ( addr len -- )
; Hardware
; Write to WS2811 devices

VE_WS2811_WRITE:
.dw $ff0c
.db ws2811.write
.dw VE_HEAD
.set VE_HEAD = VE_WS2811_WRITE
XT_WS2811_WRITE:
.dw PFA_WS2811_WRITE
PFA_WS2811_WRITE:
; Reset WS2811
sbi WS2811_DDR, WS2811_BIT; Set as output
;Write zero
cbi WS2811_PORT, WS2811_BIT; Write zero
delay 50 ; Wait 50 usec
; Prepare to write
movw temp0, tosl ; len
loadtos
movw Z, tosl ; addr
in temp2, WS2811_PORT ; zero value
cbr temp2, (1  WS2811_BIT)
mov temp3, temp2 ; one value
sbr temp3, (1  WS2811_BIT)
; Save status register and disable interrupts. This is critical.
in temp4, SREG
cli
PFA_WS2811_WRITE_START:
ldi temp6, 7 ; Bit counter to 7
 ld temp5, Z+  ; Load from Z to 
PFA_WS2811_WRITE_CLK_6:
nop 
PFA_WS2811_WRITE_CLK_7:
nop
 ns1000_fill_delay
out WS2811_PORT, temp2   ; Pin DOWN 
PFA_WS2811_WRITE_CLK_9: 
lsl temp5 ; MSB to carry
ns250_fill_delay
PFA_WS2811_WRITE_CLK_0: 
out WS2811_PORT, temp3   ; Pin UP
  ns250_fill_delay
brcs PFA_WS2811_WRITE_CLK_3; If carry set jump CLK_3
out WS2811_PORT, temp2   ; Carry not set, pin DOWN
PFA_WS2811_WRITE_CLK_3: 
dec temp6; Bit counter -1 
brne PFA_WS2811_WRITE_CLK_6 ; Jump CLK_6 if bits  left to send from byte.
lsl temp5 ; MSB to carry
 brcc PFA_WS2811_WRITE_LOAD_CLOCK_8 ; If carry clear jump
 ldi temp6, 7 ; Bit counter to 7
ns1000_fill_delay
 out WS2811_PORT, temp2   ; Pin DOWN
nop
ns250_fill_delay
 out WS2811_PORT, temp3   ; Pin UP
ns250_fill_delay
subi temp0, 1; Byte counter -1
sbci temp1, 0; sbiw equivalent
 ;sbiw temp0, 1; Byte counter -1
 ld temp5, Z+  ; Next byte
 brne PFA_WS2811_WRITE_CLK_7 ; Jump CLK_7 if byte counter 0
ns1000_fill_delay
 rjmp PFA_WS2811_WRITE_EXIT_CLK_8 ; jump to end
PFA_WS2811_WRITE_LOAD_CLOCK_8:
ns1000_fill_delay 
out WS2811_PORT, temp2   ; Pin DOWN 
 ldi temp6, 7
ns250_fill_delay
 out WS2811_PORT, temp3   ;