Hello,
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?
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.
We are using a Motorola MVME5100 cpu.
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.
while(((*statadr&CSR_ARM) !=0) &&
waitcount < WAITLIM)waitcount++;
if( waitcount < WAITLIM )
{
/* set dac value
and rearm */
card->pMem->Data[signal]=val;
*statadr
|=CSR_ARM;
}
The manual says:
“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.”
The problem seems to be that the ARM stays high far longer
than seems reasonable, as the count rate indicates.
The initialization in st.cmd is:
Hy8402Configure(1,1,0,0,0,0,0,0)
Hy8402Configure(2,1,1,0,0,0,0,0)
Any suggestions?
Coles Sibley
SNS – ORNL
Controls Hardware Engineer
865-241-8055
[email protected]