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

Netduino Plus 2 ENC28J60 uses SPI1? But where is MISO?


  • Please log in to reply
7 replies to this topic

#1 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 01 December 2012 - 09:51 PM

Looking at the schematic, I see the ENC28J60 wires marked with the ENC prefix, but I am very confused. It looks like it is SPI1, but ENC_MISO is connected to PB4? Shouldn't it be PA6_SPI1_MISO?

Posted Image

The reason I am asking is because I am adding a profile for NetduinoPlus2 into the new mIP release. Although, I will have to build a firmware with the networking stubbed out or add a disable flag. I suppose I could flash with NetduinoGo firmware... although I suspect the MicroSD won't work with the NGo firmware..?

-Valkyrie-MT

#2 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 01 December 2012 - 10:53 PM

Looking at the schematic, I see the ENC28J60 wires marked with the ENC prefix, but I am very confused. It looks like it is SPI1, but ENC_MISO is connected to PB4? Shouldn't it be PA6_SPI1_MISO?

Posted Image

The reason I am asking is because I am adding a profile for NetduinoPlus2 into the new mIP release. Although, I will have to build a firmware with the networking stubbed out or add a disable flag. I suppose I could flash with NetduinoGo firmware... although I suspect the MicroSD won't work with the NGo firmware..?

-Valkyrie-MT

Valkyrie-MT,

Here is the Pinout for the NP2 that Gutworks made, maybe it will help. MISO should be D12, but I am not sure that SPI is fully functional at the moment, I think they have a bug that they are working on.

Chuck

Attached Files



#3 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 02 December 2012 - 03:19 AM

Here is the Pinout for the NP2 that Gutworks made


Thanks Gutworks. I am asking for the exact wiring of the SPI bus to the ENC28J60 on the PCB of the Netduino Plus 2 itself. I think only Secret Labs will be able to clear this up... Or someone able to view the board file. Which I may try to read myself here soon.

-Valkyrie-MT

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 02 December 2012 - 05:41 AM

Hi Val,

Looking at the schematic, I see the ENC28J60 wires marked with the ENC prefix, but I am very confused. It looks like it is SPI1, but ENC_MISO is connected to PB4? Shouldn't it be PA6_SPI1_MISO?

ENC_MISO is connected to PB4. PA6 and PB4 both have support for SPI1_MISO and by using PB4 for MISO we were able to get PWM on D9...for Arduino shield compatibility.

These STM32 chips are quite a bit more flexible than the SAM7X chips we use on the classic Netduino...but with that flexibility comes a fairly intense pin selection process :) To the user it should all just work--but it took quite a while to find the best balance of features-on-pins (with the half dozen or more alternate function possibilities on each pin).

Chris

#5 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 02 December 2012 - 05:55 AM

ENC_MISO is connected to PB4. PA6 and PB4 both have support for SPI1_MISO


Excellent! Just what I needed to know. So the PA6/SPI1_MISO marking on the diagram for the STM32 chip is merely the default assignment for the SPI1_MISO, which Secret Labs did not use in the N+2. Thanks Chris.

#6 vishaletm

vishaletm

    New Member

  • Members
  • Pip
  • 3 posts

Posted 04 February 2013 - 02:24 PM

Hello,

Could yo give me  the connection for the ENC28J60 to STM32F4 discovery board?

Is there any difference in the code for using the STM32F407VG?



#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 17 April 2014 - 07:44 PM

Hey Val,

Excellent! Just what I needed to know. So the PA6/SPI1_MISO marking on the diagram for the STM32 chip is merely the default assignment for the SPI1_MISO, which Secret Labs did not use in the N+2. Thanks Chris.

We were just doing some validation work on Netduino Plus 2 and wanted to make sure that mIP was configured properly. If you have a chance, you'll want to make a quick change to the NetduinoPlus2 profile config in your Networking.cs file.

Updated line 273:
Start(MacAddress, name, SPI.SPI_module.SPI2, (Cpu.Pin)4, (Cpu.Pin)40);
The SPI bus you want is SPI2 (rather than SPI1): for consistency between Netduinos, we map SPI1 to the D11-D13 pins--so the internal SPI1 is actually "SPI2" from NETMF code's perspective. Also...the chip select pin is PC8 as you noted--which maps to pin # 40 (0x28).

Keep up the great work, and thanks so much for all your contributions.

Chris

#8 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 18 April 2014 - 05:09 AM

I just checked in this change.  When I retest it on the Netduino Plus 2 myself, I'll assemble a new zip package and probably call it v1.0.  I'm usually pretty conservative with the version numbers.  I don't want to get expectations too high, but I think after 2 years of extensive use by hundreds of people, I think I can ditch the "Beta" tag :)

 

-Valkyrie-MT






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.