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

Two different SPI devices won't work on a Netduino Mini?


  • Please log in to reply
4 replies to this topic

#1 John West

John West

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts

Posted 07 January 2014 - 02:12 AM

I'm trying to hook up an MBI5026 shift register and a New Haven SPI display to a netduino mini.  I can have one or the other work, but not both.  If I have the display connected to the clock and/or mosi pins, the MBI5026 stops working, but if both are connected the display works.  If I unplug the display from both the clock and mosi pins, the MBI5026 works just fine.  The minute I connect the display back, the MBI5026 locks into whatever it was set to (I'm turning on LEDs on the MBI5026, and they stay on if they were on at the time I connect the display back).  I'm able to do this connect/disconect while the app is running, so it's not a matter of any changing code or settings.

 

So, to summarize, without having to reset/redeploy, either will work, but when the display is connected to mosi or clock, the shift register stops responding.  Any thoughts?  Here are my settings for the two devices.  I tried setting both clock rates to 100, same results.  I also tried a different GPIO pin, using 19 instead of 18 for the display.  No change.

 

SPI.Configuration Device1 = new SPI.Configuration(   Pins.GPIO_PIN_17, // SS-pin   false, // SS-pin active state   0, // The setup time for the SS port   0, // The hold time for the SS port   false,   // The idle state of the clock   true, // 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.Configuration Device2 = new SPI.Configuration(   Pins.GPIO_PIN_19, // SS-pin   false, // 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   true, // The sampling clock edge   100,   // The SPI clock rate in KHz   SPI_Devices.SPI1 // The used SPI bus (refers to a MOSI MISO and SCLK pinset)   );

 

Thanks for any insight,

John

 

ps. I can't copy and paste any text in IE11.  I had to switch to firefox.  You might want to check the forum code and see what's up. 



#2 cys

cys

    Advanced Member

  • Members
  • PipPipPip
  • 113 posts
  • LocationSoCal

Posted 07 January 2014 - 03:27 AM

Your code may need lines to the following effect:

 

[color=#0000ff;]SPI SPI_Out = new SPI(Device1);[/color]

 

and then when you want to use device 2:

 

[color=#0000ff;]SPI_Out.Config = Device2;[/color]

 

back to device 1:

 

[color=#0000ff;]SPI_Out.Config = Device1;[/color]



#3 cys

cys

    Advanced Member

  • Members
  • PipPipPip
  • 113 posts
  • LocationSoCal

Posted 07 January 2014 - 03:34 AM

Also, 100 KHz may be too slow.



#4 John West

John West

    Advanced Member

  • Members
  • PipPipPip
  • 51 posts

Posted 07 January 2014 - 05:00 AM

I've got a singleton for the SPI doing what your example shows.  I've used it with multiple shift registers with no issues.  As for the 100Khz, I've tried them both at 100Khz, and same results.  I'm using 100Khz for the display because its documentation states "The SPI interface is capable of receiving data at up to 100KHz clock rate."

 

I just cannot figure out what's going on.  It's very frustrating... I know it'll probably be something dumb on my end, but I don't even know where to look next.  Thanks for throwing out ideas.  I need all of them I can get :)!



#5 cys

cys

    Advanced Member

  • Members
  • PipPipPip
  • 113 posts
  • LocationSoCal

Posted 07 January 2014 - 05:24 AM

The minimum clock speed of the Netduino has been reported to be about 200 KHz. 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.