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

SPI and networking, concurrant, doesn't work?


  • Please log in to reply
5 replies to this topic

#1 passedpawn

passedpawn

    New Member

  • Members
  • Pip
  • 5 posts

Posted 06 August 2013 - 01:55 AM

N+2.  4.2.2.  

 

I've had networking working for the last week, but I tried to add SPI and I get debug errors.  

 

I see that the networking PHY is connected through the processor's SPI1, so I've tried other SPI ports and although I can see SPI working great on my scope, networking gives errors while any SPI is config'ed.

 

Can these two things work concurrantly?  I'll probably bitbang the SPI tomorrow if I can't get the peripheral to play nicely with the networking.  

 

Thanks in advance. 



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 August 2013 - 08:50 PM

Hi passedpawn, Netduino Plus 2 has 3 separate SPI peripherals (Ethernet, MicroSD, and pins D11-D13). If you are experiencing issues on networking or MicroSD while using SPI in your application we need to debug that. BTW be sure that you're using the Netduino hardware provider's SPI module rather than the generic NETMF enumerations, to make sure that you're not accidentally writing on the Ethernet module's pins instead. Chris

#3 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 06 August 2013 - 08:57 PM

Seems odd, i have an application which makes extensive use of the on board sd card, ethernet and spi port.

As Chris suggested are you using the secretlabs name space classes for SPI pin assignments etc.?

 

Nak.



#4 passedpawn

passedpawn

    New Member

  • Members
  • Pip
  • 5 posts

Posted 06 August 2013 - 11:10 PM

Thanks guys.  I was under the gun to get this done, so I bitbanged the SPI with the discrete I/O this morning.  It's all working fine (albiet slow - ~ 67kHz clock measured on my scope).

 

I tried all SPI port enumerations (i.e., SPI1, SPI2, etc) but all of them broke ethernet.  

 

Was the following wrong?

 

            //SPI.Configuration config = new SPI.Configuration(
            //        SPI_mod: SPI.SPI_module.SPI3,
            //        ChipSelect_Port: Pins.GPIO_PIN_D10,
            //        ChipSelect_ActiveState: false,              // CS active LOW
            //        ChipSelect_SetupTime: 1,                    
            //        ChipSelect_HoldTime: 1,                  
            //        Clock_IdleState: false,                     // CS is low outside of transactions
            //        Clock_Edge: true,                           // data bit registers on rising edge of clock
            //        Clock_RateKHz: 1000);                       // EEPROM clock can go up to 20MHz
 
            //SPI EE = new SPI(config);


#5 passedpawn

passedpawn

    New Member

  • Members
  • Pip
  • 5 posts

Posted 06 August 2013 - 11:13 PM

BTW, SPI did work.  I scoped the pins and saw CS and CLK firing as expected.  But anytime SPI was set up, ethernet was broken (I got exceptions any time I attempted to post data using System.Http).



#6 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 06 August 2013 - 11:16 PM

hmm.

 

try using > 2mhz as spi clock.

(hmm, well that should be fixed long time ago and not interfere with ethernet.. hmm)

 

and try using SPI_Devices.xxx

 

 

btw: from what i know also 16mhz is max the netduino can do (some division problems or whatnot, iam not sure)






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.