Im working on a project that requires me to use a MCP4151 digital potentiometer to output a 0-5V to a mass flow controller. Right now Im trying to figure out how i need to write the SPI code for data transfer between my Arduino MEGA and the MCP4151. Being all new to this means that Im learning new and useful stuff all the time so please inform me of anything that may help!
Im having trouble figuring out how I send data via a SPI.transfer()..
as far as i can understand, I know that I need to send a 16 bit command, the first four bits being the wiper address, then the 2 command bits, followed by 10 bits of data(at least as far as i can see on the data sheet).
My confusion is where do I find the wiper address(the MCP4151 only has one wiper right?) and after the first 6 bits, why is there an extra 2 bits? What am I missing?