boylesg
Advanced Member level 4
- Joined
- Jul 15, 2012
- Messages
- 1,023
- Helped
- 5
- Reputation
- 10
- Reaction score
- 6
- Trophy points
- 1,318
- Location
- Epping, Victoria, Australia
- Activity points
- 11,697
Reading the datasheet for MCP10XXX digital potentiometer.
Datasheet
Refer to page 18.
I sort of get the structure of the data you are supposed to transmit to the POT. 3 x 16 bit integers.
The first 16 bit integer contains a max of 10 bits corresponding to the resistance you want to set the POT at.
The second 16 bit integer contains the channel or channels you want to set at the former resistance value. But the second byte of that is ignored.
The third 16 bit integer contains the command to either shutdown the channel or set its resistance value. Again the second byte of that is ignored.
But what does "the first 16 bits shifted out will be 0s' mean?
That seems to be in conflict with the rest of the data structure you send to the device via SPI.
Either it means that the device expects 4 x 16 bit integers, in which case the first one you send is 0 and 'the first 16 bits shifted out will be 0s' makes sense.
Or it means that 3 x 16 bit integers are expected but the first 16 bit integer will be 0 only if the command byte contains the 'shut down command'. In which case a resistance value in the first 16 bit integer is irrelevant.
So which is it? The author of this datasheet is being ambiguous.
Datasheet
Refer to page 18.
I sort of get the structure of the data you are supposed to transmit to the POT. 3 x 16 bit integers.
The first 16 bit integer contains a max of 10 bits corresponding to the resistance you want to set the POT at.
The second 16 bit integer contains the channel or channels you want to set at the former resistance value. But the second byte of that is ignored.
The third 16 bit integer contains the command to either shutdown the channel or set its resistance value. Again the second byte of that is ignored.
But what does "the first 16 bits shifted out will be 0s' mean?
That seems to be in conflict with the rest of the data structure you send to the device via SPI.
Either it means that the device expects 4 x 16 bit integers, in which case the first one you send is 0 and 'the first 16 bits shifted out will be 0s' makes sense.
Or it means that 3 x 16 bit integers are expected but the first 16 bit integer will be 0 only if the command byte contains the 'shut down command'. In which case a resistance value in the first 16 bit integer is irrelevant.
So which is it? The author of this datasheet is being ambiguous.