From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading DAQCard 6036E EEPROM returns 0's

I'm trying to read the calibration values from the DAQCard 6036E EEPROM on a WinCE 4.1 device.
I have worked with source code posted in "Reading/Writing to EEPROM & CalDac's" (included below) but it it returns zeros. I get the same result when trying the same code on a AI-16XE-50 card.

Any help would be appreciated,

Andreas

**********************
u8 thisbit;
u16 writevalue;
int index;

//Bar1 = bus->createAddressSpace(kPCI_BAR1);
//board = new tESeries(Bar1);

// Instruction: Single Read EEPROM: 0x03
// Address: 508 (0x1FC), factory year calibration
// Because adress is greater then 0xFF use 0x08 as a modifier of the instruction byte
// Upper byte is command plus address modifier, lower byte is lowest 8-bits of address
// EEPROM bit stream to write: 0000 1011 1111 1100

// writevalue = 0x0bfc; // Address: 508 - year factory calibration
// writevalue = 0x0bfb; // Address: 507 - month factory calibration
// writevalue = 0x0bfa; // Address: 506 - day factory calibration

// writevalue = 0x0bff; // Address: 511 - LSB board code
// writevalue = 0x0bfe; // Address: 510 - board revision
// writevalue = 0x0bfd; // Address: 509 - board subrevision
// writevalue = 0x0bda; // Address: 474 - MSB board code for some cards

// Serial Register
// 0x1 - clock
// 0x2 - data
// 0x4 - chip select - enable EEPROM communciation

// double write all communication to the serial interface/EEPROM

int address = 508; // year factory calibration

if (address > 0xff)
writevalue = 0x0b00 + (address & 0xff);
else
writevalue = 0x0300 + (address & 0xff);

// 0x4 - chip select - enable EEPROM communciation
board->SerialCommandRegister.writeRegister(0x00);
board->SerialCommandRegister.writeRegister(0x00);
board->SerialCommandRegister.writeRegister(0x04);
board->SerialCommandRegister.writeRegister(0x04);

// SerData = address LOC (469,467, 465, 463) to access on EEPROM.
// writevalue = modified address location to access.
for (index = 15; index >= 0; index--)
{// 0
thisbit = ((writevalue >> index) & 0x01) * 0x02;
board->SerialCommandRegister.writeRegister(0x04 + thisbit); // set data bit
board->SerialCommandRegister.writeRegister(0x04 + thisbit);
board->SerialCommandRegister.writeRegister(0x04 + thisbit + 0x1); // set data bit and clock
board->SerialCommandRegister.writeRegister(0x04 + thisbit + 0x1);
board->SerialCommandRegister.writeRegister(0x04);
board->SerialCommandRegister.writeRegister(0x04);
}

int myvalue = 0;
// read back PROMOUT (D7-D0) 8-bit result.
for (index = 7; index >= 0; index--)
{
// read bit
board->SerialCommandRegister.writeRegister(0x04); // set clock low
board->SerialCommandRegister.writeRegister(0x04);
board->SerialCommandRegister.writeRegister(0x04 + 0x1); // set clock high
board->SerialCommandRegister.writeRegister(0x04 + 0x1);
thisbit = board->SerialStatus.readEEPROMOut(); // read data bit
thisbit &= 0x1;
myvalue |= thisbit << index;

printf("thisbit[%d] = %d\n",index,thisbit);

}

printf("eeprom value = %d\n",myvalue);
}"
0 Kudos
Message 1 of 3
(7,519 Views)
Andreas,

Are you able to communicate at all with the DAQCard? i.e. can you successfullly read and write other registers on the card? What physical platform are you using with the DAQCard? PDA? What development environment are you using?

Christian L
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 2 of 3
(7,518 Views)
I am able to communicate with the card. I am using NI's DDK for windows CE and I can run the examples fine. I believe it is all registry level programming so it reading and writing to registries seem to work.
I am using a development platform from Inhand electronics running windows CE 4.1 on Intel's PXA255. And I'm using EVC4.0 platform builder 4.1 for devloping.

Andreas
0 Kudos
Message 3 of 3
(7,518 Views)