1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 <2005> 2006 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 <2005> 2006 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 |
<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>