ao write instructions work on pci-6289 after adding initialization of
authorFrank Mori Hess <fmhess@speakeasy.net>
Mon, 19 Dec 2005 01:32:17 +0000 (01:32 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Mon, 19 Dec 2005 01:32:17 +0000 (01:32 +0000)
AO_Calibration register (turns off grounding of ao reference).

comedi/drivers/ni_mio_common.c
comedi/drivers/ni_stc.h

index ee91a76e7470f9ca49aae7adaae4bbe99387be4d..defa3faa2d679b5b4226194c01486052a9eb7b97 100644 (file)
@@ -2083,7 +2083,9 @@ static int ni_ao_insn_write(comedi_device *dev,comedi_subdevice *s,
        devpriv->ao[chan] = data[0];
 
        if(boardtype.reg_type == ni_reg_m_series)
+       {
                ni_writew(data[0] ^ invert, M_Offset_DAC_Direct_Data(chan));
+       }
        else
                ni_writew(data[0] ^ invert,(chan)? DAC1_Direct_Data : DAC0_Direct_Data);
 
@@ -2422,12 +2424,17 @@ static int ni_ao_reset(comedi_device *dev,comedi_subdevice *s)
        devpriv->ao_cmd2=0;
        devpriv->ao_mode1=0;
        devpriv->ao_mode2=0;
-       devpriv->ao_mode3=0;
+       if(boardtype.reg_type == ni_reg_m_series)
+               devpriv->ao_mode3 = AO_Last_Gate_Disable;
+       else
+               devpriv->ao_mode3 = 0;
+       devpriv->stc_writew(dev, devpriv->ao_mode3, AO_Mode_3_Register);
        devpriv->ao_trigger_select=0;
        if(boardtype.reg_type & ni_reg_6xxx_mask){
                ao_win_out(0x3, AO_Immediate_671x);
                ao_win_out(CLEAR_WG, AO_Misc_611x);
        }
+       devpriv->stc_writew(dev, AO_Configuration_End, Joint_Reset_Register);
 
        return 0;
 }
@@ -2928,6 +2935,7 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it)
                        ni_writeb(0xf, M_Offset_AO_Waveform_Order(channel));
                        ni_writeb(0x0, M_Offset_AO_Reference_Attenuation(channel));
                }
+               ni_writeb(0x0, M_Offset_AO_Calibration);
        }
 
        printk("\n");
index 2b00b2c4ad6c1499f4379ff454b96eee73042d1c..588588eafdfbfbf86b9c03406529f62e90e3f450 100644 (file)
@@ -438,6 +438,7 @@ enum AO_Personal_Bits
        AO_AOFREQ_Polarity = 1 << 9,    /* M Series: reserved */
        AO_FIFO_Enable = 1 << 10,
        AO_TMRDACWR_Pulse_Width = 1 << 12,
+       AO_Number_Of_DAC_Packages = 1 << 14,    // 1 for "single" mode, 0 for "dual"
 };
 #define Write_Strobe_0_Register                82
 #define Write_Strobe_1_Register                83