Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

MCP4161 digital potentiometer SPI interfacing

Hi all,

 

I've done a bit with serial comms. before with NI VISA, but have a more basic question about what codes to send to my digital potentiometer. My pot is a MCP4161 with 256 settings for the wiper. The documentation shows the picture below.

 

It looks like code "100h" accesses the last resistor (N=257) and code "00h" accesses the first resistor (N=0).

 

Can anyone point me in the right direction to figure out everything in between? haha .... help a noob out here .....

 

Or, perhaps there is some LabVIEW SPI module that is designed to work with such a device? In the past I used NI VISA to talk to a RS-485 device.

 

Thanks for your help! 

 

PS. link to data sheet, see Section 5 for the wiper stuff https://www.mouser.com/datasheet/2/268/22059a-51937.pdf

 

Capture.PNG

0 Kudos
Message 1 of 4
(3,154 Views)

Hi

You best can use a USB to SPI converter, avalable from e.g. ftdi. Make sure you get the correct voltage

but as seen in the chip it can range from 2.7 to 5.5 Volt so no problem (3.3 is nice).

And then install the ftdi drivers and make sure you only supply 0..FF as values meaning 0..255 decimal.

 

greetings from the Netherlands
0 Kudos
Message 2 of 4
(3,071 Views)

Great thanks! This points me in the right direction.

 

Always happy when I don't have to get fancy hardware, and the FTDI SPI-USB converter looks convenient.

 

Only thing is, I'm not sure exactly which commands I'm sending. I found a basic driver on the FTDI website to do read/write commands, but the datasheet for my digital potentiometer is a little difficult to understand! Here's their write page:

 

write_data.PNG

0 Kudos
Message 3 of 4
(3,053 Views)

I just realized this is shifting back to a software question, now that I know I can use a SPI-USB converter 🙂

 

Hopefully that's OK... haha

0 Kudos
Message 4 of 4
(3,049 Views)