User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Sun Apr 15, 2018 7:01 am

Okay..... but that doesn't look very Forth, this thread is about Forth, and I'm using Forth! You could just as well talk about C or Python.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

8thdev
Posts: 24
Joined: Fri Jul 31, 2015 2:23 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Sun Apr 15, 2018 7:05 am

It is a Forth-derived language.

What is it about the sample I wrote which doesn't look like Forth to you? The "hw:" prefix on the GPIO words?

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Sun Apr 15, 2018 9:00 am

Any Forth aficionado knows you can define (almost) anything to do (almost) anything, but you are correct that it is not one of the standard Forth defining constructs. I just don't see how bringing another dialect into the equation continues the theme of this thread - other than to make readers aware that 8th exists, end of.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Hardware Interfacing

Sun Jun 17, 2018 11:50 am

Now moved to the hardware section: viewtopic.php?p=1330183#p1330183
Last edited by Z80 Refugee on Tue Jun 19, 2018 1:03 pm, edited 3 times in total.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
rpdom
Posts: 12649
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Sun Jun 17, 2018 12:13 pm

Z80 Refugee wrote:
Sun Jun 17, 2018 11:50 am
The diagrams below show the orientation and pin numbering for the old 26-pin (RPi models A and B) version and the 40-pin version used on all other models.
You should also note that on the original Pi B the 26-pin numbering was slightly different. Pins 3 and 5 were GPIO0 and GPIO1 (BCM), still with the 1K8 pull-ups and available for general use, and Pin 13 was GPIO21.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Sun Jun 17, 2018 8:30 pm

rpdom wrote:
Sun Jun 17, 2018 12:13 pm
You should also note that on the original Pi B the 26-pin numbering was slightly different. Pins 3 and 5 were GPIO0 and GPIO1 (BCM), still with the 1K8 pull-ups and available for general use, and Pin 13 was GPIO21.
Thanks for the alert. My research indicates the above only applies to the Rev 1 boards - Rev 2 use the scheme as shown in my diagram.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

Heater
Posts: 9468
Joined: Tue Jul 17, 2012 3:02 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Mon Jun 18, 2018 12:55 pm

Z80 Refugee,
...that it is not one of the standard Forth defining constructs. I just don't see how bringing another dialect into the equation continues the theme of this thread
That is the beauty of Forth. There is no standard, there are so many dialects, none of them compatible, none of them intelligible.

User avatar
scruss
Posts: 1722
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Fri Jun 29, 2018 1:04 am

Z80 Refugee wrote:
Sun Mar 11, 2018 3:14 pm
This article is for people familiar with the Forth programming language but unfamiliar with using a Raspberry Pi,
I shared it with the FORTH PROGRAMMING LANGUAGE 21st CENTURY group on Facebook, and they rather liked it — so thanks! Someone even got it running on an OrangePi …
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Th

Fri Jun 29, 2018 10:02 am

Good to know, thanks.

It's definitely handy (for somebody used to Forth) to have an easy way to get signals into the real world (ie with an RPi). I used to use the Centronics printer port on PCs (before they went USB) for I/O, and Win98 was the last (MS) OS to allow unfettered access to the hardware from user code.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Sat Jul 07, 2018 7:11 am

A video demonstrating the instructions in Post 1 has been posted on YouTube by Peter Forth:

https://youtube.com/watch?v=UBJegHVCPQQ
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

PeterForth
Posts: 1
Joined: Mon Jul 16, 2018 4:18 pm

Re: Accessing GPIO I/O Pins from Forth, and How to Use Them

Mon Jul 16, 2018 4:38 pm

Z80 Refugee wrote:
Sat Jul 07, 2018 7:11 am
A video demonstrating the instructions in Post 1 has been posted on YouTube by Peter Forth:

https://youtube.com/watch?v=UBJegHVCPQQ
All my gratitude for Z80-refugee, I said this to him in private , but I want to make it public. He did a **Brilliant** post, about GPIO, that let me test the communication of the PI in Forth in no time and without any troubles ! This is remarkable in those days we are living, what "in our time " accostumed to be the norm , now is a miracle !

And also my sincere thanks to "scruss" that shared this article on the FB - FORTH PROGRAMMING LANGUAGE 21st CENTURY , and lighted my way. I will try to add in the near future some more experiments with the RPI and Forth videos for those who want to use or learn this fantastic programming language.

Return to “Other programming languages”

Who is online

Users browsing this forum: No registered users and 5 guests