EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Hytec DAC8402
From: Eric Bjorklund <[email protected]>
To: EPICS tech-talk <[email protected]>
Date: Thu, 16 Jun 2005 16:49:17 -0600
Coles,

Where does the DAC8402 reside in I/O space? We had a similar problem with a serial driver in A32 space a few years ago. As near as we could tell, the hardware was working fine, but the register data seemed like it was being cached (even though it looked like the mapping registers in the BSP were disabling caching for A32 space). Our fix was to insert a
cacheInvalidate (DATA_CACHE, (void *)statadr, 12);
call into the loop. We never really figured out whether this defeated the hardware cache, or just broke the loop out of the CPU instruction pipeline, but it worked.

You might try a bus-analyzer to see how many reads you really are issuing to the DAC.

Hope this helps...

-Eric Bj.

On Jun 16, 2005, at 10:47 AM, Sibley III, Coles wrote:

<x-tad-smaller>Hello,</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>We are using a Hytec DAC8402 at SNS for our beam loss monitor reference. The driver uses far too much CPU time when we update 8 dacs every 5 seconds. In fact it goes to 100% cpu usage. The offending code is below. We can fix the code but the question is why does it take so long to set 16 register?</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>The 8402 can be set to uses registers (for a typical dac application) or memory (for arbitrary waveforms). We need the typical dac configuration, not the arbitrary waveforms.</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>We are using a Motorola MVME5100 cpu.</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>The wait count goes to 600000 in our case, as if statadr was not declared as volatile or the 512K of memory is getting loaded, not just the 16 registers. Our WAITLIM has to be set to 1000000.</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>   while(((*statadr&CSR_ARM) !=0) && waitcount < WAITLIM)waitcount++;</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>    if( waitcount < WAITLIM )</x-tad-smaller>
<x-tad-smaller>    {</x-tad-smaller>
<x-tad-smaller>        /* set dac value and rearm  */</x-tad-smaller>
<x-tad-smaller>        card->pMem->Data[signal]=val;</x-tad-smaller>
<x-tad-smaller>        *statadr |=CSR_ARM;</x-tad-smaller>
<x-tad-smaller>    }</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>The manual says:</x-tad-smaller>
<x-tad-smaller>“</x-tad-smaller>
<x-tad-bigger>While the unit is ARMed the DACs are constantly refreshed with the contents of the registers which can be changed during this time. There is a delay which is fixed of approximately 32us after ARM is set, before all the outputs change together.”</x-tad-bigger>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>The problem seems to be that the ARM stays high far longer than seems reasonable, as the count rate indicates.</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>The initialization in st.cmd is:</x-tad-smaller>
<x-tad-smaller>Hy8402Configure(1,1,0,0,0,0,0,0)</x-tad-smaller>
<x-tad-smaller>Hy8402Configure(2,1,1,0,0,0,0,0)</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>Any suggestions?</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>
<x-tad-smaller>Coles Sibley</x-tad-smaller>
<x-tad-smaller>SNS – ORNL</x-tad-smaller>
<x-tad-smaller>Controls Hardware Engineer</x-tad-smaller>
<x-tad-smaller>865-241-8055</x-tad-smaller>
<x-tad-smaller>[email protected]</x-tad-smaller>
<x-tad-smaller> </x-tad-smaller>



<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Eric Björklund
Los Alamos Neutron Science Center (LANSCE)

phone: 505-667-6031 email: [email protected]
<><><><><><><><><><><><><><><><><><><><><><><><><><><><>
TSPA :: DUSA=ADTO


Replies:
Hytec DAC8402 DAC Register Write Problem Darrell Nineham
References:
Hytec DAC8402 Sibley III, Coles

Navigate by Date:
Prev: Hytec DAC8402 Sibley III, Coles
Next: RE: Hytec DAC8402 Sibley III, Coles
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Hytec DAC8402 Sibley III, Coles
Next: Hytec DAC8402 DAC Register Write Problem Darrell Nineham
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  <20052006  2007  2008  2009  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 ·