Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-6036e calibration.

Hello, 

 

I am trying to calibrate the NI-6036e card externally using an example code that was posted on this forum in another thread. Of the two parts to this code, the readEEPROM bit is working fine. Can some one please advise as to what needs to be updated in the following code that is used to write to the CalDAC:

 

/*********************************************************************

Serial DAC Write for 6036E

*********************************************************************/
int sDacWrite(i16 dac_number, i32 value)
{

i16 length=8;
i16 index;
u8 thisbit;
u16 bitMask;


printf("dac_number = 0x%x\n", dac_number);
printf("value = 0x%x\n", value);

/* Write out CalDac value. */
/* a0 a1 a2 a3 d7 d6 d5 d4 d3 d2 d1 d0 */
//value &= 0xFF;
//value |= dac_number << 8;
//length = 12;
//printf("value1 = 0x%x\n",value);



/* Initially Clock is low. */
/* Clear Clock and calDAC load signals. */
/* make sure EPROM CS is clear */
board->SerialCommandRegister.writeRegister(0x0);
board->SerialCommandRegister.writeRegister(0x0);

/* Write A0-A3 , send each bit with clk */
for(index=0;index <=3;index++)
{

thisbit = ((dac_number >> index) & 0x01);
printf("A[%d] = 0x%x\n",index, thisbit);

// clock SerClk & SerData(data to send)
board->SerialCommandRegister.writeRegister(0x01 + thisbit);
board->SerialCommandRegister.writeRegister(0x01 + thisbit);

// clock SerClk low
board->SerialCommandRegister.writeRegister(0x00 + thisbit);
board->SerialCommandRegister.writeRegister(0x00 + thisbit);

}


/* Write D7-D0, send each bit with clk */
/* Not sure here?????? */
for(index=length-1;index>=0;index--)
{
thisbit = ((value >> index) & 0x01);
printf("D[%d] = 0x%x\n",index,thisbit);

// clock SerClk & SerData(data to send)
board->SerialCommandRegister.writeRegister(0x01 + thisbit);
board->SerialCommandRegister.writeRegister(0x01 + thisbit);

// clock SerClk low
board->SerialCommandRegister.writeRegister(0x00 + thisbit);
board->SerialCommandRegister.writeRegister(0x00 + thisbit);

//thisbit >>=1;
}

/* Send appropriate load signal to update caldac. */
/* Timing diagram says to CLK/PULSE eack SerialDacLdxx */
/* Not sure here????? */

/* Pulse SerDacLd0 - 8 hex */
board->SerialCommandRegister.writeRegister(0x08);
board->SerialCommandRegister.writeRegister(0x08);
board->SerialCommandRegister.writeRegister(0x00);
board->SerialCommandRegister.writeRegister(0x00);

/* Pulse SerDacLd1 - 16 hex */
//board->SerialCommandRegister.writeRegister(0x10);
//board->SerialCommandRegister.writeRegister(0x10);
//board->SerialCommandRegister.writeRegister(0x0);
//board->SerialCommandRegister.writeRegister(0x0);

return 0;
}

====================================================

 

The original thread is here: http://forums.ni.com/t5/Multifunction-DAQ/Reading-Writing-to-EEPROM-CalDac-s/m-p/81768/highlight/fal...

 

Thanks.

 

Sudhir

 

0 Kudos
Message 1 of 2
(3,557 Views)

Hey Sudhir! I see you are trying to program your 6036e at the register level. I am attaching a manual that has information on all of the available registers. HOWEVER, I would like to add that programming these registers is not recommended in fact there is a disclaimer in the 6036e manual which I will also attach that states that National Instruments is not responsible for what happens to your product if you manipulate these registers. 

 

1. Registers

http://www.ni.com/pdf/manuals/341079b.pdf

 

2. Disclaimer (Appendix C, C-3)

http://www.ni.com/pdf/manuals/370503k.pdf

 

What is your end goal in trying to have this register level control?

0 Kudos
Message 2 of 2
(3,527 Views)