- Netduino Forums
- → CableGuy's Content
CableGuy's Content
There have been 5 items by CableGuy (Search limited from 29-March 23)
#16412 My first netduino experience
Posted by CableGuy on 07 August 2011 - 04:50 AM in Project Showcase
#16409 AD5206 Digi Pot with SPI code....?
Posted by CableGuy on 07 August 2011 - 03:45 AM in General Discussion
It seems to me that the ability to control a digital pot, as the AD5206 is, should be a really interesting task for the Netduino world. As soon you have collected enough experience around this chip, why don't you write a small tutorial for the Wiki section?
How much did you pay the AD?
Cheers
I would like to do that - I am still messing around with loops and ways on how to use this chip exactly.
I got the chips from digikey for around $5 US dollars + shipping. I actually just found out that I need a 100ohm chip and I am currently using a 10ohm chip so I just ordered another one but in a 100ohm setting for the same price.
Thanks again and I'll keep you updated.
Adam
#16393 AD5206 Digi Pot with SPI code....?
Posted by CableGuy on 06 August 2011 - 05:28 PM in General Discussion
#16388 AD5206 Digi Pot with SPI code....?
Posted by CableGuy on 06 August 2011 - 02:54 PM in General Discussion
According to the arduino info I found, I need to send it two bytes, one with the channel, the other the level but I cant figure it out.
While reading the arduino code and other sources it seems you need to send a signal to the SPI device to start to "read" and then when you are done you send it another signal to stop it. I couldnt find any info in the SPI-Netduino Wiki so does the Netduino do this automatically?
ex.:
// take the SS pin low to select the chip: digitalWrite(slaveSelectPin,LOW); // send in the address and value via SPI: SPI.transfer(address); SPI.transfer(value); // take the SS pin high to de-select the chip: digitalWrite(slaveSelectPin,HIGH);
Any ideas?
The AD5206 is SPI-compatible,and to command it, you send two bytes,
one with the channel number (0 - 5) and one with the resistance value for the
channel (0 - 255).
SPI.Configuration Device1 = new SPI.Configuration( Pins.GPIO_PIN_D10, // SS-pin true, // SS-pin active state 0, // The setup time for the SS port 0, // The hold time for the SS port true, // The idle state of the clock false, // The sampling clock edge 1000, // The SPI clock rate in KHz SPI_Devices.SPI1 // The used SPI bus (refers to a MOSI MISO and SCLK pinset) ); SPI SPIBus = new SPI(Device1); byte[] WriteBuffer = new byte[1]; WriteBuffer[0] = (0); // I'm just trying to control the first channel. byte[] WriteBuffer1 = new byte[1]; WriteBuffer[0] = (255); // I've set this to various values from 0-255 while testing. SPIBus.Write(WriteBuffer); //Writing byte 1?? SPIBus.Write(WriteBuffer1); //Writing byte 2??
#16342 AD5206 Digi Pot with SPI code....?
Posted by CableGuy on 04 August 2011 - 11:37 PM in General Discussion
- Netduino Forums
- → CableGuy's Content
- Privacy Policy