GavinNY
Posts: 29
Joined: Thu Dec 22, 2011 1:03 am

RISC OS and GPIO (again)

Sun Oct 06, 2013 11:51 pm

I bought a Pi when they first came out and then life got in the way before I had some serious play time with it! I'm hoping to change that and I'm interested in the GPIO pins and what I can do with them with sensors and so on. I know there's lots of info out there but I'm hoping to use my OS of choice (RISC OS). Yes, I've read through relevant posts on this forum and the ROOL forums and I understand that Tank has a GPIO module, which is awesome news.

I guess my question (I'm getting there, promise) boils down to: if I use RISC OS to access the GPIO pins, am I restricted compared to, say, Raspbian? I don't mean in general OS terms but in terms of addressing the pins, what I can do with them etc. Be gentle - I realise this probably sounds like a dumb question.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 12:21 am

As far as I know there is no limitation on what you can do with the GPIO pins on the RPi under RISC OS.

I think that there is not yet support for SPi (other than as used for the SD Card), though if I remember correctly Tank is working on that.

So as long as you have his module you should be good to go. I know that I can do anything I want in RISC OS as far as GPIO goes. Of cource I use RISC OS as my primary OS, on my primary computer that is a Raspberry Pi.

If you do not mind my asking what programming language(s) are you intending to use???
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 12:28 am

Ok I guess that that limit does not exist any more.

Thank you, you got me to drag out my scope for a quick test, and having added SPi to those tested I can say that it does support SPi.

So to elaberate the GPIO module on the RPi supports:
GPIO
UART
MMC/SPi
and
I2C

And as far as I know that is all that there is to offer on the RPi header.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 10:17 am

DavidS wrote:Ok I guess that that limit does not exist any more.

Thank you, you got me to drag out my scope for a quick test, and having added SPi to those tested I can say that it does support SPi.

So to elaberate the GPIO module on the RPi supports:
GPIO
UART
MMC/SPi
and
I2C

And as far as I know that is all that there is to offer on the RPi header.
Thanks for checking that David, Sounds like I'll need to download a later version of Tank's GPIO module!

GavinNY
Posts: 29
Joined: Thu Dec 22, 2011 1:03 am

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 1:19 pm

Thanks David, that's great! So I guess there's no reason why we can't make use of the Gertboard from RISC OS?

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 1:21 pm

that you would have to ask someone else. I do not know what a gertboard is.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

GavinNY
Posts: 29
Joined: Thu Dec 22, 2011 1:03 am

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 2:03 pm

DavidS wrote:that you would have to ask someone else. I do not know what a gertboard is.
Okay, thanks anyway, hopefully someone else can answer that one (here's a link to Gertboard info with manual http://www.raspberrypi-spy.co.uk/2013/0 ... -on-board/)

Well, Gertboard or not, has anyone done anything cool with the GPIO pins on RISC OS?

tank
Posts: 64
Joined: Thu Dec 15, 2011 5:51 pm

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 6:29 pm

The GPIO module can access any of the GPIO pins on the Pi, including unconnected ones.
All of the IO pins brought out to the connectors can be configured as GPIO instead of the other uses mentioned (SPI, UART ETC).
This is 17 on a V1 Pi and 21 on a V2.
The gertboard can be used, but the ATMega will not be supported along with the PMW, unless you write the code yourself !
If you require any help, just ask...

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

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 6:56 pm

GavinNY wrote: Well, Gertboard or not, has anyone done anything cool with the GPIO pins on RISC OS?
Let's see. Right now I'm running a home electricity monitoring station via Risc OS, with realtime graphing and data capture options using the TX/RX pins.

I've also been driving a vintage BBC Buggy around via the GPIOs. There were just enough I/O pins to accommodate all the lines on the Buggy's IDC cable. And the Pi was able to reliably read/write chips at the other end of that 5 metre cable without any signal boosting at all - which I thought was pretty impressive.

Similarly, I've been driving some tiny radio-controlled cars via a hacked controller connected to the GPIOs.

And I'm just now playing with one of those yellow and black Maplin/OWI robot arms on a Risc OS Pi (same as the arm used in the Scutter project in Mag Pi). Technically it's a USB program but I'm also using a redundant hand controller to drive the arm through the GPIOs and out to the USB interface. That way I can control the arm via screen clicks or via pendant switches, whichever is most appropriate at the time.

If anyone wants to see the USB robot arm and the home energy system in operation, I'll be showing them at the London Risc OS show in a few weeks time, along with one or two other Pi projects.
http://www.riscoslondonshow.co.uk/index.php

I'll be putting details of all this stuff on the Riscy Robots site when I get it properly set up.
http://www.anfnildram.co.uk/
At the moment it's just a holding page - and programming gadgets is more fun than building websites so it may be a while before it's all online.
Last edited by neilf on Fri Oct 11, 2013 2:06 pm, edited 1 time in total.

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: RISC OS and GPIO (again)

Mon Oct 07, 2013 11:20 pm

Cool better than I. All I am doing with RPi GPIO on the RPI is using a simple resister Flash ADC through a 74HC244, in order to have a very simple 20MS/s DSO, on one RPi in RISC OS. This is due to some of the limits of my anolog Osciloscope.

On another RPi in RISC OS I am doing some video experiments using an external Propeller P8X32A and some SDRAM atached to the GPIO, and driving some servos on what will eventually become a PCB CNC.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

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

Re: RISC OS and GPIO (again)

Tue Oct 08, 2013 7:57 am

I started to convert the Gertboard demo programs into BASIC for RISC OS - http://www.raspberrypi.org/phpBB3/viewt ... 84#p218382 - but never finished the job as my SD card ate itself for the umpteenth time and I just didn't have the enthusiasm to go through another install. Besides, I'd reached the point where I needed to control PWM, and for that I needed to add the code to the !GPIO module in assembler as BASIC gives you centisecond control, which isn't fine enough. And as already mentioned somewhere or other, I'm not a programmer, so this would have been a bit of a stretch for me anyway.

The stuff that I wrote is still available at http://www.ronketti.org.uk/ - I've not tested it under the latest version of RISC OS, but it should probably be OK. If you look closely at the code, you'll see that my board was misrepresenting itself as a rev.2 board when it's actually a rev.1 - that bit of the code is well commented, so should be easy to undo the bodge.

GavinNY
Posts: 29
Joined: Thu Dec 22, 2011 1:03 am

Re: RISC OS and GPIO (again)

Tue Oct 08, 2013 1:58 pm

This is great, glad I'll be able to play with this stuff in RISC OS, thanks for your replies. I'm off to buy a Gertboard :)

GavinNY
Posts: 29
Joined: Thu Dec 22, 2011 1:03 am

Re: RISC OS and GPIO (again)

Sat Oct 12, 2013 12:31 am

Aaaaaaaaand conveniently, the latest issue of Drag n Drop magazine starts a new series called Using the GPIO.
http://www.dragdrop.co.uk

Return to “RISCOS”