RP2040 Tiny / Mecrisp Forth / Neo Pixel

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024

Комментарии • 48

  • @lmamakos
    @lmamakos 11 месяцев назад +8

    Both zepoforth and mecrisp forth are amazing resources to have available. I've done a project using Mecrisp FORTH on an STM32F103 some years ago, and it was a great resource to have. FORTH is wonderful for doing interactive embedded systems work to explore and poke at hardware interactively. Both FORTH implementations are also very high performance implementations and compact.
    Lately I've been playing with zeptoforth on the RP2040 microcontroller and it also looks very promising. It looks very complete, having primitives for using both CPU cores and multiprocessing primitives for IPC and synchronization amongst concurrent tasks. Very powerful!
    Thanks for the video!

    • @0033mer
      @0033mer  11 месяцев назад +1

      Hi Louis ... thanks for sharing!

    • @theelmonk
      @theelmonk 11 месяцев назад +2

      That's a lot of Forths .. has anyone done a comparison ?

  • @duanecjohnson
    @duanecjohnson 5 месяцев назад +1

    High 0033mer;
    Technically, Wave share has another 2040-TINY called the MINI.
    It has the same footprint with a type C connector on the board. Slightly cheaper too.
    The MINI also has broken out 12 more pins on the back side as small solder pads.
    I have no idea how to connect to them yet, a wafer wire bonder comes to mind.
    Or maybe 30-gauge solderable magnet wire.
    I find the MINI suits my need better when on the plug board. Then go over to the TINY when finished.
    ( The TINY is marked with Version 1.1 and I suppose the MINI is Version 1.0)
    BTW, I also like running Pico Basic on these too.
    redrok

    • @0033mer
      @0033mer  5 месяцев назад

      Thanks for sharing.

  • @flomojo2u
    @flomojo2u 11 месяцев назад +5

    Great tutorial! It's been so long since I've seen anybody do some good coverage of Forth, rock on!

    • @0033mer
      @0033mer  11 месяцев назад +1

      Thanks for the feedback!

  • @pileofstuff
    @pileofstuff 11 месяцев назад +2

    FORTH on one of the newest microcontrolers?
    I wonder if anyone has ported FORTRAN or an even older language to the 2040...

    • @0033mer
      @0033mer  11 месяцев назад +4

      Forth and C are about the same age. Forth 1970 and C 1972. Basic ( 1964 release ) is available for the RP2040:
      geoffg.net/picomite.html

    • @pileofstuff
      @pileofstuff 11 месяцев назад +2

      @@0033mer I love the contrast of "ancient" programming languages on modern hardware.

  • @abpccpba
    @abpccpba 5 месяцев назад

    Hi; Ken you said " I got a lot of complaints that I was not following Forth "standards" so I took the site " that's why I can't find your early work. : = {{ Not hidden somewhere is it. At 83 is it was something I could flow. Thank for your good work. : = }}

  • @ShellacScrubber
    @ShellacScrubber 11 месяцев назад +1

    Excellent.....you must have read my mind Ken. I was just about to order some neo pixels to play around with using either punyforth of flashforth !
    I don't have an RP2040 Tiny but it looks like a great little board that I'm gonna have to get !
    I do however have mecrisp on a raspberry pi pico !
    One feature of the RP2040 that particularly interests me is the PIO in the form of 8 state machines allowing for custom bit-banged serial protocols !

  • @krish2nasa
    @krish2nasa 10 месяцев назад +1

    Hope to see FORTH on RISC-V MCU soon. Thank you very much.

  • @JonMcPhalen
    @JonMcPhalen 10 месяцев назад +1

    How are you doing the specific bit timing for the WS2812B. I have written lots of pixel drivers for the Propeller 1 and Propeller 2 and know that pixel timing is specific.

    • @0033mer
      @0033mer  10 месяцев назад +1

      The RP2040 is clocked at 125 mHz so it is fairy easy to code nanosecond delays. Forth runs as fast as assembler so GPIO control is efficient. When controlling a single neopixel the timing is pretty flexible.
      T0H 200ns min 500ns max
      T1H 550ns min and there is no max ( I have used 1 second which works )
      T0L and T1L 450ns min and 5000ns max ( any higher will be seen as Latch )
      The Neopixel timing start is low to high edge triggered and reset on the next positive edge.
      With Forth it is easy to do "what if" scenarios interactively from the keyboard to check these timing parameters.

  • @harrykaradimas857
    @harrykaradimas857 10 месяцев назад +1

    Forth The us with be may print

    • @TooSlowTube
      @TooSlowTube 9 месяцев назад

      also you. with And

  • @lasersbee
    @lasersbee 11 месяцев назад +1

    Have been looking at that board.... Good quick Tut....

  • @TheKetsa
    @TheKetsa 11 месяцев назад +3

    Where to find a good intro to forth for MCU?

    • @0033mer
      @0033mer  11 месяцев назад +3

      Check out the Scamp3 board runnung flashforth. There are tutorials online:
      udamonic.com/what-is-a-scamp.html
      pajacobs-ghub.github.io/flashforth/elements-of-flashforth-5.html

    • @kayakMike1000
      @kayakMike1000 10 месяцев назад +1

      Why not just learn C? Fourth is such a niche language

  • @nil0bject
    @nil0bject 11 месяцев назад +2

    can't wait for this footprit to have wifi/ble.
    another small board i found is the RP2040 Zero.
    cool video, thanks

    • @0033mer
      @0033mer  11 месяцев назад +1

      Welcome!

    • @duanecjohnson
      @duanecjohnson 5 месяцев назад

      But seriously, where would you put the WIFI.
      Possibly stacked and connected to those 12 extra pads on the MINI version?
      redrok

    • @nil0bject
      @nil0bject 5 месяцев назад

      @@duanecjohnson yeah i was thinking stacked on a daughterboard

  • @alexloktionoff6833
    @alexloktionoff6833 10 месяцев назад

    Nice little board! I think the drop-in replacement board with 28pin DIP ROM/RAM compatible pinouts cold be perfect for retro-projects.

  • @shreyanshshukla4939
    @shreyanshshukla4939 10 месяцев назад +1

    great vid

  • @MarkBender-u1x
    @MarkBender-u1x 10 месяцев назад +1

    I like your RUclips videos on Mecrisp Forth however it would be nice if you would provide all of the Forth code necessary to implement the project. Without the entire Forth environment description it's difficult to implement what is described in the video.

    • @0033mer
      @0033mer  10 месяцев назад +1

      Hi Mark, thanks for the feedback. I made the video to only feature the RP2040-Tiny board and just wrote some Forth code using Mecrisp to demo the NeoPixel. I used to have a website where I had tutorials and getting started code for beginners using Mecrisp and eForth on ARM microcontrollers. I got a lot of complaints that I was not following Forth "standards" so I took the site down and now only show the "capabilities" of Mecrisp Forth. I have gone over to the Flashforth platform using the Scamp3 board running a PIC microcontroller. I go over all the code in the videos featuring the Scamp3 board and there is support from the Scamp3 designer (John) and Flashforth author (Mikael) on their websites.

    • @TooSlowTube
      @TooSlowTube 9 месяцев назад

      I recognise some of the "words" used from a file that's included with recent Mecrisp releases. This is from a comment on another one of @0033mer's videos, I think (I forget which, but I kept a note of the comment:
      "In the rp2040-ra directory of the Mecrisp Stellaris distribution is a file "playground.4th" included, which implements some of the words used in this tutorial. Maybe a good entry point to play around with it."
      I've tried parts of that with ZeptoForth, but I had to change a small part of it to get it to compile.
      playground.4th contains definitions of words used to read and set pins, etc.

    • @TooSlowTube
      @TooSlowTube 9 месяцев назад

      I was a bit off on "recent" - it was "Run Forth On The Raspberry Pi Pico / Mecrisp" by @0033mer, from 2 years ago. You'll find it in the videos tab. The comment was by @computermuseumvisselhovede3380 and I currently see it as the second one on that video (YMMV, due to the vagiaries of the YT experience).

  • @PhG1961
    @PhG1961 11 месяцев назад +1

    Impressive!

    • @maximus6884
      @maximus6884 11 месяцев назад

      Waveshare never share the schematics openly therefore their board should never be used for development.

  • @TooSlowTube
    @TooSlowTube 9 месяцев назад

    I'm glad to see current videos on this. Any material you still have from your old website would be good to read or watch too. Standards are for other people, and definitely not for hobbyists.
    Is there a way to have a Forth program load and run on booting up an MCU in either Mecrisp or Zepto Forth, like we can with C++ programs in Arduino? I'm trying to wade through the documentation but I've yet to find anything about that.
    Assuming we can, is there a way to programmatically quit back to the REPL, e.g. on a buton press that's being watched for?
    Can we develop code in the REPL then save it to an SD card, like using a cassette recorder on an 80's home computer to save and load BASIC programs?

    • @0033mer
      @0033mer  9 месяцев назад +2

      Every Forth has a way to produce "turnkey" applications to boot on power up. When using Mecrisp, name you main word "init" and it will boot on power up. You can create a backdoor by monitoring a spare GPIO pin on bootup. If you hold it low during power-up it can restore Forth back to the ok prompt. The Scamp3 board uses the sequence ' main is turnkey to auto run a program on power-up. A hard reset will restore control to the ok prompt.

    • @TooSlowTube
      @TooSlowTube 9 месяцев назад

      @@0033mer Thanks. I'll try that. If I have my program monitoring a pin, what's the word to use to exit it to the ok prompt, when it sees that pin change?

    • @0033mer
      @0033mer  9 месяцев назад +1

      It depends on how your main word is setup. You could use "exit" to jump out of your main word on GPIO sense or you could use the simple begin key? until and get out using the serial port. Check out "turnkey" in the documentation: mecrisp-stellaris-folkdoc.sourceforge.io/

    • @TooSlowTube
      @TooSlowTube 9 месяцев назад

      @@0033mer Thanks. I did look at that documentation earlier, but didn't find anything really useful. So far I've found:
      Turnkey
      Methods to create a final Mecrisp product.
      Warning
      ! UNDER CONSTRUCTION !
      and;
      compiletoflash
      : non.closed.loop.program \ loop until keyboard key pressed which will exit loop and return control to the terminal
      begin
      ." This MCU is running a TURNKEY application" cr
      key? until
      ;
      : INIT
      non.closed.loop.program
      ;
      compiletoram
      " non.closed.loop.program" really needs an example of such, not just that comment.
      Mostly, I was trying to avoid getting stuck in the init word/function and having to reflash it to start again.

  • @steveharper2857
    @steveharper2857 11 месяцев назад

    What happened to the pin 16 description?

    • @0033mer
      @0033mer  11 месяцев назад +1

      The schematic at 5:08 shows GP16 connected to the input of the Neo-pixel ( Din ). The word >neo sends RGB data from GP16 to the Neo-pixel.

  • @cthoadmin7458
    @cthoadmin7458 11 месяцев назад

    Why would you use Forth, over Pico's C? What wold it give me?

    • @0033mer
      @0033mer  11 месяцев назад +3

      Using Forth is the best way to control hardware. Direct register programming allows you to exercise all functions of any peripheral.

    • @flomojo2u
      @flomojo2u 11 месяцев назад +5

      It's incredibly dense and efficient when it comes to interactive control and testing. There's virtually no syntax or all the extra punctuation required by other programming languages, and while it can be cryptic when writing more complicated code, when it comes to querying and controlling stuff it's unmatched and can run in the tiniest amount of resources.

    • @theelmonk
      @theelmonk 11 месяцев назад +2

      Interactive and incremental compilation. Generally less overhead than other types of interpreted language as it compiles to routine addresses as code is entered rather than token lookup. But it still IS interpreted - if an external compiler is OK, C is still better.

    • @TooSlowTube
      @TooSlowTube 9 месяцев назад

      @@theelmonk I expect it depends on the version of Forth, but from what I've read it's partly interpreted, and partly compiled. Using the REPL (command line part) is interpreted. Pre-defined words should be pre-compiled, and any you define may or may not get compiled, but the original idea is that they would be, I think.

  • @RalphWLundvall
    @RalphWLundvall 11 месяцев назад +1

    Thanks. Learned some Mecrisp, will a later video cover some zeptoforth (my current favorite)?

    • @0033mer
      @0033mer  11 месяцев назад +1

      Possibly!