pointyhat
Posts: 1
Joined: Fri Nov 09, 2012 10:21 am

Accessing GPIO pins from RISC OS BBC BASIC

Fri Nov 09, 2012 10:31 am

Before I go and splash out any cash, does anyone know if you can access the GPIO pins on a Raspberry Pi via BBC BASIC via RISC OS?

I have fond memories of having various things hanging out of the back of an A3000 with user port podule and would like to do the same thing again :)

I remember doing the following from CLI to turn everything on - similar thing with BBC BASIC except loading the registers via a procedure that called an inline assembler function :).

*FX 150, &61, &FF

NigelJK
Posts: 65
Joined: Wed Sep 05, 2012 1:44 pm

Re: Accessing GPIO bins from RISC OS BBC BASIC

Fri Nov 09, 2012 1:34 pm

Have a read of this topic, it shows 'how to'. http://www.raspberrypi.org/phpBB3/viewt ... 3&start=50
Strictly speaking these sorts of things should go in the 'programming->other' forum (at least so the BBCBasic thread gets bumped ;)

neilf
Posts: 72
Joined: Sun Nov 11, 2012 8:14 am

Re: Accessing GPIO bins from RISC OS BBC BASIC

Wed Nov 21, 2012 10:31 am

Before I go and splash out any cash, does anyone know if you can access the GPIO pins on a Raspberry Pi via BBC BASIC via RISC OS?
See thread at:
https://www.riscosopen.org/forum/forums/5/topics/1445

nr.
Posts: 144
Joined: Wed Oct 03, 2012 8:51 am
Location: The Fens
Contact: Website

Re: Accessing GPIO bins from RISC OS BBC BASIC

Wed Nov 21, 2012 11:18 am

Yup - I've been busy playing with just this over the past couple of days. Take a quick look at http://www.raspberrypi.org/phpBB3/viewt ... 42&t=23384 for an example. In this instance I'm using the GPIO pins to drive a gertboard, but that's incidental really.

I'm conscious of the fact that this information seems to be getting spread out over a number of sites, and threads within those sites. I'll have a look and see if there's a handywiki available where I can start to consolidate some of this stuff. Unless someone has already started on it that is :)

Ta,
--
nr.

doglitbug
Posts: 7
Joined: Sat Sep 03, 2011 9:18 am

Re: Accessing GPIO bins from RISC OS BBC BASIC

Sun Jun 16, 2013 10:50 am

Let me know if you find a wiki. I would love to have a place for RISC OS information but purely for the raspberry pi distribution(up to date PRMs, tutorials etc) but I don't think such a project exists yet :-(

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 10717
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Accessing GPIO pins from RISC OS BBC BASIC

Sun Jun 16, 2013 10:51 am

http://elinux.org/RaspberryPiBoard
not specific for RiscOS though.

grizzler
Posts: 14
Joined: Wed May 29, 2013 6:24 pm

Re: Accessing GPIO pins from RISC OS BBC BASIC

Sun Jun 16, 2013 11:20 am

The RISC OS Open wiki has sections on the PRMs and the Raspberry Pi.

https://www.riscosopen.org/wiki/

The Introduction page also has links to other sites with possibly useful info.

AMcS
Posts: 184
Joined: Sun Jan 06, 2013 11:23 am
Location: Dublin, Ireland

Re: Accessing GPIO bins from RISC OS BBC BASIC

Sun Jun 16, 2013 11:25 am

doglitbug wrote:Let me know if you find a wiki. I would love to have a place for RISC OS information but purely for the raspberry pi distribution(up to date PRMs, tutorials etc) but I don't think such a project exists yet :-(
To a large extent that's true, there are "snippets" of information here and there. The PRM's distributed in the Pi RISC OS image go back to RISC OS 3.xx so are not quite up to date but do give useful pointers and get across key concepts in RISC OS - but then miss out entirely on the new hardware abstraction layer and the 32 bit stuff.

A good (alternative) way to start is by looking at the "online" PRM wiki run by RISC OS Open - it isn't entirely complete but is more up to date than the PDF PRMs in the Pi image. (Link to the online wiki is - https://www.riscosopen.org/wiki/documen ... %20Manuals).

The RaspberryPi RISC OS distribution (RISC OS 5.19 RC8) is very similar to a normal RISC OS 5.xx distribution - the hardware is "abstracted" away by the HAL - and all the other stuff (largely) is like what you get on other RISC OS 5 computers - like the Iyonix. Now there are differences (Iyonix has PCI, a real-time clock/non-volatile RAM etc.,) - while the PI doesn't but for most common activities they're the same.

The online PRM wiki is probably the closest to the a "unified" PRM resource - but you'll still need to refer back to the paper/PDF version for some extended explanations or where parts are not yet completed in the online resource.

Hope that helps !

gastorro
Posts: 2
Joined: Mon Feb 19, 2018 1:22 am

Re: Accessing GPIO pins from RISC OS BBC BASIC

Tue Feb 20, 2018 5:23 pm

That's exactly what I'm looking for :
How to control the GPIO pins of my Raspberry Pi 3 Model B from a 'BBC BASIC'/(in 'RISC OS Pico image' or 'RISC OS Pi image') program.

For example, here's how to blink the green LED on the RPi3 board with the other implementation of BASIC ( the IchigoJam BASIC ),
10 LED 1
20 WAIT 30
30 LED 0
40 WAIT 30
50 GOTO 10

The code for that ^^ LED function was obviously re-written (probably in C or assembly) by someone,
to match the specifics of this (Raspberry) board (Thank you btw!)
But this ^ ported version of the IchigoJam BASIC offers only 1KB of program space.. So I prefer RISC OS' BBC BASIC
_________

So how do I blink the green LED in BBC BASIC ? ( for starter..)

Return to “RISCOS”

Who is online

Users browsing this forum: No registered users and 1 guest