Hooking the shield up to an Arduino and establishing communication went totally smooth until I tried to read the DEVID register. My code
const int slaveSelectPin = 10;
// Config SPI interface
pinMode (slaveSelectPin, OUTPUT);
digitalWrite(slaveSelectPin,HIGH);
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV2);
SPI.setDataMode(SPI_MODE0);
SPI.setBitOrder(MSBFIRST) ;
word result = 0;
byte read1 = 0;
byte read2 = 0;
digitalWrite(slaveSelectPin,LOW);
// send the address and return value via SPI:
SPI.transfer( (address << 0x01) | PIXI_READ );
read1 = SPI.transfer(0x00);
read2 = SPI.transfer(0x00);
digitalWrite(slaveSelectPin,HIGH);
result = (read1 << 8) + read2;
returned 0x0424 instead of 0x0024 as specified in the datasheet.The only reason I can think of is, that my engineering samples have a different ID to make them distinguishable from production parts.Everything else seems to work as documented and after setting up 1 DAC and 1 ADC I was able to output and read back analog voltages in 4096 steps in voltage ranges from 0V to +2.5V and 0V to 10V.
Overall a promissing start.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.