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


Groups > comp.sys.acorn.programmer > #5839

Re: Using GPIO

Subject Re: Using GPIO
Newsgroups comp.sys.acorn.programmer
From Alan Adams <alan@adamshome.org.uk>
Date 2019-10-02 21:40 +0100
Message-ID <d4c8d1fc57.Alan.Adams@ArmX6.adamshome.org.uk> (permalink)
References <570d0efa57.Alan.Adams@ArmX6.adamshome.org.uk> <20e4dedf-b9f9-4630-9b74-e2eec33bbd12@googlegroups.com>
Organization Orpheus Internet Services

Show all headers | View raw


Hi

Thanks for the reply. Comments interleaved below.

In message <20e4dedf-b9f9-4630-9b74-e2eec33bbd12@googlegroups.com>
          sales@elesar.co.uk wrote:

> On Friday, 27 September 2019 12:50:17 UTC+1, Alan Adams  wrote:
>> Does anyone here understand the documentation for the GPIO module? I'm
>> completely confused. There was a module (pre 2017 it seems) with a host of
>> SWIs which were more or less descriptive. The replacement seems to only
>> have about ten SWIs and I can't make out from the only documentation (a
>> StrongHelp file) which ones would do what I need.

<snip>

>> On an rpi, I need to enable two pins as inputs, causing an interrupt.
>> (Using a change of state event will not be fast enough, as that has to be
>> polled for).
>> 
>> I need to create a small module which will react to the interrupt, decide
>> which pin it was, and store the current clock time, then change a
>> pollword.  (I'm assuming here that servicing an interrupt requires a
>> module.)
>> 
>> I have the hardware manual, so I know the hardware is capable of this.
>> What I can't see is how the GPIO module helps. Maybe it doesn't... Ideally
>> it would already be capable of handling the interrupt for me, but I have
>> doubts about that.

> The GPIO module doesn't currently despatch interrupts, you'd have to do
> that yourself. The GPIO SWIs also have the disadvantage that they're
> single bit wide, so tend to result in lots of very verbose code.
> Underneath the GPIO module is the GPIO HAL interface - that's 32b port
> wide which makes manipulating several bits at once much easier.

So would it be feasible to use the HAL interface? Is it documented 
anywhere?

The alternative would seem to be to use the GPIO module to set the 
registers up, then access the hardware directly when an interrupt 
occurred.

(The third alternative is not to use a pi, but build some dedicated 
hardware, which isn't as much of a step as it might seem.

BTW does the gpio clock pulse output slow down when the throttling takes 
place?

> It's definitely possible to service interrupts, our parallel port HAT
>   http://shop.elesar.co.uk/index.php?route=product/product&product_id=76

<snip>

> Recommend buying a reset button for your Pi, there will be plenty of
> crashes along the journey!
> Robert.

I'd forgotten the availability of a reset on board. I'm well aware of 
crashes with this sort of code. The VAX stuff was kernel-mode, so I had to 
write it, test it, and get it live during the Christmas shutdown. 
Restarting a VAX each time took around 10 minutes.

-- 
Alan Adams, from Northamptonshire
alan@adamshome.org.uk
http://www.nckc.org.uk/

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Using GPIO Alan Adams <alan@adamshome.org.uk> - 2019-09-27 12:49 +0100
  Re: Using GPIO sales@elesar.co.uk - 2019-10-02 13:17 -0700
    Re: Using GPIO Alan Adams <alan@adamshome.org.uk> - 2019-10-02 21:40 +0100
    Re: Using GPIO Alan Adams <alan@adamshome.org.uk> - 2019-10-05 16:19 +0100
      Re: Using GPIO sales@elesar.co.uk - 2019-10-12 13:15 -0700

csiph-web