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.

contractorwolf

Member Since 26 Feb 2012
Offline Last Active Jul 05 2015 04:02 AM
-----

Topics I've Started

Netduino Mini using SPI pin assignment question

03 September 2012 - 06:01 AM

I created a project that has a Netduino Mini communicating with an AD5206 digital potentiometer over SPI. I had it up and working no problem using pin 19 as the CS (or Enable) pin. When I was redesigning my wire setup I tried to use pin 13 instead of pin 19 and it didnt work. I hooked it up to a Saleae Logic to see if I could get a better idea what was happening and it appears that the Enable line never gets a signal. I am initializing my SPI like this:
        public AD5206()
        {
            config = new SPI.Configuration((Cpu.Pin)Pins.GPIO_PIN_19, false, 0, 0, false, true, 1000, SPI.SPI_module.SPI1);
            SPI1 = new SPI(config);
        }


and send a value like this:
        public void SendAddressValue(int potAddress, int potValue)
        {
            tx_data[0] = (byte)potAddress;//digipot address (0 through 5)
            tx_data[1] = (byte)potValue;//value to put pot (0 through 255)

            SPI1.Write(tx_data);
        }


Pin 19 works but using the same code and just changing the pin to GPIO_PIN_13 shows no Enable pin activity even though I can see activity on the CLOCK and MOSI pins. Can pin 13 not be used as the SPI Enable pin for some reason? Do I have to use just the PWM pins? Thanks!

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.