Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #42755

Re: Forth and "embedded" enviroment

From kristoff <kristoff@skypro.be>
Newsgroups comp.lang.forth
Subject Re: Forth and "embedded" enviroment
Date 2015-10-22 15:37 +0200
Organization A noiseless patient Spider
Message-ID <n0apph$3dl$1@dont-email.me> (permalink)
References <n0934k$6kh$1@dont-email.me> <n09fqj$8pn$1@dont-email.me>

Show all headers | View raw


Hi Rickman,


(inline coments)


On 22-10-15 03:59, rickman wrote:
>> I am interested in using Forth on embedded platform (currently trying
>> out mecrisp on a STM32).
>> Does anybody have links to documentation on this? (GPIO, SPI, I2c,
>> single-wire, ADCs, DACs, external hardware interrupts, timed interrups,
>> ....).

> I'm not sure what info you are looking for.  The programming interfaces
> for the various MCU peripherals are all different between brands. Mostly
> they use programmed I/O unless you are expecting asynchronous events
> such as with UARTs where you may want to use interrupt driven routines.
> I think you are going to find Mecrisp only has support for the I/O to
> the console and every thing else you will need to roll your own.  This
> is best done by obtaining the source in either assembly or better C code
> which you can then recode in Forth.


Well, I give a small arduino / microcontroller / programming course in 
our local radio-club here in Ostend and have been thinking if it would 
be possible to give a m smmal demo on Forth (to show it next to 
arduino/wiring, native C or mbed).


Now, one of the nice things about the arduino platform (from a simple 
user point of view) is the standard standard API for a lot of basic 
stuff that works all across the board.
Things like "pinMode", "digitalWrite", "analogRead", "delay", etc. all 
work on whatever platforms: arduino AVR, arduino ARM, mapple 
(STM32-based arduine clone), Energia (arduino-IDE clone for the TI 
launchpad), ...

There even is code for (say) attaching functions to timed-interrupts, to 
hardware-interrupts, etc.


Of course, the code below (say) "digitalWrite" is different for every 
microcontrollers, but that is also the case for the 
arduino/mapple/energvia platform).

After all, isn't that the goal of a high-level language: hide the 
complexity of the low-level bitshifting code for the high-level 
application-level programmer.



So,
- is there a standard "library" for the basic I/O functions a embedded 
controller is typically used for. (reading from ports, writing to ports, 
...)

- If no such thing exist for the particular microcontroller I use, I do 
not have an objection to try do some stuff myself.

As mentioned above, the nice thing for an application-level programmer 
about the arduino platform is the standardised API that exists accross 
platforms.

Is there a standard API in Forth for this kind of work, so that a Forth 
application on one microcontroller can be ported with limited (or no) 
effort?


- Are there any open-source examples of code for certain things. I guess 
certain things are pretty straight-forward (like reading or writing to a 
digital pin), but other aspects are more complex.

E.g. two weeks ago, in our radio-club, we did an exercise to read the 
input from a PS/2 keyboard using an arduino. If you look into the C++ 
class for this, it see that it actually uses a hardware interrupt 
(attached to the clock-signal of the PS/2 interface).

It would be nice to have some code-exmmples to look at to find out how 
to code this in Forth?




>
> I just received a new board with the FPGA/MCU SoC from Microsemi which I
> am going to try to get Mecrisp running on.  The above is how I am going
> to do that.  You can email me if you'd like to have an exchange about
> all this, or we can discuss it here.  I'll probably get around to
> starting some of the work next week.
Well, I am still pretty new in all this, but if I can help, no problem.


> If you need to dig into Mecrisp to learn how that works, some of it is
> commented in German, so you may need a translation web page if you
> aren't a native speaker.  If you are a native speaker, I may need you to
> help me translate.  Sometimes technical jargon is hard to translate.
My reading-skills of German are not 100 % but I can manage.


Cheerio! Kr. Bonne.

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Forth and "embedded" enviroment kristoff <kristoff@skypro.be> - 2015-10-22 00:23 +0200
  Re: Forth and "embedded" enviroment Roberto Waltman <usenet@rwaltman.com> - 2015-10-21 19:19 -0400
  Re: Forth and "embedded" enviroment rickman <gnuarm@gmail.com> - 2015-10-21 21:59 -0400
    Re: Forth and "embedded" enviroment kristoff <kristoff@skypro.be> - 2015-10-22 15:37 +0200
      Re: Forth and "embedded" enviroment rickman <gnuarm@gmail.com> - 2015-10-22 15:43 -0400
        Re: Forth and "embedded" enviroment jonjo <jjonethal@yahoo.de> - 2015-10-22 15:26 -0700
          Re: Forth and "embedded" enviroment rickman <gnuarm@gmail.com> - 2015-10-23 03:20 -0400
        namespace (was: Forth and "embedded" enviroment) kristoff <kristoff@skypro.be> - 2015-10-25 23:20 +0100
          Re: namespace Paul Rubin <no.email@nospam.invalid> - 2015-10-25 15:45 -0700
            Re: namespace kristoff <kristoff@skypro.be> - 2015-10-25 23:53 +0100
              Re: namespace Paul Rubin <no.email@nospam.invalid> - 2015-10-25 16:18 -0700
                Re: namespace "Elizabeth D. Rather" <erather@forth.com> - 2015-10-25 14:01 -1000
                Re: namespace Paul Rubin <no.email@nospam.invalid> - 2015-10-25 17:40 -0700
          Re: namespace "Elizabeth D. Rather" <erather@forth.com> - 2015-10-25 12:50 -1000
            Re: namespace kristoff Bonne <kristoff@skypro.be> - 2015-10-26 00:11 +0100
              Re: namespace "Elizabeth D. Rather" <erather@forth.com> - 2015-10-25 14:10 -1000
                Re: namespace kristoff <kristoff@skypro.be> - 2015-11-03 23:11 +0100
                Re: namespace "Elizabeth D. Rather" <erather@forth.com> - 2015-11-03 16:17 -1000
                Re: namespace kristoff <kristoff@skypro.be> - 2015-11-07 17:56 +0100
          Re: namespace (was: Forth and "embedded" enviroment) hughaguilar96@gmail.com - 2015-10-25 16:31 -0700
          Re: namespace (was: Forth and "embedded" enviroment) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-10-26 11:23 +0000
        Re: Forth and "embedded" enviroment kristoff <kristoff@skypro.be> - 2015-11-03 12:16 +0100
          Re: Forth and "embedded" enviroment rickman <gnuarm@gmail.com> - 2015-11-03 11:12 -0500
            Re: Forth and "embedded" enviroment kristoff <kristoff@skypro.be> - 2015-11-04 14:06 +0100
              Re: Forth and "embedded" enviroment rickman <gnuarm@gmail.com> - 2015-11-04 09:29 -0500
  Re: Forth and "embedded" enviroment Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-10-22 11:13 +0200
    Re: Forth and "embedded" enviroment kristoff <kristoff@skypro.be> - 2015-10-22 15:54 +0200
      Re: Forth and "embedded" enviroment Matthias Koch <matthias.koch@hot.uni-hannover.de> - 2015-10-22 16:42 +0200

csiph-web