Menu

Do ... Loop construct

2021-08-22
2021-08-29
  • Simon Whittam

    Simon Whittam - 2021-08-22

    I have been trying to use the doloop.fs file from the AVR library interacting with a Arduino Nano using a Atmega328. The doloop.fs Forth file doesn't explicitly mention that it works with the Atmega328.

    Should it work with the Atmega328 ?

    When testing the doloop.fs library file, I see the desired out come on the stack, but it doesn't return control to the terminal, i.e FF appears to lock up.

    This has been tried after using the 'empty' command with only the doloop.fs library file loaded and a test word loaded that executes '3 0 do i . loop'

    Thank you
    Simon

     
  • Mikael Nordman

    Mikael Nordman - 2021-08-23

    Which verson of FF are you using ?

     
  • Simon Whittam

    Simon Whittam - 2021-08-23

    Mikael, I'm using: FlashForth 5 ATmega328 13.01.2019

     
  • Mikael Nordman

    Mikael Nordman - 2021-08-25

    doloop works fine for me on the Atmega328 with the latest builds and with the hex file in the repository.

    The previous update to the doloop source was in 2017. Could your doloop source file predate 2017 ?

    Could there be some compilation errors when you compile the doloop ?

    Mikael

     
  • Mikael Nordman

    Mikael Nordman - 2021-08-25

    Did also a test with the ff_uno.hex file dated 13.01.2019.
    That does not work for me either.

    So you need to update to the latest FF.

    Mikael

     
  • Simon Whittam

    Simon Whittam - 2021-08-26

    I was not aware of a new FF build .
    Now running FF build 18.11.2020,
    Interacting with FF using TeraTerm (34800, N, 8, 1, No Flow Control, 100mS/line)
    Micro detected on supposed Nano board by Avrdudess /Bus Pirate is 328P

    I see lots of "compile only" error messages when loading "doloop.fs" library file.
    Sometimes this leads to the corruption of FF and I then need to reprogram my Nano board

    I have no problem loading "core.fs" library file.
    I'll have to experiment further to try and find the cause of the errors.

    Another unrelated question. Help documentation indicates the word '2over" should be available for FF. Was this word previously incorporated in FF ?

    Thank you.
    Simon

     
  • Mikael Nordman

    Mikael Nordman - 2021-08-29

    For me loading source code works just fine. But I am using ff-shell.py on Linux.
    Check which is the first error when you load dooloop.fs. That should tell something about your problem.
    Delays between characters could help. Or an even longer end-of-line delay.

    2over was removed very early in FF development. I don't remember why.
    The "wordsAll.txt" is the most accurate document about FF words.

     
  • Simon Whittam

    Simon Whittam - 2021-08-29

    Have overcome FF errors loading DO ... Loop word by adjusting TeraTerm settings
    i.e (34800, N, 8, 1, Xon/Xoff, 1mS/Char, 5mS/line) is about optimum for my environment.

    Thank you for your help Mikael.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.