Re: [Amforth] Broken turnkey example [documentation]

2019-06-18 Thread Tristan Williams
Hello Peter,

> This was also to automate as much as...

I use amforth-shell.py to automate the process of loading AmForth files
onto the mcu. I use OS X, so I don't know if it will work on Windows, but
I find it indispensable.

http://amforth.sourceforge.net/TG/recipes/Upload.html?highlight=amforth%20shell

Kind regards,

Tristan



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


Re: [Amforth] Broken turnkey example [documentation]

2019-06-15 Thread Peter Mortensen



>>    Corresponding web page:

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


The error message is the non-descriptive:

     ?? -13 23

'Evalue' was found in:

     \lib\forth2012\core\avr-values.frt


> On 12/06/2019 01:37, Tristan Williams wrote:

Hello Peter and welcome,

I have just tried the turnkey example from the docs

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

and it works for me.

Your error message[1] ?? -13 23 after the line

' turnkey defer@ Evalue tk.amforth

suggests that you are missing the word Evalue


Yes, it turned out I was on the second flash of AmForth (on a separate 
chip), with "Evalue" being


defined on the first chip... (something went wrong and I had to flash 
AmForth again).





Have you loaded these files on your mcu?

avr-values.frt
is.frt
ms.frt
defers.frt

as the line

' turnkey defer@ Evalue tk.amforth

depends on words defined in these files.



I have done that now, and it works now! That was probably

the crucial step (though I don't understand why(?)).


I could also define "tk.custom" and set it up with "    ' tk.custom is 
turnkey    ", putting


my main init and infinite control loop in there, all in word 
"mainApplication". After a power


cycle, the control loop ran immediately, as it should.


The control loop can be terminated by removing a jumper that pulls a 
digital


input low (pulled up externally with 10 kΩ). The jumper is located on

my custom Arduino shield.


Also, connecting the Arduino Uno to USB while in the control loop 
(mainApplication) does not


reset the I/O and does not disrupt the operation (unlike normally, 
where, even if powered from


a 9 V battery source, connecting will reset - though I cannot rule out 
power glitches). When the


jumper is removed the normal interactive stuff is available.


Everything works as it should!!


For this try, I had to flash AmForth a third time (due to another 
incident, an unfortunate paste error...)


and used the opportunity to see if I could repeat it. This was also to 
automate as much as


possible (.BAT script calling AVRDUDE for the flashing, launching PuTTY 
with the profile


for this (38400 baud, etc.), and running several AutoIt scripts for the

source pasting). There were a few corrections.


The fourth time, with a few more changes for automation (mostly focus 
changes in Windows), should


reduce it to moving the chip from the ISP programmer to the Arduino and 
a single press of Enter


when it has been moved. But this is not needed for this first 
deployment, only for subsequent


versions (if there will ever be more). With direct ICSP, just starting 
the script should be enough.




    : tk.custom

    \ Call the previous turnkey action.
    tk.amforth execute


    \ Now something specific e.g.

    \ I_O-setup

    mainApplication
    ;


Regards,
Peter




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


Re: [Amforth] Broken turnkey example [documentation]

2019-06-11 Thread Tristan Williams
Hello Peter and welcome,

I have just tried the turnkey example from the docs

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

and it works for me.

Your error message[1] ?? -13 23 after the line

' turnkey defer@ Evalue tk.amforth

suggests that you are missing the word Evalue

Have you loaded these files on your mcu?

avr-values.frt
is.frt
ms.frt
defers.frt

as the line

' turnkey defer@ Evalue tk.amforth

depends on words defined in these files.

Secondly, this mailing list message (at the bottom of the message)
shows an alternative approach

https://sourceforge.net/p/amforth/mailman/message/35161327/

: tk.custom
applturnkey

\ your code goes here
;

' tk.custom is turnkey

Best wishes,

Tristan

[1] http://amforth.sourceforge.net/TG/Architecture.html#exceptions



On 11Jun19 21:08, Peter Mortensen wrote:
> 
> 
> I think revision 2122, 2016-06-26 (the latest for that file) for
> page "Turnkey applications" wiped out the 'variable' line for
> the containing old turnkey thingy (now 'tk.amforth') -
> 
> 
> https://svn.code.sf.net/p/amforth/code/trunk/doc/source/TG/recipes/Turnkey.rst
> 
> 
>     Corresponding web page:
> http://amforth.sourceforge.net/TG/recipes/Turnkey.html
> 
> 
> Thus, before the line " ' turnkey defer@ Evalue tk.amforth "
> (line 38/39) there should probably be this line(?):
> 
> 
>     variable tk.amforth
> 
> 
> 
> The error message is the non-descriptive:
> 
>     ?? -13 23
> 
> 'Evalue' was found in:
> 
>     \lib\forth2012\core\avr-values.frt
> 
> 
> 
> (I have done my first real Forth project (the first version
>   is based on Arduino Uno hardware), and it is going to be
>   deployed to the real world! In exactly one instance. It
>   involves sending RC codes (433.92 MHz) to a 220 V relay.
> 
>   The turnkey thing is the last hurdle. And perhaps avoiding
>   hardware reset (I/O ports, etc.) when connecting through
>   USB.
> 
>   I have also installed Mecrisp Stellaris Forth on the 1Bitsy
> (),
>   intended for some CAN bus work, but this is the first real
>   project.
> )
> 
> 
> 
> Regards,
> Peter Mortensen
> 
> 
> 
> 
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


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