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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: CAEN V965 driver
From: Till Straumann <[email protected]>
To: "Szalata, Zenon M." <[email protected]>
Cc: EPICS Techtalk <[email protected]>
Date: Thu, 20 Nov 2008 11:51:22 -0800
Kate Feng wrote:
Szalata, Zenon M. wrote:
I need a device driver for the CAEN V965 module, which works with vxWorks 6.x. Here at SLAC we have a device driver for this module which works with rtems only.

Thanks,
Zen

Is the driver written for EPICS 3.14.x ? If so, it should be
easy to port it to vxWorks.  It is a good idea to write a driver
for multiple platforms.  The "Application Developer's Guide"
provides a good guideline.

1) For the src/Makefile :
Copy the existing Makefile to Makefile.RTEMS.  For the vxworks
Makefile, change "PROD_IOC_RTEMS" to "PROD_IOC_vxWorks"
and take out all the RTEMS related include path.

2) For the source code under src/ :
vxworks access the I/O register via a  pointer to the address.
For example : for the long data access, which is four bytes, it does:
   volatile epicsUInt32 *reg;
    epicsUInt32 value;

reg = (volatile epicsUInt32 *) io_address ;

My 2 cents:


Accessing device registers this way is bad practice.

a) it is not obvious where I/O is done. Makes porting this code e.g., to
    a CPU of different endianness much more cumbersome.

b) may not synchronize I/O properly; modern CPUs may reorder
    instruction execution and need special instructions to enforce
    in-order execution of critical code sequences.

Both issues are addressed by the RTEMS inline routines in io.h and
byteorder.h

It certainly would be great to have equivalent functionality available
in EPICS/OSI.

For now, you'll have to find out what vxWorks provides in this area
or ultimately code it yourself.

However, I suggest you *always* perform register access by means
of a macro or inline routine for sake of portability and ease of
maintenance.

-- Till
*reg = value;

while RTEMS  accesses  the I/O register via the command in_be32(  ) or
in_le32().

You can reference "synAppsRTEMS"  source code at the web site :
http://www.nsls.bnl.gov/facility/expsys/software/EPICS/
The software is meant to be ported for both RTEMS and vxWorks.

Cheers,
Kate




Replies:
Re: CAEN V965 driver Kate Feng
Re: CAEN V965 driver Kate Feng
References:
CAEN V965 driver Szalata, Zenon M.
Re: CAEN V965 driver Kate Feng

Navigate by Date:
Prev: Re: CAEN V965 driver Kate Feng
Next: Re: CAEN V965 driver Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: CAEN V965 driver Kate Feng
Next: Re: CAEN V965 driver Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·