Hey guys! I'm working on a project and need some quick guidance. I bought this chip :
From what I understand, I use 11 bits to control the digital potentiometers. The first 3 bits are address (000 - 101) with the following 8 bits to control the wiper arm. As simple as it may or may not seem, I can't figure out how to transmit an 11 bit data string to the SPI connection. I'm using the typical p5,p6,p7 SPI connection.
The examples I find are generally spi.write(0x07) but I need exactly 11 bits (I think).
Could someone give me a pointer on this? I'm sure it's simple and I'm over complicating it. Thanks guys!
You should be able to do something like:
SPI spi(p5, p6, p7);
Hope that helps,
Thanks Simon! I'll be trying this soon. I'm just confused with it needing exactly 11 bits, such as if I send 0x7FF, that would be 0100 1111 1111. What does it do with that first 0? Does it just read the first 11 and disregard the rest? I'm just trying to understand what's happening. Thanks for the quick reply!
It'll just send the last 11 bits of whatever value you send. Have a play and hopefully it'll do what you expect.
Please log in to post a reply.
mbed, the fastest way to prototype with ARM based microcontrollers.
^ back to top