Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Device::BCM2835, hardware access on a pi, SIGSEGV

by hardburn (Abbot)
on Aug 25, 2014 at 18:02 UTC ( #1098545=note: print w/replies, xml ) Need Help??

in reply to Device::BCM2835, hardware access on a pi, SIGSEGV

I'd warn you that using a Linux distro on an Rpi won't be able to make anything like hard real-time guarantees. A log write in another process could hang yours for a noticeable time.

You may want to look at Arduino or raw AVR programming instead, or possibly an RTOS on the Pi.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

  • Comment on Re: Device::BCM2835, hardware access on a pi, SIGSEGV

Replies are listed 'Best First'.
Re^2: Device::BCM2835, hardware access on a pi, SIGSEGV
by Peterpion (Acolyte) on Aug 26, 2014 at 13:27 UTC

    Thanks - I do realise the pi & raspian is not 'real time' and I will get glitches - which I am observing, exactly as you say, when log files are written mostly. My hardware responds to pulsed signals and has a time constant of around 20 pulses before it flips state, so the idea is to smooth out the glitches with the hardware slow response. The reason to pulse the output of the micro is to do my best to make sure the hardware does not crash in a logic high state which would destroy the things its controlling within a few seconds (mainly a marine reef tank chemical addition pumps). The use of pulses which are converted in hardware to on / off controls seems to me to greatly reduce the chance of a software caused 'fail to on state' (thats the idea anyway!). My hardware requires a specific frequency for several pulses before it will turn on - higher or lower frequency will not cause the change.

    Im really interested in the PIC approach but have zero experience with it - I had to look up what a AVR is - I guess youre implying that its real time capable which is interesting. But the gear and work involved in starting out seems significant whereas the pi and linux is comfortable territory for me hence the current project. But I might spend a bit of time today looking into the most simple way to start out in that area with the most basic setup.

    Thanks, Pete

      If you're interested in AVRs, Arduino might be the best place to start. It's around $10 for a Nano version, which can do a lot, and you'll only need to add a USB cable to get started. The libraries are technically C++, but they tend to hide the complexities of the language until you get really deep into it.

      Raw AVRs are more verbose, but have the advantage that you can use a single chip for buck or two. You can get programmers for around $15-30.

      They're not necessarily hard real time systems, with a bunch of rigorous guarantees about latency. But as microcontrollers, nothing is running except your code, which is usually good enough.

      "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

        Thanks - I ordered a few bits and pieces last night actually! Got a very cheap programmer, handful of avrs, breadboard etc, and I will have a tinker when I get a chance. I decided to get the bare chip because it dosent seem much harder to put the bootloader on yourself from what I read yesterday and its cheaper for multiple chips so if I break them when breadboarding I wont be too annoyed. One thing I noticed though was that adding network support seems tricky / has reliability problems (what with the IRQs required etc) so I wonder for a network attached control and monitoring device, perhaps the pi is still the better way to go? Would be interested in opinions.

        Thanks, Pete

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1098545]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2019-10-20 17:51 GMT
Find Nodes?
    Voting Booth?