Re: [Amforth] how to use bitmask:

2019-06-17 Thread Matthias Trute
Hi Jan,

> I need to do a  bitmask on register.

The simplest operations are the ones documented
in the source file

\ Use it this way:
\ PORTD 7 portpin: PD.7  ( define portD pin #7)
\ PD.7 high  ( turn portD pin #7 on, i.e. set it high-
level)
\ PD.7 low   ( turn portD pin #7 off, i.e. set it low-
level)
\ PD.7  pulse( turn portD pin #7 for  high and low)
\ the following words are for "real" IO pins only
\ PD.7 pin_output( set DDRD so that portD pin #7 is output)
\ PD.7 pin_input ( set DDRD so that portD pin #7 is input)
\ PD.7 pin_high? ( true if pinD pin #7 is high)
\ PD.7 pin_low?  ( true if pinD pin #7 is low)
\ 

These word use only one bit.

> In bitnames.frt there is a word bitmask: How can I use it to do
> the two actions above?

Note that the hex coding is used (a single F means $f)

\ multi bit operation
\ PORTD F bitmask: PD.F  ( define the lower nibble of port d )
\ PD.F pin@  ( get the lower nibble bits )
\ 5 PD.F pin!( put the lower nibble bits, do not change the
others )

A bitmask operates on all bits that are 1 in the bitmask. All others
are unaffected, c! would overwrite all bits.

Matthias

___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Need some help with the SPI

2019-06-08 Thread Matthias Trute
Hi,

> You can also use the following words to avoid c!@spi, which is
> missing from the preassembled package for the Arduino:
> 
> 
> \ send a byte, ignore received byte
> : c!spi ( c -- )
> SPDR c! ( c addr -- )
> ;
> 
>   \ receive a byte, send a dummy one
> : c@spi ( -- c)
> 0 SPDR c! 1 ms SPDR c@
> ;
> 
> SPDR is a constant holding the address of the SPI data register (&78)

Thanks, I've added some comments to the spi.frt file.

Matthias


___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] I2C

2019-06-04 Thread Matthias Trute
Am Dienstag, den 04.06.2019, 18:39 + schrieb Jan Kromhout:
> Hello,
> 
> Ho do I set the parameters for the speed if the I2C to 400
> kHz?  Thanks for any help.
> 
> : init_i2c ( --- )
> \ init at 100 kHz
>   i2c.prescaler/1 #72 i2c.init
> ;
> 

Did you check http://amforth.sourceforge.net/TG/recipes/TWI.html#twi ?
(Javascript required)

Matthias

___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] SPI interface on the arduino

2019-06-04 Thread Matthias Trute
Hi,

> I need to read and write to the SPI interface (bus) on the arduino.
> (pin 10,11,12,13)
> Wich words are the best to use?

The ones desccribed in the SPI recipe are the best current
practice.

http://amforth.sourceforge.net/TG/recipes/SPI.html

The arduino hello world recipe shall give some
hints and further links for working with this platform

http://amforth.sourceforge.net/TG/recipes/Arduino-HelloWorld.html


HTH+BR
Matthias

___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Watchdog Timer on AVR8s

2019-06-02 Thread Matthias Trute
Hi,

Thanks for your analysis.

> This suggests that both the MCUSR and the WDTSR should be cleared on
> reset.
> 
> I've added a line:
>   out_ WDTCSR, zerol
> to COLD which covers it.

adding it to COLD in a central location is troublesome. Not all AVR8
have a watchdog at all and those who have one, have at least two
different ways to handle it. Rather difficult to implement centrally.

> 
> The minimum requirement is to clear both MCUSR.WDRF and WDTCSR.WDE.

AFAIK, the minimum reset intervall is 15ms, what makes it possible
to add the reset code to the application turnkey word. For debugging
purposes, the reset recipe may be helpful
http://amforth.sourceforge.net/TG/recipes/Reset.html

Matthias

___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth 6.8

2019-05-31 Thread Matthias Trute
Am Donnerstag, den 30.05.2019, 09:56 +0100 schrieb Martin Nicholas via
Amforth-devel:
> Taken me months to notice, but 6.8 still reports a "ver" of 6.7 from
> env-forthversion.asm

Thank you. In fact, for the AVR8 and MSP430 variants, version 6.8 is in
fact 6.7 since no changes were made for them.

Fixed for 6.9 :)

Matthias

___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Multiple uarts on ATmega2560

2019-04-08 Thread Matthias Trute

Hi,

It's a little late to respond..

I'm impressed. Good work. May I put a link
to your pages via the amforth cookbook?

Matthias


___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] ATmega4809 Curiosity Nano

2019-03-07 Thread Matthias Trute
Am Mittwoch, den 06.03.2019, 08:56 + schrieb Tristan Williams:
> I would like to try and see if I can get AmForth running on the
> ATmega4809 IC and specifically on the ATmega4809 Curiosity Nano
> [1]   
> 
> The ATmega4809 is a relatively new IC and so does not have a
> directory
> in amforth-6.8/avr8/devices. Consequently it does not have the part
> specific .frt , .asm , .inc , .py and .pyc files. These files suggest
> that they are automatically generated. Is this something I can do
> from
> the amforth-6.8 distribution?

I wrote a utility script that took the part description files
from the atmel studio as input and generates the files. Unfortunately,
the script is unmaintainable and Atmel / Microchip changed the
XML format every now and than. It's a big job, I'm afraid. No
quick fix.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Soft Serial Port

2019-02-16 Thread Matthias Trute
Am Samstag, den 16.02.2019, 13:13 + schrieb Tristan Williams:
> Matthias,
> 
> Do you have any objection to me putting up a link to my prebuilt hex
> files for the ARDUINO MEGA 2560?

No.

Simon^wGPL says... ;)

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Soft Serial Port

2019-02-16 Thread Matthias Trute
Am Freitag, den 15.02.2019, 08:21 + schrieb Tristan Williams:
> 
> I've linked (below) some AmForth words I've written to help me use
> the
> second hardware serial port on an AVR atmega mcu, should there be
> one.

Really nice. Good work

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] double-precision number to string conversion

2019-02-16 Thread Matthias Trute
Am Samstag, den 16.02.2019, 17:55 +0100 schrieb f.zelders--- via
Amforth-devel:
> Hello forth-professionals and fellow forth enthousiasts.
> 
> I created a word that converts a positive double-precision number to
> an 8 character string like this:
> 
> : dpNumberToString ( d -- address count )
>   <# # # # # # # # # #> ; 
> This works fine for positive numbers.
> However I want to convert negative double-precision numbers too.

Here's the code for d.r

: d.r   ( d n -- )
 >r swap over dabs <# #s rot sign #> r> over - spaces type 

the essential part is that the "swap over dabs" creates a signed
single cell number (value is not relevant) with the same sign as
the double cell number and the double number is converted to a 
positive number (dabs). Inside the <# #> block, sign uses the
signed number (again, numeric value irrelevant) to put the
- (or nothing) in the picture numeric buffer (pic).


Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Error

2019-01-18 Thread Matthias Trute
Hi,

> Where can I find some description of the used error numbers?
> 
> I have now -4

This is an exception, as explained in
http://amforth.sourceforge.net/TG/recipes/Exceptions.html

it has a link to the complete table at
http://amforth.sourceforge.net/TG/Architecture.html#exceptiontable


HTH
Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] String

2019-01-18 Thread Matthias Trute
Hi Jan,

> I try this and notting is happens. How do I use this to print a
> string when I run a compiled word?

please have a look at

http://amforth.sourceforge.net/TG/recipes/Simple-Strings.html

it should answer your question(s)

Matthias




___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New release 6.8

2019-01-07 Thread Matthias Trute
Hi,

It's been a long time since the last release so
I felt it's time for a new one.

The release 6.8 is an adventure release. It is
for the brave ones. It contains experimental 
stuff that is not yet stabilized. It's more a 
snapshot release of a work in progress. I welcome
feedback, patches etc.

The RISC-V can now compile to RAM. The amforth-shell 
utility can be used to upload code, some examples that 
are close to the CPU are included. Note that the dictionary
search is still awfully slow.

A by-product of the work on the RISC-V is another 
platform that found it's way to amforth: ARM. First 
with an old Launchpad Stellaris board, nobody but me 
probably still owns, and later on Linux too. To be 
more precious it runs inside a qemu on a PC and nativly on 
a Raspberry Pi. The Raspberry Pi can build amforth with 
the standard binutils too. This opens a door to the 
fascinating world of the Linux platform from the lowest 
level up. Since it's not running bare metal, all features of 
Linux are available, as long as ... code gets written. There 
is no interface to C libs, hard core syscall swi#0 is the 
way to go, examples included :)

Both 32-bit platforms share a great amount of code, and the
build toolchain too. All that would not be possible without
the work of Matthias Koch, the author of another great
Forth system called mecrisp. His system is much more 
complex however, I like the simple ones better ;)

All information about the new platforms is at the
website http://amforth.sf.net/.

What about the platforms AVR and MSP430? They got 
some small fixes, but nothing really breathtaking.
Update is recommended, but not strictly necessary.

Thanks to all, who contributed and kept the mailing 
list active. Your work is very appreciated!

Have fun
Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Reading from a TM1638

2019-01-06 Thread Matthias Trute
Am Donnerstag, den 03.01.2019, 15:49 + schrieb Jan Kromhout:
> hello,
> 
> The best wishes for 2019.

From my side too :=)

> 
> I’m try to get info from a TM1638 ( reading button status).
> This is my simple routine, I read the lower byte first!
> The code is simple and is straight forward
> Is the code correct?

Does it work as expected? I'd add a delay between the
clock-pin high and the data-pin high? to let things
stabilize. -> check the datasheet/code examples for 
the chip.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] microsecond delay

2019-01-06 Thread Matthias Trute
Am Freitag, den 04.01.2019, 18:46 + schrieb Tristan Williams:
> 
> On 03Jan19 16:07, Jan Kromhout wrote:
> > Hello,
> > 
> > Is in AmForth a microsecond delay available?
> > 
> > Cheers,
> > 
> > Jan
> > 
> 
> Jan,
> 
> As far as I know, whilst AmForth does have a millisecond word 1ms, it
> does not have an equivelent microsecond word, say 1us. I think it
> would be possible to make one, using 1ms.asm as a template.

A full cycle through the (AVR) inner interpreter takes around 45 
CPU cycles. At 1MHz that translates to 45us *at least*.
Probably the NOOP word is the closest approximation to the
1us, the actual time spent there depends on the cpu frequency.
at 16MHz it comes down to 3us (45/16)


> I have, however, made specific assembler words for specific project
> delays (eg. 250us), for when the existing 1ms was too long.

You may use the macro DELAY that optimizes the cpu cycles to
spent for given fixed delay. It is used in the 1-wire code, but it
cannot be exposed to Forth level due to the very specific operations
it has to do *at compile time*.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Need some help to construct an .asm file

2018-12-25 Thread Matthias Trute
Am Montag, den 24.12.2018, 17:51 + schrieb Jan Kromhout:
> Hello,
> 
> I wont to write my own routine in assembler as a learning goal.
> Have looked into a lot of asm routines, but can’t figure out how to
> add two doubles into R16 to R23
> and after the calculation put R16 to R19 back to the stack.
> 
> Can I use R16 to R19 freely for my own use, or should I take another
> set.
> 
> The calculation between is no problem.
> 
> Please can someone help me out with this,
> and any help is appriciated!

The registers that are free to use in own assembly words
are documented here:
http://amforth.sourceforge.net/TG/AVR8.html#register-mapping

The mapping between the temp-Names and the actual registers
can be found at avr8/macros.asm.

If you want to go deep into the assembler programming, esp.
within amforth, I'd strongly recommend, that you study the
code very carefully. It contains optimizations and macros
that are not trivially to understand. Adding two double 
numbers (that is 2x4 avr registers) is more on the
trivial side however. look at words/d-plus.asm.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] get-recognizer & set-recognizer

2018-12-21 Thread Matthias Trute
Am Freitag, den 21.12.2018, 10:42 + schrieb Jan Kromhout:
> Hello,
> 
> Found the missing words!!
> The package is now loading complete.
> But it is not working.
> When  input a float or a double the system is crashing.

That's bad. Can you fix it?

> 
> Has someone some experience with this package?

I've never used it myself in real projects.

> 
> I have read there is also a FP package in assembler, where could I
> find that?

I vaguely remember that one user (Lubos Pekny?) long ago rewrote a few
words from the floating package in assembler to speed up things.
Maybe the mailing list archive will help here (link in sig).

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] d>s in amforth (double number > single number)

2018-12-11 Thread Matthias Trute
Am Dienstag, den 11.12.2018, 13:02 +0100 schrieb f.zelders--- via
Amforth-devel:
> In gforth the word d>s (It couverts a signed double drecision number
> to a signed single precision number) is part of the default word set.
> This word is not available in the default amforth word set.

d>s is simple: DROP since the higher cell shall be 0 for this, you
may want to make sure and throw an exception otherwise, a task
that I happily leave to the reader ;)

> 
> Can't find a amforth word definition of s>d. 

It's in the file common/words/s_to_d.asm. The definition
itself is short, but somewhat surprising

: s>d dup 0< ;

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Error in Search Option on the Amforth site

2018-12-10 Thread Matthias Trute
Hi,


> When I search for dup the first result is 7-Segment Digits <
> 

...

> The link does not exist because of the '.rst' just in from of '.html'
> When I remover '.rst' manually the link is correct.

I just re-generated the whole website and the error seems to have gone.
at least, searching for dup presents now working links 

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] buffer:

2018-12-08 Thread Matthias Trute
Am Donnerstag, den 06.12.2018, 20:26 + schrieb Jan Kromhout:
> Last question for this evening.
> When I make a variable : variable buffer 1024 allot => is this in
> flash?

your code does the following

first it defines a word called variable (bad choice, since
variable is already in use, nevertheless possible). Unless you 
have a word buffer already defined, the definition will fail
with exception -13.

If there is a word buffer defined, the definition will compile and
when calling the new variable word it will call you buffer word and
allocates 1024 bytes of RAM. Since you do not keep the address of 
this area (HERE is your friend), the memory is essentially blocked 
but cannot be accessed.

what you probably intended to do is

1024 buffer: foo

It allocates 1024 bytes of RAM and creates a word foo which when 
called leaves the start address of the RAM region. Using buffer: 
inside a colon definitions is possible, but advanced dark art ;)

HTH
Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Error in Search Option on the Amforth site

2018-12-06 Thread Matthias Trute
Am Donnerstag, den 06.12.2018, 15:34 +0100 schrieb f.zelders--- via
Amforth-devel:
> I noticed that the Search Option on http://amforth.sourceforge.net/ <
> http://amforth.sourceforge.net/> has a bug
> 
> When I search for dup the first result is 7-Segment Digits <
> http://amforth.sourceforge.net/Projects/ClockWorks/22_display_7segment_digits.rst.html?highlight=dup
> >
> The link to this result is 
> http://amforth.sourceforge.net/TG/recipes/Dumps.rst.html?highlight=dup
>  <
> http://amforth.sourceforge.net/TG/recipes/Dumps.rst.html?highlight=dup
> >
> 
> The link does not exist because of the '.rst' just in from of '.html'
> When I remover '.rst' manually the link is correct.

That's unexpected and bad.

> 
> To whom can I address this bug report?

No idea. I use the standard ubuntu packages for the sphinx-doc 
toolchain.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Forward declaration for recursive word

2018-12-06 Thread Matthias Trute
Am Mittwoch, den 05.12.2018, 22:20 + schrieb Jan Kromhout:
> Thanks Matthis,
> 
> It is working now.
> 
> Do you know if the construction “ TO and VALUE “ is available for
> amForth?

Yes, they are.

http://amforth.sourceforge.net/TG/recipes/Values.html

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Forward declaration for recursive word

2018-12-05 Thread Matthias Trute
Am Mittwoch, den 05.12.2018, 13:50 +0100 schrieb Jan Kromhout via
Amforth-devel:
> Hello
> 
> 
> I wont to use the forward declaration “forward:” to solve my
> recursive word roll.
> 
> Is this use of forward: correct?

the forward declaration is for cases in which
one word calls another one before the other
one is defined. Something like

: foo bar ;
: bar foo ;



> 
> forward: roll
> 
> : roll
>   dup 0<  \ 0<=
>   if
> drop
>   else
> swap >r 1- roll r> swap
> then
> ;

Replace the roll inside your definition with 
recurse and it should work (if the
code is correct, I did not check it)

> 
> When I look into the definition of forward: I find the word “iplace”.

Oops. I'll update the docs.

> What is this iplace?


\ copy a counted flash string to ram
: iplace ( f-addr r-addr -- )
  >r icount $ff and ( -- f-addr' len )
  dup r@ c! r>  ( -- f-addr' len r-addr)
  1+ rot rot
  2/ 1+ bounds ?do
i @i over !
cell+
  loop
  drop
;

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] PROGMEM

2018-12-04 Thread Matthias Trute
Am Montag, den 03.12.2018, 18:22 + schrieb Jan Kromhout:
> Hello,
> 
> I have this code in my program (Arduino IDE).
> 
> // Standard ASCII 5x7 font
> 
> static const unsigned char font[] PROGMEM = {
> 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
> 0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
> 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 
> 
> 
> How do I translate that to amForth?

I did not test it, but it shall work not too
far from the following definition(s)

  create font[] $00 , $00 , $00 , 

access to the data may look like

   : @font[] ( n -- m ) font[] + @i ;

(flash is 16 bytes per address, hence the ,
but no cells in the access word)

I hope yout get the idea
Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] buffer: with memory error????

2018-11-13 Thread Matthias Trute
Am Dienstag, den 13.11.2018, 15:53 + schrieb Jan Kromhout:
> Hello,
> 
> I are struggle with the buffer:
> As you can see I create two array’s.
> I expect that when I initialize this I can read the value.
> It's not true. As you can see, values are overwritten.
> Am I doing something wrong?

I'm pretty sure that all the cells are not what
you want. At least the definition of the buffer
does not match their usage:


> \ Segment byte maps for numbers 0 to 9
>  10 buffer:  Segment_Map_Digit

This is 10 bytes, not 10 cells.

> : Segment_Map_Digit@ cells Segment_Map_Digit + c@ ;

Here you turn a number into a cell-index and access
a single byte. The upper half of the cell is not used
: initSegment_Map_Digit
>   \ Segment byte maps for numbers 0 to 9
>   $c0 0 Segment_Map_Digit!
>   $f9 1 Segment_Map_Digit!
>   $a4 2 Segment_Map_Digit!
>   $b0 3 Segment_Map_Digit!
>   $99 4 Segment_Map_Digit!

The last position inside your buffer.

>   $92 5 Segment_Map_Digit!
>   $82 6 Segment_Map_Digit!
>   $f8 7 Segment_Map_Digit!
>   $80 8 Segment_Map_Digit!
>   $90 9 Segment_Map_Digit!

A classic buffer overflow. You access
memory outside the buffer (9 cells is
18, which is beyond the 10 bytes allocated)

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Fuse settings for Leonardo

2018-11-09 Thread Matthias Trute
Am Freitag, den 09.11.2018, 15:49 + schrieb Jan Kromhout:
> Hi,
> 
> I wont testing amForth on the Leonardo.
> What are are the fuse settings for the Leonardo?

The Makefile in appl/arduino contains some lines starting
with leonardo, that's probably a start. 

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Question about Timer1 - is there a bug?

2018-11-03 Thread Matthias Trute


> I think some where in amForth TCNT1 is overwritten!

I can assure you, that there is no code in plain amforth
that overwrites your settings. It's either your code or
the hardware itself.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Question about Timer-1

2018-11-02 Thread Matthias Trute


> Is it correct that I can use this timer with his interrupts freely
> without any harm/restrictions for Amforth?

Yes, that's correct.

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] 16/32 Bit Fetch & Store.

2018-10-22 Thread Matthias Trute


> 
> Is my simplistic picture correct? 

Yes

> Or can the assembler words @ ! +!
> indeed be interrupted from within AmForth?  

No

Matthias



___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] 16/32 Bit Fetch & Store.

2018-10-19 Thread Matthias Trute
Am Freitag, den 19.10.2018, 14:46 +0200 schrieb Tristan:
> Hello Martin,
> 
> Very intriguing, just when I am away from my machine so I can’t test
> things out!
> 
> If I remember correctly, the default Amforth avr build uses (rx,tx)
> interrupts to handle the serial prompt. If at the serial prompt I
> type in the word -int and “all” -int did was to issue the assembler
> cli instruction I should lose my serial prompt. I can’t check now but
> if the serial prompt does not disappear then there is other machinery
> at work. 

It depends. Serial send (TX) is since long not interrupt driven. It
works even with disabled interrupts. Receiving is usually interrupt
driven, but can be configured to a polling code. It has 2 advantages:
smaller code and works almost always. The disadvantage is, that 
characters may be lost if they arrive too fast. 

The non-avr platforms are all non-interrupt based.

Matthias

PS: nice discussions this week :=)




___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Bug in atmega2560 Code.

2018-09-22 Thread Matthias Trute
Hi Martin,

your mail hit my spam folder... Sorry


> Looks like there is a bug in file:
> /amforth-6.7/avr8/words/store-i_big.asm
> That is:
> > out_ rampz, zl
> 
> should be:
> > out_ eind, zl
> 
> EICALL and EIJMP both use this register for the extra bits.
> 

I cannot test it right now, but your description sounds right.
Changed with rev2335

Thanks
Matthias


___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New release 6.7

2018-07-24 Thread Matthias Trute
Hi,

I've just tagged and published the release 6.7. It contains some
bugfixes for the existing platforms (thanks to Richard and Martin).

Due to a generous donation from the German Forth e.V. a RISC-V board
found it's way to my desk and I started porting amforth to it. As of
this release, only the interpreter is working and cooperates with the
amforth-shell utility. No compilation at this time. The files section
of sourceforge contains the toolchain I use (linux 64bit binaries) for
those who are brave enough to compile themselves. It's a nice platform.

Have fun
Matthias

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Bug in i2c-eeprom.frt

2018-07-23 Thread Matthias Trute
Hi,

> Thee should be a NACK as indicated below, I believe.

I cannot currently test it, but your fix looks plausible. Applied
as of rev. 2300

Thank you

Matthias

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] TIMER1 input capture with noop vs 1ms

2018-06-08 Thread Matthias Trute
Am Donnerstag, den 07.06.2018, 21:05 +0100 schrieb Tristan Williams:
> Hello,
> 
> I am clearly not understanding how something works, and would be
> grateful for any help.
> 
> I am decoding infrared remote control codes using the input capture
> mode of TIMER1 on an ATmega328P (UNO). This works successfully.
> 
> Then I decided to buffer the codes received, so that should the MCU
> be
> busy, the codes be collected by the isr will still be available for
> when the MCU is ready.
> 
> To test this, I have been using these three "busy" words
> 
> : busy1 10 0 ?do $ 0 ?do noop loop loop ;
> 
> : busy2 5000 0 ?do 1ms loop ;
> 
> : busy3 5000 0 ?do pause 1ms loop ;

I can only guess, but it seems that the 1ms delay is way too
long. Interrupts are handled inside the inner interpreter and
1ms does not get aborted when an interrupt occurs. That may
lead to lost bytes in your input buffer.

Matthias

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Accept has a bug?

2017-11-14 Thread Matthias Trute
Am Dienstag, den 14.11.2017, 10:01 +0800 schrieb Richard Burden:
> I couldn't find the reason for the error but what I found follows:
> 
> > 
> > 15 buffer: test
>  ok
> > 
> > test 10 accept
> 123456789012
>  ok
> > 
> > test 15 type
> 1234567892 ok
> 
> Should have been 1234567890
> The 2, being the last character typed, has replaced the 0 at position
> 10,
> or the last character to be accepted

Bug confirmed and fixed with rev. 2270 in the code repository.
Thank you!

now only the given number of characters can be entered, any
additional keys are silently ignored (I read the standard
text this way). An off-by-one error for the maximum 
number of characters fixed too.

The new accept.asm shall work on all recent version too.

Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] ANN: Release 6.6

2017-10-04 Thread Matthias Trute
Hi,

amforth 6.6 is tagged, packaged, uploaded and released. The changes are
more of the nice-to have side of the world, it's recommended to update
nevertheless. Details are as always available at the website
amforth.sourceforge.net

I'd like to invite you to the upcoming Forth source repository 
at theforth.net, as an example the LCD driver for the HD44780
is documented en detail.

apropos documentation: There is a new huge contribution
in the "commented project" section. It's all about clocks 
and multitasking. Many thanks to Erich for this amazing 
work.

Last but not least: recognizers are now a committee supported
proposal, if you use it, they may become part of Forth :=) 
Many examples are available at theforth.net.

Have fun
Matthias

PS: Somehow I (well, my email address) got disconnected 
from this list for an unknown time period. I am still the
admin of this list however. What a strange world...
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AVR8 build questions

2017-05-08 Thread Matthias Trute
Am Montag, den 08.05.2017, 16:54 +0100 schrieb Tristan Williams:
> Hello Matthias,
> 
> Two build questions.
> 
> 1) 
> 
> I have downloaded 2252 and run into this error when building for my
> uno
> 
> amforth-6.5A/avr8\drivers/generic-isr.asm(28): error: jz: Unknown
> instruction or macro

Mea culpa. it should read breq instead of jz. I'll checkin a correction
as soon as possible.

> Separately, using 2147 (and also 6.2) I have been trying to get an
> ATmega1284p up and running with AmForth. After cleanly building and
> flashing the two hex files I connect via RX0/TX0 but can only receive
> characters from the 1284p. Pressing reset (repeatedly) shows me the
> version number and chip name but the interpreter does not respond to
> my key presses. I am using an FTDI usb/serial connector which
> connects
> successfully to my uno and leonardo. For good measure I have checked
> the RX0/TXO signals with an oscilloscope and they are both there. Any
> thoughts as to where I might look next? 

I use a 1284 occasionally too. Works fine and without problems. A first
check would be to use play with the command receive routine. Just add 
the line

.set WANT_ISR_RX = 1

somewhere before you include the usart driver file. Or change it to
0 to use the polling version without interrupts (useful in some
scenarios when you disable the interrupts but want a working prompt)

> 
> My interest in the ATmega1284p is that I have "promised" myself a
> nice
> new 10 cm square PCB dedicated to running AmForth and thought it
> would
> be the ideal chip for the job :) 

It's a  nice chip indeed. Lots of RAM.

Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AVR8 watchdog (reset and interrupt) atmega328p

2017-05-07 Thread Matthias Trute
Hi Tristan,

I've put your code online, revision 2252 contains the new
file. There is only one change: I renamed the wd! into !wdc.
It tells "store to watchdog control" and follows the more
or less informal convention that ! and @ can be preceeded
with size information and followed by location information.
Just like c!e or @i. Hope that's ok for you.

http://amforth.sourceforge.net/TG/recipes/Watchdog.html

Thank you
Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New Release 6.5

2017-04-30 Thread Matthias Trute
Hi,

a new release of amforth is now available. It fixes a
really nasty bug in the interrupt handling on the
AVR plattform. Erich did an outstandig job discovering
and fixing the bug, that sometimes made interrupts
simply disappear. This happened very seldom and
under very limited cirumstances (active multitasker
heavy timer interrupts). I took the opportunity to
apply his idea to the MSP430 plattform. For now
the G2553 (found in the popular launchpads) has a
special hex file that has support for interrupts just
as the AVR's have for a long time: High level Forth
words. It's in it's very early stages so be careful
when using it.

Have fun
Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AVR8 watchdog (reset and interrupt) atmega328p

2017-04-22 Thread Matthias Trute
Am Donnerstag, den 20.04.2017, 09:04 +0100 schrieb Tristan Williams:
> AVR8 watchdog (reset and interrupt) atmega328p
> 
> I wanted to use the 128 kHz watchdog oscillator as an additional
> timer.

The watchdog creates a full reset cycle, that means that the full
startup sequence is performed. Your turnkey action should take
care of this (register r10 holds the reset cause).

> 
> In the source tree there is an assembler word -wdt (no-wdt.asm),
> which
> writes $0 to WDTCSR (using the prescribed sequence), but I couldn't
> find something like a "+wdt". This may well be because I did not look
> hard enough, so my apologies if it was there all along.

IIRC only the "disable watchdog" sequence is timing critical (the
4 cpu cycles you mention). All other tasks can be performed at
lower speed, so a forth implementation should be fine.

> 
> Using -wdt as a template I have written four companion assembler
> words
> and a slightly modified version of -wdt (to leave the existing
> prescaler and WDIE bit unmodified).
> 
> +wdt ( -- )set WDE (System Reset Mode)   
> -wdt ( -- )unset WDE (leaves prescaler)  
> +wdi ( -- )set WDIE (Interrupt mode) 
> -wdi ( -- )unset WDIE (leaves prescaler) 
> wd.delay! ( n -- ) set prescaler , unset WDE and unset WDIE 
> 
> where n is the 4 bits representing the prescaler. 
> 
> With the 4 cycle write requirement dealt with by (optional at build
> time) built in words the 128kHz timer is accessible and adds a
> lot. Could similar words be added to AmForth or is this too
> device/application specific?

It would be a great contribution for the cookbook. Esp if it works with
Forth code.

Good work
Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth & WINE & Linux (WANRING! NEWBIE-Alert! :)

2017-04-01 Thread Matthias Trute
Hi Meino,


> I am running a 64bit-GENTOO Linux and I am quite familiar with
> Linux.
> I want to run AmForth on a Arduino Pro Mini Atmega328p/3.3V.
> With my USB-to-serial adapter I flash my ProMinis with the 
> Arduino-IDE successfully.

You definitely need a "real" programmer to flash amforth. A second
arduino with the ISP software shall work, I use the Atmel AVR ISP MK2 
and an AVR Dragon. The default arduino flashing system does not 
cooperate with amforth. See 
http://amforth.sourceforge.net/faq.html#what-about-boot-loaders


> 
> Do I need to install the 32bit-version or the 64bit-version of wine?

It doesn't matter. I use the 64bit version (Ubuntu LTS)

> Do I need to install wine at all -- can I use a different software
> to assemble things (I would prefer this way even it would imply more
> work) ?

For the AVR world, there is no other way. Very early version of
amforth (10 years ago) could be assembled with an assembler called
avra, but that piece of code died long ago and is no longer able to
compile amforth. The MSP430 variant uses the naken_asm, that even
works on a raspberry pi. Unfortunately the AVR support in naken_asm
is not sufficient to compile amforth.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] Release 6.4 is out

2017-03-31 Thread Matthias Trute
Announcing release $40 of amforth

This is the 64th release of amforth in more than
10 years development. It does some fine-tuning
of the I2C library on the AVR platform. There is
now code to use amforth as a I2C slave. Furthermore 
it adds the 'c' number input format and support for 
program specific stacks. "under the hood" are many
small improvements and code simplifications. A lot
of previously hidden words or words that were intended 
for testing purposes only are now available for user 
programs.

Atmforth is a 16bit Forth system designed to run on 
AVR Atmega and TI MSP430 microcontrollers. It is 
written in highly optimized assembly and Forth itself, 
most of the core system shares the same source code. The 
core system fits into 8KB of code space. It allows access 
to all controller specific features including support 
for Harvard architecture specific things like multiple 
address spaces of memory (EEPROM, flash, RAM). The Forth 
interpreter compiles directly into the flash (or FRAM) 
memory. Amforth supports most features of the Forth
2012 standard and has a few enhancements over it like
recognizers.

Amforth is released under the Terms of the Gnu Public 
License v3 (GPL) and is available with full source code 
and documentation at http://amforth.sourceforge.net/

Enjoy
Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] i2c and port expander

2017-02-03 Thread Matthias Trute
Am Dienstag, den 31.01.2017, 08:51 + schrieb Tristan Williams:
> Hello Matthias,
> 
> Thank you. >rx-buf is wonderful. I have high hopes of making the
> keypad appear as a subset of the keyboard so they can use exactly the
> same code.
> 
> The PCF8574A + keypad + interrupt also seems to work well. I
> explicitly protected each of the other i2c devices on the bus from
> being interrupted (by the keypress interrupt) at inopportune moments
> using critical[  ]critical. Without this I would (eventually)
> crash the system with a -4000 error. I thought about protecting all
> the i2c devices en masse at a lower level e.g.
> 
> : i2c.c! 
>    critical[ 
>    i2c.begin
>    
>    i2c.end
>    ]critical
> ;
> 
> or is this just a bad idea?

Not at all. I'd suggest using semaphores that
make sure a reservation for the I2C bus is
in place (or not). critical[] is probably too
much and too restrictive.

Semaphores would be useful for other things
like the pictured numeric output buffer (aka
HOLD and the group of # words) too.

Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] i2c and port expander

2017-01-28 Thread Matthias Trute
Am Samstag, den 28.01.2017, 10:46 + schrieb Tristan Williams:
> I have successfully written a couple of forth words keypad? and
> keypad
> that use i2c (PCF8574A) and an interrupt to tell me if/what key has
> been pressed on my keypad. This is currently completely independent
> of
> the keyboard buffer. What I would like to do is to take the value
> that
> would placed on the data stack by keypad and instead insert it into
> the
> keyboard buffer.

The trunk revision has a word called >rx-buf that appends a character
from the data stack to the command input buffer. It is used in the
usart interrupt word as follows

: isr-rx usart-data-port c@ dup 3 = if cold then >rxbuf ;

(the code 3 = is the check for ctrl-C that resets the system).
IIRC Erich uses this word to communicate via an RS485 network.

> I hope then to take advantage of a recogniser to view (say) 350*700
> as
> an xy coordinate and finally free my cnc (assisted) xy table from its
> umbilical connection to my computer. I am sure it can be done without
> this, but to do so seems like going in the wrong direction.
> 
> The internals of the keyboard buffer and recognisers are new areas
> for
> me so I would grateful for any hints as to where to start.

The >rx-buf is new, as described above. The recognizer stuff is
currently in a discussion with the Forth language gurus, and got
4 revisions so far (the 4th beeing worked on currently). A good
starting point (because I made it ;) ) is 
http://amforth.sourceforge.net/Recognizers.html

Despite it's name the RFD text itself is (should be) readable for
starters too. It has a lot of discussion topics and examples after 
the formal standard section, just scroll down a few pages. A lot 
of (working) examples are at http://theforth.net/tag/recognizer

Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] i2c and port expander

2017-01-25 Thread Matthias Trute
Am Mittwoch, den 25.01.2017, 13:02 + schrieb Tristan Williams:
> I replaced my i2c files with those from the trunk r2209 and all of
> i2c.c! i2c.c@ i2c.n! i2c.n@ i2c.m!n@ give me what I was expecting. 

I've essentially re-implemented the i2c words after release 6.3. 
Maybe I should finish 6.4 ;)

Thanks for testing and giving feedback, it's highly appreciated
Matthias
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] New release 6.3

2016-09-05 Thread Matthias Trute
Hi Tristan,

> I was wondering if anyone has used AmForth as an I2C slave on ATmega
> uc(s)? I've written a couple of I2C slaves in C++ using ATtiny uc(s)
> and used AmForth as an I2C master to communicate with them. I really
> appreciate the forth interpreter here. Whilst doing this I thought
> that if I changed my slave processor to an ATmega I might be able to
> remove the C++ and write the slave in AmForth. If this has been done
> before I would be grateful for any hints.

I've started with some code for the slave side. Until now it
"only" answers to the ping making the i2c.detect work on the
master side. The long term goal is something that Erich did 
for the RS485 (see commented projects).

With rev. 2172 the code is in the avr8/lib/hardware directory, but
don't expect too much. It' quite messy and not too well documented.

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New release 6.3

2016-08-28 Thread Matthias Trute
Hi,

The release 6.3 has changes for both controller types, some are
common some are specific. The MSP430 now supports the 
hardware multiplier, if available and adds some more words from
the Forth 2012 standard. The AVR parts use a different terminal
IO, making it easier to adapt different serial communication 
setups replacing the pre-defined ones. Both controllers now 
support application-changeable prompts. A new library example
combines defers and lists of exection tokens into one
concept called chains. This is inspired from Win32Forth,
but uses separate wordlists or stacks instead of linked
lists. Details are available in the German FIG periodical 
"Vierte Dimension" at www.forth-ev.de (in German only).

Development for the next release has been started by now,
some i2c related stuff by now.

Have fun
Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Tester wanted

2016-07-31 Thread Matthias Trute
Hi Ian,

Am Samstag, den 30.07.2016, 06:07 -0400 schrieb Ian Jefferson:
> Hi Matthias,
> 
> What kind of hardware would you need?

Someone with higher skills to organize my hardware
depot ;) In fact: I've ordered a few quartzes by
now, spending a few more cents in an already
planned order. It only takes time to arrive...

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] New release 6.2

2016-07-05 Thread Matthias Trute
Am Montag, den 04.07.2016, 21:37 +0200 schrieb MIchael Kalus:
> Is there a link to a list of those strange behaving?

You can easily reproduce them: just copy a few lines of
(assembly) code around. Guess why the file init.asm
still exists, the two lines of code belong to the mcu-info
structure. But if I move the two lines, the simple test

: test ." huhu " ; test

fails compiling the word test, most of times freezing
the system, sometimes rebooting it.

>  May be of use beyond amforth.

Nobody but me uses assembly for this device ;)

Matthias
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New release 6.2

2016-07-04 Thread Matthias Trute
Hi,

It's been a long time since the last release but some strange
effects needed to be handled with the FRAM equipped MSP430 devices.
They behave much like a diva and are worse than the fuses of the
atmega's ;)

Most of the changes are for the MSP430 devices, I started to learn
the assembler programming for them. Some changes are for both
platforms, details as usual on the homepage http://amforth.sourceforge.
net/ The update from version 6.1 is recommended.

Have fun
Matthias
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth 6.1 Date and Time Code questions.

2016-06-21 Thread Matthias Trute
Hello Franklin,

> Question: 
> [1] Is anyone using the date-and-time.frt code with more updated
> code? At least code that tracks leapyear or whether a month is 31
> days or 30 days. Also, how would you handle time date interpretation
> on register rollover for the date-and-time.frt? 

The community svn repository has some date related code in the
ewlib directory.

> [2] Lastly, how do you assign a task a time execution to run every 1
> second? I included a 1000 ms delay in my code for the task but I
> would like to see if this can be added at the task level
> initialization or execution on @tick for Timer0. 

You can assign your task code to the ISR itself, no doubt. But keep
in mind, that the ISR code *has to* finish before the next tick
happens.

Matthias
--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Thankyou and turnkey

2016-06-19 Thread Matthias Trute
Hi Tristan,

It took some time (and I had to fix a problem with the
current trunk code tree), sorry.

The good news: your code works for me. The bad news: I
cannot reproduce
what you wrote. 

Everything works as expected, no hangs no problems at all.
I was slightly confused by the 1 second delay, but even
that works as specified.


Do you have some more information that may be helpful? Version
numbers etc. When exactly hangs your code? When uploading
the file or at restarts? The hang during upload (probably
while defining "is" after the "if" statement, was a bug indeed,
but that should not occur in released versions, only in the
trunk before rev 2115.

Matthias

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Building amforth on Windows7 with cygwin and Atmel Studio 7

2016-05-29 Thread Matthias Trute
Hello Dieter,

On Mo, 2016-05-23 at 21:39 +, die...@schoen.or.at wrote:
> Hi list,
> I recently found amforth and wanted to give it a try. I prefer the
> approach of an embedded interpreter
> to a traditional edit-compile-download-test cycle.
> First, I had the usual troubles with the fuses (I tried to program
> the device from within Atmel Studio, which always gave
> me verification errors.)
> Then I copied the commands (assembler and avrdude) from the
> Linux Makefile in appl/arduino
> to a DOS box and that worked fine.
> The next step was to modify the Makefile so that it works on
> Windows/cygwin.
> Here it is, I hope it is useful.

It definitely is. Thank you for it.

> My environment is: Windows7 and Atmel Studio 7.

Good to know that they work, I still use some studio 6
files.

Matthias
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] NMEA parsing

2016-01-06 Thread Matthias Trute
Am Mittwoch, den 06.01.2016, 10:30 + schrieb Sven:
> Hi,
> I have a GPS module with serial NMA0183 output ( 4800 8n1 ) and a
> Arduino board with amforth installed.
> My idea is to read the NMEA data from the Arduino serial interface
> and display it on a LCD, but the serial port is normally used by the
> terminal session of amforth. Is it possible to detect a NMEA sentence
> like:
> $GPGGA,191410,4735.5634,N,00739.3538,E,1,04,4.4,351.5,M,48.0,M,,*45
> in the input stream ?
> Any ideas ?

You could give recognizers a try. 

http://amforth.sourceforge.net/TG/recipes/Recognizer.html
http://amforth.sourceforge.net/Recognizers.html
http://sourceforge.net/p/amforth/code/HEAD/tree/trunk/examples/time-rec
.frt

They are made for such tasks.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Suggestions for docs

2015-12-20 Thread Matthias Trute
Am Samstag, den 19.12.2015, 12:59 +0800 schrieb Richard Burden:
> Hi all,
> 
> really happy with amforth but there are frustrations. Having just
> downloaded version 6.1 and tried to rebuild my version 5 here are
> some
> suggestions based on my experience:
> 
> 1. Docs are wrong. The default baud rate is not 9600 as per FAQ 2.6
> on
> page 14 of the release 6 documentation. It is 38400 as set in the
> file
> preamble.inc

Fixed. Thank you.

> 
> 2. It is confusing, having set the baud rate in preamble.inc, to
> suggest in the included template.asm file that the baud rate is set
> there. I suggest the phrase
> "; serial line settings." be changed to
> "; serial line settings are set in preamble.inc"
> and delete the commented out lines where it could be set in
> template.asm

The settings from the preamble.inc file are there to have a common
ground (mostly for technical reason to ease compilation). In fact
these settings are completely application driven, so these parameters
belong to the application, IMHO. Furthermore the file preamble.inc is 
part of the core system, that no application should ever change. Only 
the core admins (that is I) should do changes here. Application 
developers should closely follow what happens to the examples and 
especially the  template application and adapt theirs accordingly. 
Which leads to the  next section

> 
> 3. I understand why developers have a common words folder in the
> distribution. For those happily using AVR studio to compile their
> version of amForth you will need to do something like the following
> to
> compile amForth:

The magic lies in the include directories that the assembler uses. I
remember a settings dialog in the AVR studio that configures the
include directories for the assembler. This order is somewhat 
sensitive. *If* you want to keep in touch with the development of 
amforth, I strongly discourage copying the files into one directory. 
There are many pitfalls, which I am not able to solve.

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] bitnames.frt issue

2015-12-20 Thread Matthias Trute


> I can confirm the files do-value.asm and do-defer.asm were included
> in
> the build after reviewing the list file. Can anyone help me on this
> please?

In addition to what Peter wrote: The error messages are short indeed.
The numbers come from the Forth 2012 standard (chapter Exceptions): 
-13 means "not found" the second number points to the *end* of the 
word (counted from the whole input line) that was not found. -4 means 
"stack underflow". In compilation mode usually a hint that the loops or
conditionals are not balanced, not in your case, however since the -13 
error emptied the data stack.

> 
> Bitnames.frt was fine on amForthv5.5 so I assume the new word  is the source of the problem.

I added the require statement for the amforth-shell, thanks you (rev
2050)

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] bitnames.frt issue

2015-12-20 Thread Matthias Trute
Am Sonntag, den 20.12.2015, 19:49 +0800 schrieb Richard Burden:
> Thanks Matthias. I've learned a lot today from Peter and your
> responses.  I
> now have the serial data flowing correctly into the satellite tuner
> board
> I'm trying to turn into a signal generator.

Craig Lindley did something similar (I believe)
http://www.craigandheather.net/docs/ArduinoFMRadioArticle.pdf

> 
> I tried to get the Portb and ddr constants to be included in the base
> amforth. Without much success so I simply pasted the definitions into
> the
> terminal window.
> 
> I appreciate having every register included in the base amforth
> consumes a
> lot of memory.  I suggest the ports and ddr registers be included in
> the
> base though since a microcontroller can't do much before these ports
> need
> to be used.

There are (at least) two options available: 
1) use the amforth-shell utility, it autodetects the controller type
  and "knows" all register names with their respective addresses. To
  use it, you need the original file system structure in place.

2) add the line
 .include "device.inc" into your dictionary application (either 
 dict_appl.inc or dict_appl_core.inc, depends how much free flash
 space you have, dict_appl.inc is a good start) file and define the
 register sets you need. May look like

.set WANT_PORTA=1
.set WANT_PORTC=1
.include "device.inc"

and recompile. If everything works as it should, you have a set of new
words in the dictionary

> words
 (value) execute exit PINB DDRB PORTB PINA DDRA PORTA ?negate
cfolddepth 2r@ postpone (marker)

...

If you look into the device.asm file in the controller directory, you
get a list of all available register sets, they all start with WANT_
and are disabled (set to 0) by default. This works for the AVR8
platform, if I understand the MSP430 well enough, I'd like to 
do something similar as well.

> Overall I'm very happy with version 6. Congratulations to the authors
> for
> putting so much effort in. Amazing that a $2 arduino clone can be
> repurposed into something I consider much more useful.

Thank you

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] tester-amforth.frt: first test fails?

2015-11-15 Thread Matthias Trute

> I found that revision 2030 fixes the behaviour above except for
> a very minor "case-sensitive" glitch. Patch below.
> Thanks for this fast resolution :-)

Not to thank me, others did the job.

> svn diff common/lib/forth2012/tester/tester-amforth.frt
> Index: common/lib/forth2012/tester/tester-amforth.frt
> ===
> --- common/lib/forth2012/tester/tester-amforth.frt(revision
> 2030)
> +++ common/lib/forth2012/tester/tester-amforth.frt(working
> copy)
> @@ -41,7 +41,7 @@
>  : -> \ ( ... -- ) RECORD DEPTH AND CONTENT OF STACK.
> depth dup ACTUAL-DEPTH !  \ RECORD DEPTH
> START-DEPTH @ > if\ IF THERE IS SOMETHING ON
> STACK
> -   DEPTH START-DEPTH @ - 0 do ACTUAL-RESULTS i cells + ! loop \
> SAVE THEM
> +   depth START-DEPTH @ - 0 do ACTUAL-RESULTS i cells + ! loop \
> SAVE THEM
> then
>  ;
> 

You really need a smart source code uploader. Mine does this kind of
case conversion for the standard words (and only for them) that 
shall be case insensitive as defined by the gurus... ;) THanks anyway

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] We build a robot using Amforth

2015-10-20 Thread Matthias Trute
Atommann,

Awesome. I always thought that opensource means I can
study the source code. The Chinese commands do really work
via Bluetooth? Way cool.

More of that, I like it :=) :=)

Matthias
PS: hmm. There are languages that use a right-to-left direction
for ... symbols (IIRC Arab). A nice challenge, now ;)


Am Dienstag, den 20.10.2015, 11:15 +0800 schrieb Atommann:
> Hi,
> 
> About two weeks ago I met a pretty lady in our office, she told me
> there is a Hackathon hold by their company and Shenzhen Graduate
> School of HIT [link 2].
> 
> At the first moment I have no idea to build what.
> 
> Me: "What's the topic?"
> The pretty lady: "Robots"
> Me: "Good topic! I'll send an email to our mailing list to ask if
> someone else want to join."
> 
> When I wrote that email I suddenly understood that I can build a robot
> using amforth with a bluetooth module, it can accept simple commands
> from computer side and draw graphics on a white board on the floor.
> 
> So the idea is clear. I decide to go. But I just started to learn
> forth and I can just write some simple code in amforth. Fortunately we
> just have a coder in our hackspace and he just graduated from applied
> math department and implemented forth dialect with x86 assembler. But
> he has no MCU knowledge.
> 
> But it's OK. I can finished the low level code (such as the code for
> servo motor which used to implement words of pen-up and pen-down) and
> he can finish the high level functions.
> 
> A funny story during the hackathon:
> In a deep night we sat on a terrace and  were drinking coffee and
> discussing which kind of graphics the robot should draw for the final
> demonstration.
> 
> xyh (the forth coder): "I want to draw there Chinese characters" (The
> Chinese name of the university)
> Atommann: "You are crazy! Why not just draw HIT, all straight lines, easier."
> 
> I was tired and went to sleep and didn't put xyh's idea (draw Chinese) in 
> mind.
> 
> The next morning when I woke up I went to see xyh's job. I saw there
> is a square on the white board paper on the floor. "Wow, surprise!" I
> said. Suddenly I found that he was coding in Chinese in Forth. All the
> words are defined in Chinese [link 6]. OMG. And I never expected this
> before :)
> 
> Before the final demonstration, we found that the robot can not draw
> the first Chinese character nicely. xyh change the code time by time.
> 
> Me: "xyh, I think it's good enough"
> xyh: "No, I can make it better, the value of this character is 10k RMB!"
> 
> And the good thing of Amforth is that we can upload the new words to
> the robot by Bluetooth! We don't need to plug cable, unplug cable and
> no need of edit, compile, download cycle which wastes time which is
> valuable for a hackathon.
> 
> The original idea of this project is used to teach kids programming,
> English, and how to control robots.
> 
> At the computer side, I want to build a mini computer based on
> Raspberry Pi, or the 9 dollar C.H.I.P. computer [link 5], battery
> powered. So kids can have their own computer and a robot they can play
> with.
> 
> The computer side, kids can also use Lisp language [link 4] to control
> the robot.
> 
> Anyway, we finished the robot and got the No. 1 prize (10K RMB) [link 3].
> 
> Amforth is awesome! Thanks.
> We'll continue.
> 
> links
> 
> [1] We used the following motor driver. Very handy!
> https://github.com/wmercer/amforth/blob/609c6594076422e6592f50811ef73f054b02a256/community/Arduino-Shields/ada-shield.frt
> 
> [2] 
> https://en.wikipedia.org/wiki/Shenzhen_Graduate_School_of_Harbin_Institute_of_Technology
> 
> [3] some photos
> http://www.leiphone.com/news/201510/Hk7mizNbynrIInam.html
> Team members: I am the one in orange, xyh is in black with long hair,
> bnw is in the 1st photo in this article.
> 
> [4] Scheme code for lambda-tortoises (the name of this robot)
> https://github.com/szdiy/lambda-tortoise
> 
> [5] CHIP - The World's First Nine Dollar Computer
> https://www.kickstarter.com/projects/1598272670/chip-the-worlds-first-9-computer/description
> 
> [6] The code which draws Chinese for the final demonstration
> https://github.com/xieyuheng/ada-shield/blob/master/show.org
> 

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New Release 6.1

2015-10-17 Thread Matthias Trute
Hi,

A new release of amforth is out: 6.1. It fixes
a nasty bug that affects DOES> (and some more words),
so upgrade is recommended. The MSP430 family got
two new members: the F5529 and the FR5969. Both
are sold by TI on launchpad eval boards and 
have significant more resources available than the
G2553 controller. The FR5969 uses FRAM instead of 
flash, something that I intent to explore further 
in the near future. For now there is no difference
to the flash types.

Any other changes and the download are as usual 
available via http://amforth.sf.net 

Enjoy 
Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth-6.0, msp430, amforth-shell.py, 5.9 works

2015-10-01 Thread Matthias Trute
Hi,

dead end. On my Linux box (freshly rebooted)
everything works as it should

mt@noname: $ stty -F /dev/ttyACM0 
speed 9600 baud; line = 0;
-brkint -imaxbel
mt@noname: amforth-shell.py -s 9600 -p /dev/ttyACM0 --debug-serial
--no-error-on-out
|I=appl_defs: 0 loaded
|I=Entering amforth interactive interpreter
|a( )\n
|s( )\n->\r\n|\n-> ?? -13 2 \r\n|
|r( )> \r\n ok
|a( )base @ decimal dp u. base !
|s( )b->\r\n> b|a->a|s->s|e->e| -> |@->@| -> |d->d|e->e|c->c|i->i|
m->m|a->a|l->l| -> |d->d|p->p| -> |u->u|.->.| -> |b->b|a->a|s->s|e->e|
-> |!->!|\n->\r\n|
|r( )542  ok
|a( )words
|s( )w->\r\n> w|o->o|r->r|d->d|s->s|\n->\r\n|
|r( )git-info build-info .s key? key emit? emit Udefer! Udefer@
Rdefer! Rdefer@ noop defer! defer@ to turnkey 

Sorry. Cannot help here.

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth-6.0, msp430, amforth-shell.py, 5.9 works

2015-09-26 Thread Matthias Trute
Hi cadar

> Do we trust naken_util when debugging amforth on msp430?
> Could this be a bug?

I never used it. 

Can you please use the --debug-serial command line option
of the amforth-shell.py? If everything works as expected
it should look similar to

amforth-shell.py  -p /dev/ttyACM0 --no-error-on-output --debug-serial
|I=appl_defs: 0 loaded
|I=Entering amforth interactive interpreter
|a( )\n
|s( )\n->\r\n|\n-> ok\r\n|
|r( )> \r\n ok
|a( )base @ decimal dp u. base !
|s( )b->\r\n> b|a->a|s->s|e->e| -> |@->@| -> |d->d|e->e|c->c|i->i|
m->m|a->a|l->l| -> |d->d|p->p| -> |u->u|.->.| -> |b->b|a->a|s->s|e->e|
-> |!->!|\n->\r\n|
|r( )542  ok
|a( )words
|s( )w->\r\n> w|o->o|r->r|d->d|s->s|\n->\r\n|
|r( )key? key emit? emit Udefer! Udefer@ Rdefer! Rdefer@ noop defer!
defer@ to turnkey (value) (defer) SAVE -1 2 1 0 search-wordlist compare
s, rec:num r:dnum r:num r:word rec:word r:fail do-recognizer map-stack
parse-name \\ ?stack f_cpu ver environment applturnkey warm pause
init-ram cold d.r d. .r ud.r ud. u.r show-wordlist name>string
traverse-wordlist words flaligned depth within leave +loop loop
endloop ?do do l> >l repeat while again until begin else then if ahead
compile throw handler catch immediate i-cell+ postpone ['] ; :noname :
reveal ] [ recurse does> (does>) wlscope (create) create header ( [char]
char ' abort" ?abort abort quit refill interpret number >number digit?
literal find-name name>flags nfa>cfa nfa>lfa parse /string source iallot
ihere c, , here pick bounds hex decimal . u. sign #> #s # <# hold ud*
ud/mod 2literal sliteral ." s" (s") itype icount 2swap 2dup 2drop min
max mod / /mod * fm/mod sm/rem m* dabs ?dnegate dnegate abs ?negate s>d
uinit toupper bl #tib tib source-tib refill-tib sp0 rp0 lp0 pad allot
latest newest idp lp hld get-current dp state base >in a>info type
accept umax umin spaces space cr +usart tx? rx tx up! up@ >body cells
cell+ aligned align s= cscan cskip cmove> cmove fill um/mod um* unloop j
i ?branch branch u> u< > < <> = 0< 0= rshift lshift 2/ 2* >< 1- 1+
negate invert xor or and - m+ +! + d->i c@i @i c!i !i flerase c! c@ ! @
rp! rp@ sp! sp@ 2r> 2>r r@ r> >r tuck nip rot over swap drop ?dup dup
user constant variable exit execute  ok
|I=getting MCU name..

etc

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth-6.0, msp430, amforth-shell.py, 5.9 works

2015-09-22 Thread Matthias Trute
Hi cadar,

> All I get is,
> "E=Input character not echoed."
> 
> Exact same setup worked for 5.8 and 5.9. (OSX 10.10)

Really strange. There were no changes to the shell or the
serial port setup. 

Could you please try the older versions of the shell too? 
Or try another terminal, even a simple one like screen may
be helpful.

I don't have access to a mac, so I cannot reproduce your 
setup. On linux (ubuntu 15.04, amd64) everything works well.

Sorry
Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth-6.0, msp430, amforth-shell.py, 5.9 works

2015-09-22 Thread Matthias Trute
Am Montag, den 21.09.2015, 23:54 +0300 schrieb Hannu Vuolasaho:
> Hi!
> 
> Sorry I can't help, but I have future proposition.
> 
> Could there be somewhere in UART drivers or similar place huge
> .if badrate = 9600
> .message "Serial port is 9600 8N1"
> elif ...
> 
> .endif
> 
> This seems to be quite common problem. Or outputting hexfiles
> like Amforth-60-9600.hex

It's up to you to define your application files. I enforce nothing.
And I accept recipes for the cookbook ;)

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New Release 6.0

2015-09-06 Thread Matthias Trute
Hi,

I just packaged the release 60th release of amforth. It
brings the MSP430 in touch with the AVR8 code base. You
can use values and defers now as well as wordlists and
recognizers. They all work exactly the same way on both
platforms, thanks to common code. amforth is probably one
of the rare assembler projects for covering different
processors and different assemblers.

Amforth for the MSP430 still fits into the 8KB segment.
And you habe as much as 300 bytes still available for
the words you need. See the launchpad430/dict_appl.inc
file for examples.

A few bgs were fixes as well. Update is recommended.

Enjoy
Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth on Arduino 38400bps

2015-08-13 Thread Matthias Trute
Am Donnerstag, den 13.08.2015, 15:36 -0500 schrieb Ben Pharr:
 I have a genuine Italian Arduino Duemilanove. I downloaded Amforth 5.9
 and flashed it with the included Makefile, as well as setting the
 fuses. It works, but only at 38400, not 9600, as the FAQ suggests.
 
 The 'ms' word was missing, but I created a reasonable facsimile using 1ms:
  : ms 0 do 1ms loop ;
 and this command:
  1 ms
 took 10 seconds to run, so I don't think it's a F_CPU issue.
 
 Any ideas why the serial isn't running at 9600?

Short answer: The code is right, the docs are wrong.
The duemilanove.asm has no settings for the baud rate, thus
the standard settings (as defined in avr8/preamble.inc) are
used. And they are set to 38400.

btw: there is a file called ms.frt in the forth2012/facility
directory. It does a bit more and is more robust against
0 ms 

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] Amforth 5.9 is out

2015-07-10 Thread Matthias Trute
Hi,

I've just released version 5.9 of amforth. It should fix
the last remaining regressions introduced with the new
microcontroller architecture. The most importatnt probably
is the LITERAL fix, that stopped quotations. 

The MSP430  now really got the DEFERs and VALUEs, that I 
promised for the last release, but somehow they didn't get 
into it.

The AVR8 platform now cleans all RAM upon reset, eliminating
a nice little cause of trouble during debugging.

The remaining changes are rather minor or cosmetic ones.
Update is recommended. Feedback too ;)

Have fun
Matthias
--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] quotations.frt

2015-06-28 Thread Matthias Trute
Vladimir,

my Russion needs probably some refresh. After your hint I
did some checks myself, and indeed the quotations did not
work. The problem was a wrong LITERAL, introduced with
release 5.6, that got fixed by re-using the previous
version of literal.asm. Done with svn rev1866.

Thanks for the hint and greetings to the Russian
forthers!

Matthias
 Hi,
 Russian-speaking community of amforth reports an error in 
 the file 'quotations.frt' resulting in malfunction code. 
 http://fforum.winglion.ru/viewtopic.php?f=39t=2618p=41236#p41236
 Vladimir.
 
 --
 Monitor 25 network devices or servers for free with OpManager!
 OpManager is web-based network management software that monitors 
 network devices and physical  virtual servers, alerts via email  sms 
 for fault. Monitor 25 devices for free with no restriction. Download now
 http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
 ___
 Amforth-devel mailing list for http://amforth.sf.net/
 Amforth-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amforth-devel

--
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical  virtual servers, alerts via email  sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] key? and key

2015-06-12 Thread Matthias Trute
Paolo,

  key? .  0 ok

means no unread key available (the 0)

  depth .  0 ok
  begin key? until  ok

begin and until make only sense inside
a colon definition. Used interactivly they
do the wrong thing. Namely

  depth .  1 ok
  .  4516 ok

place a flash address on the data stack. 

  
 
 I have some questions: why the loop exits immediatly w/o typing any char on 
 keyboard?

Try the following

  : key-test begin key? until ;
  key-test

key-test now blocks until a key is pressed. And
leave in the input buffer, you'll have to use
KEY to get the character. To make things more
complicated: the amforth interpreter does this
for you and you'll see the character that caused
the key-test to exit as the first character of the
next input line at the command prompt (I pressed
a and got)

  ok
  a

 What is the behaviour of “key?”

KEY? is  a standard Forth word. It checks whether
a key stroke (aka an unread character) is available.
It does not block and waits for one, it only checks.

In amforth, KEY? is a deferred word that may be changed
at runtime. The standard KEY? checks the USART Input
Buffer, the one that is filled by an interrupt service
routine, not the one REFILL and SOURCE use.

  I expected the mcu to freeze until I type a key. Am I wrong?

It does so.

 What is “4516”?

A flash address, since BEGIN and UNTIL use such numbers for their
work. Again: these two words are not made for interactive use.

 
 Another question about “key” (w/o question mark):
 
  key  ??
  depth .  1 ok
  .  27 ok
  key .  7 ok
  key dup .  7 ok
  .  27 ok
  depth .  0 ok
  key dup . .  7 27 ok
  
 
 It seems “key” to eat a char from output buffer...

KEY waits for a key-event using KEY? and reads the character
to the data stack. Maybe related to the next topic?

  key  ??-- Here the result was ‘\nok\r\n ‘ and not ‘\n 
  ok\r\n ‘ as expected, a space was eaten
  key .  7 ok   -- Here, after I type an ESC, the result was ‘\n7 
  ok\r\n ‘ instead ‘\n27 ok\r\n ‘ as expected, a “2” was eaten.

Strange, I'd guess that you use the amforth-shell, aren't you? That
shell uses a special character flow control that is great for uploading
source code but completely useless for interactive work with KEY and 
KEY? please use some other, more direct terminal like minicom or putty, 
with minicom I cannot reproduce your errors, but see what you (and I) 
expect.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] float and ip/tcp support built-in?

2015-06-04 Thread Matthias Trute
 is it true that leon maurer's floating point code has been integrated 
 with the default package.
 is it also true that the ip/tcp code has been integrated within the 
 default package?

Both packages are written by independent authors. They are not part
of the default amforth installation, sicne most users simply dont 
need them.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] a small forth project

2015-06-02 Thread Matthias Trute

 Why not use amforth's assembler.frt for words with a need for speed? Right
 now I need to reflash the base image every time I forget some words that
 are implemented in assembly.

It's not a matter of speed, but a matter of bootstrapping the system. 
The whole forth compiler is written in forth, in fact most of amforth,
only that many files are written with assembly syntax. Why? Well, to 
compile a word, a running compiler is needed.

Which files were written in assembly and which in forth, has changed
over the years. It depends on which words are useful/needed initially
and which can be uploaded later. Since the file include works with
the amforth-shell, many assembly files were rewritten as forth code.

 
 Some people (such as myself) may be flashing a large number of nodes before
 deployment. For this reason it would be good to bootstrap-metacompile that
 base image rather than building a tiny core image on the host and compiling
 the rest on the microcontroller.
 
 Metacompiling the image would have the advantage that the entire  complete
 application could be compiled to ihex for deployment and require no uploads
 over UART.

Which somewhat contradicts what I want to do with amforth: I do not want
to create a hex file that is flashed to the controller. That is C-like.
The Arduino works that way too.

 So, a metacompiling Forth system should be able to run code out of its own
 image in order to be built up on the host to become a complete system.

Doable? Yes, of course. Changing amforth to work that way? Unlikely.

The second goal with amforth is to have a simple system. Something I can
understand even after a long working day with crying kids around. 
Metacompiling and other voodoo is definitly nothing I want to do.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] 0 For-next in amforth

2015-05-29 Thread Matthias Trute
Am Freitag, den 29.05.2015, 01:32 +0200 schrieb pito:
 Hi, I've seen your work in progress includes the for-next loop.
 I do not have amforth hw handy these days, but I would be interested to know 
 what the amforth prints with
 
 : test 0 for i . next ;

It prints a lonely 0 . Under the hood
its syntactic sugar around DO and LOOP.

I have no real use case for these two words, but
maybe others do.

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] New Section: Commented Projects

2015-05-29 Thread Matthias Trute
Dennis,

 You should link to my GitHub repository at
 https://github.com/DRuffer/coinForth rather than the older version of
 my paper.
 
 
 The newer version of that document is at coinForth/doc/ARD101/ARD101.pdf

Thanks for the update (and the nice work)

Matthias
--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Floating point - All_math library in asm

2015-05-29 Thread Matthias Trute
Am Donnerstag, den 28.05.2015, 23:56 +0200 schrieb pito:
 Hi, there is a complete fp asm lib for amforth at
 https://github.com/igor-m/Amforth-Floating-Point-in-ASM

Cool stuff

btw: flashforth from Mikael Nordman ported the FP code and it
runs now on a PIC as well. Thanks to the GPL (v3). We
share quite some code already. I love it.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New Section: Commented Projects

2015-05-21 Thread Matthias Trute
Hi,

I've already briefly mentioned a new documentation
section, but would like to spent some more words about.

I collect links or full documentation for a single
not-trivial projects. For now, 3 such projects are listed:
a RS485 based sensor network from Erich Wälde, the 
ARD101 Tutorial from Dennis Ruffer and another sensor
network, this time without long cables from Andreas
Wagner.

I'd like to thank the authors for their efforts, usually
is writing a documentation much harder than the actual
code.

So please spent a few minutes starting at
http://amforth.sourceforge.net/Projects/index.html
it's worth every second.

Matthias
--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] a small forth project

2015-05-20 Thread Matthias Trute
Ian,

 I found this: 
 http://amforth.sourceforge.net/TG/recipes/Arduino-Analog.html
 
 Is this current?

I havn't tested it for quite some time, but it schould work.

   I could not find the code referenced in the article.

Oops. Just added it to the repository. 

 If the recipe is not current I'll happily rewrite it if I decide to go 
 this route.  If it is current, offers of links to RTFM would be welcome. 
 My brain is atrophying by the day.

I'd like to know, if the recipe could be improved.

Matthias

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] compiling 5.8

2015-05-16 Thread Matthias Trute
Hi Paolo,

I glad that the others on the list could help you get
a running system (thanks!). 

  ' refill-xon is refill  ?? -13 15
 
 I cannot figure out the reason or what those errors mean.

It's a bit cryptic, I admit. But easy to decode:

The ?? signals an error (technically an exception is
raised that nobody handled). The -13 is the error (exception)
code, -13 means word not found (a full list of all
possible exceptions is in the docs somewhere, there
are only a few).

The 15 means the column in the text line in which the error
has been detected. The 15th character is the final s from
is. This the full story is: the word is is not found. And
in fact, the IS got rewritten as forth code and can be
found at lib/forth2012/is.frt. You need to load that
file first.

I'll update the docs. And probably write a recipe
for the cookbook / FAQ. 

Matthias

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AMFORTH 5.8 on Uno R3

2015-05-09 Thread Matthias Trute
Dennis,

 I just need to find time to work out the compatibility issues and get
 my LyX document printing again and I will publish the update, probably
 within my coinForth repository, since amforth’s GNU license requires
 it. Then the source code will be more accessible too.

Since you're not the only one with a large project, I took the freedom
to start a new major section on the website: called commented 
projects.

There I collect project documentations and links to them. I think it is 
the natural extension of the cookbook. I already have some links, the 
more the better.


And: please please read the GPL. It does not require to disclose all
and everything, Only if you give GPL'ed code away you have to 
license all of your code contributions under the GPL as well. I know 
of quite a lot of uses of amfoth, where the code is kept in house 
(sometimes literally in house) and that's perfectly ok. One
uses amforth to monitor animals in the wilderness, I've never
seen the code but I know enough about the project to feel good.


btw: I found an offer ny Dr. Ting: http://www.offete.com/328eForth.html

quote
Nevertheless, AmForth is a good working FORTH system for ATmega328P
studied it diligently and enjoyed reading its code.  Whenever possible 
I do use its code for my implementation.
/quote

If someone out there did by this package, (s)he can be sure to have
GPL'ed code If in doubt ask Richard Stallmann or Eben Moglen ;) My
interest in his code is very limited.

Matthias

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AMFORTH 5.8 on Uno R3

2015-04-25 Thread Matthias Trute
Am Montag, den 20.04.2015, 22:17 -0500 schrieb Tom Maynard:
  Can't someone here with a working Arduino Uno R3 help Steve?
 
 I haven't looked, but at least at the release level when I downloaded my
 first Amforth (v5.3?), there were HEX files for all supported hardware
 buried somewhere in the distribution.  Is that not true now?

They are part of the distribution files. At least for fixed hardware
configurations like the arduinos.

 
 Memory says that the HEX files were detritus from the integration testing.

Not exactly detritus since the final testing takes place 
with (some of) the hex files made with the release source tree.

 
 Maybe a simple edit to the Makefile could correct that issue. 

Since I use ant (and the build.xml files) I welcome feedback for
the makefiles. I seldom (in fact never) use make. Since I am aware
that ant is a strange tool for compiling assembly sources 
I keep the makefiles for others (you).

Matthias

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] New release 5.8

2015-04-20 Thread Matthias Trute
 Hi,
 
 I just tried to compiled the template project according to the following 
 manual.
 http://amforth.sourceforge.net/UG/linux.html
 
 The compilation failed. Some ASM files are not in the INCLUDE variable.
 
 INCLUDE=-I $(AMFORTH) -I $(AMFORTH)/devices/$(MCU) -I ../../common
 

Thanks, fixed.  Rev. 1855 is yours :)

Matthias
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AMFORTH 5.8 on Uno R3

2015-04-20 Thread Matthias Trute
Steve,

English is (according to Oscar Wilde) the common language
that separates English an Americans, so I certainly expect
a whole bunch of misunderstandings for non-native
speakers like me. But sometimes... So I beg your (every 
native speaker's) pardon for my English. English is *not* my 
primary language, but I'm sure that only a very few 
people would use amforth if I'd use German (a language I 
know a lot better). Would be funny: IF turns into wenn:

: test wenn . yes anderenfalls . no  daswars ; ;)

So: no offence intended, no offence taken. Ok?

 And I believe any problems in the documentaton could be easily fixed if
 you'd like me to work on that.

Of course I welcome patches. That's why I published amforth.
The problem is, that the code has been very volatile recently
and has seen some very fundamental changes in the way it is 
organized. For the past few months I made an already
complex code tree even more complex. For me it's still simple,
clean and very flexible, but I live with the code base for 
almost 10 years now.

The new MSP430 code got no documentation so far at all. I
think that the documentation needs as much changes as the
code, so *currently* fixes in grammar, style and spelling are
close to be a waste of time. I'd like to come back to you (and
everyone else who wants to contribute) at some later point, 
when I rewrote the docs.

For now enjoy the examples and be assured that I take your
comments as a challenge :=)

Matthias
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AMFORTH 5.8 on Uno R3

2015-04-14 Thread Matthias Trute
Steve,

I like it to get the un-modified first frustration
from people absolutely new to amforth. Really. My
first reaction to your mail was get lost (well, 
something less polite in fact).

Now I think about what went wrong. Amforth is nothing 
I am ashamed of. That may surprise you, but it definitely
is. So when people cry out their frustrations, there
should be a reason for it.

I admit, the past few releases had a strong focus
on the code, not the documentation.

So lets do the work step by step. Rome wasn't built 
in a day as well.

I do hope, that the new linux user guide at 
http://amforth.sourceforge.net/UG/linux.html
finds some mercy in your eyes.

Matthias

Am Montag, den 13.04.2015, 13:39 -0400 schrieb gp2:
 Hello,
 
 As a new user of Amforth, I just wanted to give some feedback on trying 
 to implement 5.8 on an Arduino Uno R3 board.
 
 I had quite a bit of difficulty and it took research over a couple of 
 days to get FORTH running. Here are some of  the issues (and missteps on 
 my part) in hopes that they will be helpful.
 
 I run Puppy Linux normally, but can dual boot into Win 7 if need be.
 
 I started out trying to download the giant Atmel IDE -- but since it 
 also took Microsoft .NET 4, it just didn't seem possible to run in Wine 
 (as suggested in AMFORTH docs).
 
 So switched to WIN7. Download of all components was very long, and being 
 unfamiliar with it, difficult to follow the AMFORTH instructions (which 
 seem outdated ) In particular lots of directory references seem to have 
 changed.
 
 The .hex and .eep binaries I produced finally, after trying to guess at 
 what needed to be the directory structure, and flags, serial baud rate, 
 and Mhz parameters (16 for UNO?), etc. just didn't work, and I had no 
 clues for how to correct them.
 
 Template script comments like Should be obvious for baud rate don't 
 help! No it's not obvious -- a newcomer isn't aware that there is a 
 system default baud rate at all, or what that rate is.
 
 After a day of failure, by accident (not in AMFORTH documentation) I 
 found the directory on Github Amforth that included the ATMEL assembler 
 and necessary files and directories. This would have saved a whole day 
 of frustrating work. And there were updated instructions for intsalling 
 AMFORTH. Eureka!
 
 So, following those instructions, I created a directory my exactly as 
 directed, and tried to make the test template as directed. Immediate 
 compiler error. There are several Words directories scattered about, 
 and the template script couldn't find some of the Word directories for 
 includes.
 
 After I figured that out, I basically copied and pasted the contents of 
 the unfound directories into the /Words the script could find, and then 
 was able to compile.
 
 I know that was sloppy practice, and it seems like you probably have a 
 better method in mind. But up to this point I'd had no success with any 
 instructions for implementing AMFORTH and just wanted to see if I could 
 possibly get a workable .hex and .eep.
 
 I won't go into the problems I had with avrdude trying to use two UNO's 
 -- one as a programmer for the other per Craig Lindley's article. 
 Suffice it to say I sent for and received a programmer from Ebay that 
 worked (after rewiring the plug), and was able to burn the board with 
 the new code.
 
 Unfortunately, I fell victim to the DE hfuse problem on my Uno board, 
 but luckily found the discussion last month that said the hfuse needed 
 to be D9 for AMFORTH.
 
 After solving some terminal setup issues, I was finally rewarded with 
 the AMFORTH prompt, and am happy! I'm using Minicom in Linux (have 
 alsoused Putty for Linux)
 
 I do have some questions, however:
 
 1.) How do I upload .frt library files?
 
 2.) Do the comments in those take up memory space?
 
 3.) Where is the erase function for practice code, or do I have to 
 re-flash a new version of AMFORTH every time to get rid of old code?
 
 I've been going through my old copy of Leo Brody's book again -- last 
 time I programmed in FORTH was on a TRS-80 Model 1 clone that I built, 
 called an LNW-80!
 
 Thanks for making this FORTH available for the Arduino.
 
 ps. I'd be happy to help out with documentation if needed.
 
 --Steve
 
 
 
 
 
 
 
 
 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
 ___
 Amforth-devel mailing list for http://amforth.sf.net/
 Amforth-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/amforth-devel

--
BPM Camp - 

[Amforth] New release 5.8

2015-03-25 Thread Matthias Trute
Hi,

The release 5.8 is on its way to the mirrors and should be
downloadable real soon.

It adds the BUILDS word to the AVR8 code base, and :NONAME
to the MSP430. I fixed a few bugs and regressions as well. 

Update is recommended, the MSP430 variant should still 
be considered beta, but much better than the previous
versions, the AVR8 is pretty stable. I started to 
review the forth code if its suitable for the MSP430
as well, sometimes it is :)

Finally I've got some few ideas like tags for words, stay
tuned..

Have fun
Matthias

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] USART RX problem

2015-02-21 Thread Matthias Trute

 I am trying to use amforth 5.7 an atmega168pa, which usart0 is connected
 to PC COM-port via max 3232 UART-RS-232 converter.
 
 I could get 
 amforth 5.7 ATmega168PA
  
  text on PC terminal, but I couldn't get anything else. Everything 
 seems
 to be connected correctly,

If you can read the text banner, many things are set up correctly. At
least the baud rate and the terminal settings match and the tx pin is
ok. I'm not familiar with the 168PA, but I'd guess that the RX only
doesn't work, maybe the wrong pin, maybe something else on the way
between the PC and the controller (USB dongle?, bad soldering?).

Possible but unlikely are problems in the software. I remember old
Atmegas (103, IIRC) that used a unique and uncommon register layout
for the usart module. The datasheet should tell all details. I'd guess
that Atmel sees the 168PA as the successor to the 168 and has an
application note on how to migrate. That may be useful as well. But
again: first check the hardware.

Matthias

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/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] Atmel's Assembler

2015-02-07 Thread Matthias Trute
Hi,

for many years I was certain that Atmel Inc won't
allow a redistribution of it's tools independently 
from their own software portal. Turns out, I was wrong. 
Deep inside the Atmel studio installation I found 
a file called license.rtf that basically told me: 
yes you can, if you obey the terms and restrictions.
As far as I can tell, they allow the assembler and 
the include files to be redistributed unmodified and
require that the license is kept unchanged.Fair enough,
the GPL goes only a few steps further.

To make it clear: The Atmel Assembler is not free software 
and it is not part of amforth. For easy usage I put it on 
the sourceforge download portal in a ready-to-use directory 
structure. Just download the tgz file and unpack it inside 
the amforth base directory.

https://sourceforge.net/projects/amforth/files/Atmel-AVR8-Assembler/

Comments, feedbacks etc welcome, as usual

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Atmel's Assembler

2015-02-07 Thread Matthias Trute
Am Samstag, den 07.02.2015, 13:15 +0100 schrieb Zbigniew:
 2015-02-07 13:07 GMT+01:00, Matthias Trute mtr...@web.de:
 
  For easy usage I put it on
  the sourceforge download portal in a ready-to-use directory
  structure. Just download the tgz file and unpack it inside
  the amforth base directory.
 
  https://sourceforge.net/projects/amforth/files/Atmel-AVR8-Assembler/
 
 Download is not possible:

Strange. A few random clicks in the admin pages with no
changes did change something after all. It works for
me (now?).

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] New release 5.7

2015-02-01 Thread Matthias Trute
HI,

I just released a new version of amforth. For the
Atmega controllers it fixes a few regressions introduced
with 5.6. The MSP430 port made a few huge steps forward.
Most notably are an almost complete double cell number
support (thanks to Martin for some assembly words), and
many many small fixes almost everywhere. That work's 
not yet finished however, so please see the MSP430 still 
as beta.

Common for both are a few more words from the Forth 2012
standard: NAMEx. 

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] New release 5.7

2015-02-01 Thread Matthias Trute

 I would to ask you a question: there is a statement on amForth's
 GitHub page:  amforth is influenced by (early versions of) avrforth
 from Daniel Kruszyna http://krue.net/avrforth/ and by the series of
 articles Forth von der Pike auf by Ron Minke published at the
 vierte dimension at http://www.forth-ev.de/ 
 
 Well I mean these articles (which I read presently), since they show
 exactly what I'm after right now: flexibility in selection where new
 words can be added - be it flash or RAM - and where the recognizer
 will look for them. I wonder would it be very complicated to add such
 configuration capability to amforth - for the microcontrollers, that
 are able to use external RAM (like Atmega162, for example)?

Ron's Forth may do what you want, you should ask him for a copy.
I've never seen it in action however. We never exchanged code or
anything else beyond the papers. When I wrote the amforth core
system, his series of articles was only partly published, his
complex RAM usage was unknown to me, so I implemented by own
ideas. Without a dependency on external RAM.

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth-devel Digest, Vol 76, Issue 2

2015-02-01 Thread Matthias Trute
 ,
 
 Made the change (hfuse was 0xde, changed to 0xd9) and now it works.

Great. 
 
 BTW does anybody know a place where these fuse setting are conscisely
 explained ?

Wanna hear some bad news? Read the datasheets of the controller. Every
Atmega has its own set. Blame Atmel for that. If you got more 
comfortable to the Atmega world, the url 
http://www.engbedded.com/fusecalc/ is a great tool for the enlightened 

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AmForth on Atmega162 with external RAM

2015-01-31 Thread Matthias Trute

 
 Yes, I'm aware of this. I was hoping to get some help here, how to
 (re)configure AmForth to make it work with the thing the way I want.

I doubt that it is a reconfiguration only. You'll have to change
some very basic things in the heart of amforth.

 it's feasible when using indirect-threaded Forth. So giving up the
 Flash would be a waste. Why? What for? Certainly it can and should
 work the way I require.

The 162 dosn't have that much flash (16KB), amforth with all bells and
whistles comes close to that. Thus I think, there won't be much
space to be wasted.

Anyway: Good luck it's a nice project. If you have any questions, 
feel free to ask.

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] AmForth on Atmega162 with external RAM

2015-01-31 Thread Matthias Trute
Hi Zbigniew,

 As an interesting exercise I'm going to recreate a little computer,
 whose design has been published on pages
 https://sites.google.com/site/retroelec/home

Cute 

 
 There is a statement: An ATMega microcontroller is a Harvard
 architecture machine. So to be able to load and run arbitrary code
 without reprogramming the flash memory the code has to be interpreted.
 Therefore the ATMega emulates a 6502 processor (- von Neumann
 architecture).

From the perspective of the controller, any compiled forth code is
data indeed. That data is handled by the inner interpreter (basically
amforth-interpreter.asm).


 So my question is: is it possible for AmForth to use the entire
 external SRAM area for both data and my own new words?

Forth words are represented with a  single cell sized (e.g. 
16bit) number called execution token (the data mentioned above).
That number is used in the inner interpreter to identify both
machine code to be executed *and* to identify more data (other
compiled forth words).

Thus if you want to place them at different memories, that would
require changes in the core system: the inner interpreter,
the words , (comma), compile, body and execute. Maybe a few
more as well.

  You know, what
 I'm after: to have basic Forth system burned into FlashRAM, and then
 - as usual - to interactively develop the software for the little
 machine using that 128 KB SRAM the guy selected for his design.

To keep it simple(r), I'd recommend to separate the memories. Leave
the flash for forth, and let the 6502 operate the RAM. The initial
RAM content may come from flash. The flash may provide a block
storage service for the 6502 system as well (floppy emulator?).

Matthias
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Is this a bug ?

2015-01-31 Thread Matthias Trute
Am Samstag, den 31.01.2015, 19:27 + schrieb Andrew Holt:
 Or am I doing something stupid ?
 
 Hi,
 
 I have built amforth using the latest downloaded source.
 
 The target is a UNO R3, with the am328p.  I am programming it with a
 usbtiny.

UNO sounds like arduino. Right? 

The arduino people set the fuses in a way that does not
work with amforth. Have a look at the readme file in the
appl/arduino directory and check the current settings
with the ones described there. I'm sure, they differ. Eso
the ones defining the boot sector size.

To solve the problem, apply the fuses from the readme file
to your controller, but be warned: changing the fuses may
cause a complete lost of your controller chip if done
the wrong way or by doing an error.

 And the try 'words'
 
 I get the same error.

That's normal for the situation described above. And makes
me sure to direct you to the fuses.

 It's as if the first definition is messing up the links.

Exactly. The basic problem is that the flash write
operation silently fails but updates the dictionary
pointers. They point to useless memory content and
everything's lost.

Matthias

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] Social Media Links on the amforth website

2014-12-01 Thread Matthias Trute
Hi,

amforth goes social ;) Every page on the website
got a few social media links for the usual suspects.
There is no need to worry however. Neither I nor 
Sourceforge nor the mentioned companies will track 
you. Unless you hit the links, of course.

The magic behind the scene comes from the German
computer magazine c'T. They call it shariff.

Matthias

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/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] 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


Re: [Amforth] New License

2014-11-02 Thread Matthias Trute
Enoch,

 (1) A GPLv3 project can include GPLv2 pieces thus, formally, you don't
 need anyone's consent. Also, all my contributions, those that you
 accepted (as many more you have rejected) carried the following
 spirit: \ Software license: AmForth compliant, see ...  which means,
 do with it as you please.

Thank you indeed.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Amforth last week changes

2014-10-29 Thread Matthias Trute
Hi,

 (1) I don't know what exactly isn't working but between trunk@1680 to
 trunk@1685 there is something that breaks my system badly. System
 reboots on almost any command line input...

That's bad. The only major change was the map-stack factor. And
that works for me. I'll do some more checks, thanks for telling.

 
 (2) Please explain why you changed the license in trunk@1687 from GPLv2
 to GPLv3. Correct me if I am wrong, it seems to me that you did not
 choose the any later version option of the GPLv3 (a constantly
 updating GPL). Until I grasp the full meaning of GPLv3, including
 your new expectations, you may be pleased to learn that you have
 managed to shake off your loyal shadow
 https://github.com/wexi/amforth-shadow.

Well, what should I answer? I have some very smart code here that 
I strongly want to include into amforth that is published under
the GPLv3. This will bring amforth to a next level and opens the
door to even more. I could not do that myself, so I use the great
GP license to improve my project by including the work of others.
I love standing on the shoulders of giants. The price to pay is 
the (small) license upgrade.

I don't want to loose you as a competent user and contributor, but
if you cannot live with the new license: Sorry, and farewell. :=(

 (3) Regarding trunk@1675, I consider your removal of the warning from
 amforth-shell.py when it tries to append the file name to a non
 existant uploaded-wl wordlist even worse than the previous
 situation. I really don't undertstand why you are not providing this
 feature through a command line option.

Something on the wish/todo list. Patches are welcome.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Porting AmForth to other architectures...

2014-10-27 Thread Matthias Trute
Hi Bill,

 I was thinking that AmForth would be a good starting point for porting to
 other architectures, given that
 1) It's nicely modularized.
 2) Many of the words are written in forth, but expressed in assembler.
 3) the assembler syntax is relatively generic, and probably easily ported.
 (so, something like core/bin.asm stays looking about like it does now, even
 if the CPU architecture changes drastically.)
 
 Am I out of my mind?

IMHO no

   Is there a better starting point?

I've played with the naken_asm recently. It is not
(yet?) able to do the job for the atmega's but a
msp430 variant looks promising.

 The actual target is an STM32F103 ARM chip.  Don't suggest C
 implementations; that's not what I want to do.

Of course not ;)

If the msp430 port is successful it's probably easier to start
for another system. Currently, there are a lot of things that
work for the atmegas but not for others.

Matthias

--
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Correct fuses for ATMega32

2014-10-15 Thread Matthias Trute
 Hello,
 what should be the correct settings of the fuses for an ATMega32?

The answer is as always: It depends. It depends on your hardware
layout, it depends on whether you want to use the watchdog/brownout
detector, it depends on your clock source etc. Since there is no
general answer, I cannot tell the correct settings. Thus I
wrote

 MCU=atmega32
 # set the fuses according to your MCU
 LFUSE=0xnn
 HFUSE=0xnn

to make clear, that there is work left for the user. 

I usually use controllers with external quartz oscillators and
sufficiently clock rate (8-20 MHz). For that I usually leave the
factory defaults (see datasheet from www.atmel.com) plus change
the the oscillator fuses. Arduino's usually require a reset
of the NRWW boot section to the maximum size (the arduino
bootloader is small).

There is a nice website to play with the fuses and it gives
you a copy'n'paste ready avrdude commandline

http://www.engbedded.com/fusecalc/

Fuses are very sensitive, making an error with them
can cause a lot of trouble to re-vive the controller
(it's almost always possible, but may require special
programming hardware, look for HV programmers and 
external clock sources).

Sorry if this is not the answer you may have expected.

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://p.sf.net/sfu/Zoho
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Compiling failed with AMForth 5.5 for ATMega32

2014-10-15 Thread Matthias Trute
 I tried AMForth 5.2 but here i have 101 Errors:
 
 $ make
 wine ../../Atmel/avrasm2.exe -I ../../Atmel/Appnotes2 -I ../../core -I 
 ../../core/devices/atmega32 -fI -v0 -e 
 template.eep.hex -l template.lst template.asm
 err:winedevice:ServiceMain driver LIOPort failed to load
 ../../core/devices/atmega32\device.asm(5): error: Cannot find include file: 
 m32def.inc

This is the root cause. You need to copy some include files from the
Atmel studio to the directiory /Atmel/Appnotes2. 

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://p.sf.net/sfu/Zoho
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


  1   2   3   4   >