- Netduino Forums
- → Viewing Profile: Posts: CableGuy
The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Community Stats
- Group Members
- Active Posts 5
- Profile Views 4181
- Member Title New Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
0
Neutral
User Tools
Friends
CableGuy hasn't added any friends yet.
Posts I've Made
In Topic: My first netduino experience
07 August 2011 - 04:50 AM
Any updates?
In Topic: AD5206 Digi Pot with SPI code....?
07 August 2011 - 03:45 AM
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
In Topic: AD5206 Digi Pot with SPI code....?
06 August 2011 - 05:28 PM
I tried your code and it didnt work... so I was like "hummmmm".
I started to re-read and look at the Arduino code and wiring scheme again and found an error in their drawing. They have a wiring in the drawing going to 12 and not 11, even though he/she says pin 11 for SDI (Not 12).
As soon as I did this change, I rebooted the Netduino and it worked!!
Thanks a ton Mario!
As you can see I am new to this SPI + Netduino combo. I took the SPI code off the of SPI Wiki and didnt know where to go from there.
Thanks again!
Adam
In Topic: AD5206 Digi Pot with SPI code....?
06 August 2011 - 02:54 PM
So I cant figure out how to control this thing....
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.:
Any ideas?
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??
- Netduino Forums
- → Viewing Profile: Posts: CableGuy
- Privacy Policy