Netduino home hardware projects downloads community

Jump to content


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.

CableGuy's Content

There have been 5 items by CableGuy (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#16412 My first netduino experience

Posted by CableGuy on 07 August 2011 - 04:50 AM in Project Showcase

Any updates?



#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

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 :D



#16388 AD5206 Digi Pot with SPI code....?

Posted by CableGuy on 06 August 2011 - 02:54 PM in General Discussion

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.:

// 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

Is there code for the AD5206 on the Netduino? I found it here on the Arduino but I know .Net and dont want to learn another language and Im not getting too far with the Netduino. (Still leaning the Netduino SDK.) http://www.arduino.c...l/SPIDigitalPot Thanks everyone!




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.