EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Re. installation of EPICS for beam position measurement using Raspberrypi
From: Keith Parker <[email protected]>
To: Phil Atkin <[email protected]>
Cc: [email protected]
Date: Thu, 11 Feb 2016 15:06:18 -0800
The Raspberry Pi (RasPi) is a good teaching/learning tool due to the massive discussions around the world.

------------------------------------------
http://www.raspberrypi.org/products/raspberry-pi-2-model-b/

900MHz quad-core ARM Cortex-A7 CPU
1GB RAM 
Micro SD card slot
1x 40-pin header
------------------------------------------

However, the BeagleBone Black (BBB) is, IMHO, far superior for hard real-time applications.
    (even though the schematic and the BOM show an AM3358B, whatever)

AM3358BZCZ100,  1GHz ARM Cortex-A8 CPU
512MB DDR3 RAM
4GB 8-bit eMMC on-board flash storage (boots MUCH faster)
2x 46-pin headers (many more I/O pins)
2x PRU 32-bit microcontrollers (on-chip real-time co-processors)
------------------------------------------

The primary factor in the BBB superiority for hard real-time applications is the fact that
it has two (2) PRUs (Programmable Real-time Units); these are on-chip real-time co-processors
that communicate with the ARM Cortex-A8 via shared memory and cross-coupled interrupts,
along with on-chip speed access to the on-chip I/O sections.
For hard real-time IOC applications, the 2x RPUs of the BBB are FAR MORE VALUABLE
than the extra RAM and quad-cores of the RasPi.

The pair of PRUs can be programmed as dedicated interrupt handlers and hardware bit-bangers,
almost completely isolated from the multi-user timing of Linux running on the ARM Cortex-A8.

Of course, you can use the RTEMS (Real-Time Executive for Multiprocessor Systems),
however, native-compiling is so much easier for development and long-term support,
if, with the 2x PRUs, Linux on the ARM Cortex-A8 can get the job done.

For an EPICS IOC (Input Output Controller) application do not use the LCD/HDMI
and you will get twenty (20) additional I/O pins (real handy for parallel I/O chips).
The BBB has 2x 46-pin headers; for an EPICS IOC, the more I/O pins the better.

Also, the BBB development is easier because it uses a USB virtual Ethernet adapter
instead of a serial port dongle with the RasPI.
Another also, because the BBB has a single core ARM Cortex-A8, it draws less than 0.5 Amps
from the USB virtual Ethernet adapter port, so you do NOT need a separate power supply.

Your laptop, a BBB, and a USB cable (that comes with the BBB),
is all you need for software development (no power supply or serial port dongle required).

When you want to remotely access your BBB based IOC,just use Ethernet
and change the IP address to what your router provides the BBB via DHCP.
It is helpful to configure your router DHCP to assign IP addresses based on MAC addresses.

For the application under discussion, four (4) AD7622 16-bit ADCs at two (2) MSPS,
the BBB, with its 1GHz Cortex-A8 and its pair of PRUs handling interrupts and buffering,
supported by an CPLD (Complex Programmable Logic Device) doing ADC data multiplexing
and synchronization glue logic, will probably get the job done.

Thanks,
Keith W. Parker <[email protected]>

=============================================================
On Wed, Feb 10, 2016 at 10:28 AM, Phil Atkin <[email protected]> wrote:
You can improve the reliability of transfers through SPI by using a hardware FIFO - although of course it would increase the latency.  However, if you need to run all 4 ADCs at 2MSPS continuously, you'd need to transfer at 128 MBits/second, and that isn't going to be possible on the RPi.

Phil


On 10/02/2016 17:59, Henrique Almeida wrote:


Em 10/02/2016 14:05, "vivek singh" <[email protected]> escreveu:
>
> Hello,
>
> I want to use EPICS in my raspberry pi for beam position measurement.  I will be using 4 16-bit ADC's for digitizing the output of the pickup electrodes. The ADC's support serial and parallel interfaces.  Since the Pi does not have that many GPIOs, I will be using Serial Interface to get the data.  I have a few questions regarding that.
>
> 1. The ADC (AD7622) supports 2MSPS.  I wrote a python code to toggle a GPIO pin on a loop after some calculations and the maximum switching frequency I could observe in the
>     Oscilloscope was 500kHz.  Is that the maximum speed I can achieve using PI ?

If you need to acquire at 2 MSPS without skipping data, the Raspberry PI GPIO is unsuitable for that, since you won't be able to reliably acquire due to the OS and the hardware interrupts. I'm assuming however that you don't need all the data. In this case it doesn't really matter what's the maximum speed, you'll have up to 10~100 ms of "blind" moments, when you don't acquire any data while your application is preempted.

If you need any kind of number, a GPIO read reaches 10 MHz. See, for example:

https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=26907

>
> 2. The Pi has a dedicated SPI interface, so what is the maximum speed that can be achieved using it ?

It may reach 32 Mbps. See:

http://elinux.org/RPi_SPI

>
> Another query I had, was regarding multicore processing capability of the Pi.  
>
> 3. Is it possible to control individual cores, so that they can each perform one task that I assign to them, at their maximum capacity ?

If you're running standard linux, then your tasks will always share and be interrupted by other parts of the OS. You can still move each task to a different core by setting the process affinity or using cpusets. See:

http://man7.org/linux/man-pages/man7/cpuset.7.html

>
>
> Any other suggestions you have regarding this setup would be very

You should be doing this on a microcontroller without an OS that is able to stream the data to a PC, or a storage device. The Raspberry PI is not appropriate.

>
> Thank You,
>
>


--
Pixel Analytics is a limited company registered in England. Company number: 7747526; Registered office: 93A New Road, Haslingfield, Cambridge CB23 1LP


References:
Re. installation of EPICS for beam position measurement using Raspberrypi vivek singh
Re: Re. installation of EPICS for beam position measurement using Raspberrypi Henrique Almeida
Re: Re. installation of EPICS for beam position measurement using Raspberrypi Phil Atkin

Navigate by Date:
Prev: Modbus R2-8 available Mark Rivers
Next: std support countdown timer trigger PV and calcout record question Alireza Panna
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Re. installation of EPICS for beam position measurement using Raspberrypi Phil Atkin
Next: Congratulations to everyone at LIGO Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·