I'm referencing this post to connect to an MCP3208 12-bit ADC. The linked post uses an MCP3008, which is only a 10-bit ADC, so sending/receiving SPI data is slightly different. Here is the 10-bit code: Code: mcp3008Spi a2d("/dev/spidev0.0", SPI_MODE_0, 1000000, 8); int a2dVal = 0; int a2dChannel = 0; unsigned char data; data = 1; // first byte transmitted -> start bit data = 0b10000000 |( ((a2dChannel & 7) << 4)); // second byte transmitted -> (SGL/DIF = 1, D2=D1=D0=0) data = 0; // third byte transmitted....don't care a2d.spiWriteRead(data, sizeof(data) ); a2dVal = 0; a2dVal = (data<< 8) & 0b1100000000; //merge data & data to get result a2dVal |= (data & 0xff); cout << "The Result is: " << a2dVal << endl; This code corresponds to SPI timings as follows: The 12-bit ADC with which I'm interfacing is slightly different (being 12-bit), and has the following SPI timings: As such the bytes transmitted to the device should be as follows: Byte 1 = data = 00000110 Byte 2 = data = 00000000 Byte 3 = data = 00000000 First question, how can I modify the sample code above to incorporate the above 3 bytes? I have no idea what the '|( ((a2dChannel & 7) << 4))' component is for? Secondly, the 10-bit device response contains 6 'don't care' bits then bits 9 and 8, followed by bits 7 through 0 in byte 3. How can I modify the adcVal = data... and adcVal |= data... components to reflect this? Again, I have no idea what the '& 0b1100000000' and '0xff' components are for, nor why data is shifted 8 bits? Any help would be greatly appreciated.