From: Frank Mori Hess Date: Mon, 19 Dec 2005 01:32:17 +0000 (+0000) Subject: ao write instructions work on pci-6289 after adding initialization of X-Git-Tag: r0_7_71~97 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5176bba3c6b94f2019661f3ceb6c44866d94db2d;p=comedi.git ao write instructions work on pci-6289 after adding initialization of AO_Calibration register (turns off grounding of ao reference). --- diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index ee91a76e..defa3faa 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -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"); diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index 2b00b2c4..588588ea 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -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