Nokia LCD + Arduino Ethernet Shield not working (together) - Netduino 2 (and Netduino 1) - Netduino Forums
   
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

Nokia LCD + Arduino Ethernet Shield not working (together)


  • Please log in to reply
7 replies to this topic

#1 Eduardo

Eduardo

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationSão Paulo, Brasil

Posted 26 October 2011 - 10:48 PM

Hello everyone,

The LCD works perfectly with my RFID ID-12, and arduino network works perfectly with RFID ID-12, but when I try to use all together, or just the LCD and the arduino network, error occurs in:

SecretLabs.NETMF.Net.Wiznet5100 wiznet = new SecretLabs.NETMF.Net.Wiznet5100(SPI.SPI_module.SPI1, Pins.GPIO_PIN_D10);

I noticed that both use SPI.SPI_module.SPI1 and Pins.GPIO_PIN_D10, this could be causing this?
O coração tem razões que a própria razão desconhece.

#2 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 27 October 2011 - 12:52 AM

I used neither - but just as an outside guess, if both use SPI, what you're passing there is probably the chip select pin, and that should be different for those - so wire it to another pin for one of those, and adjust the source (use any pin but not pin 4). Both using the same SPI module is not a problem ...
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#3 Eduardo

Eduardo

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationSão Paulo, Brasil

Posted 27 October 2011 - 10:27 PM

Hello Stefan W., thanks for the reply, I changed the Pins.GPIO_PIN_D10 by Pins.GPIO_PIN_D6 (Board and code for lcd) but still no success, just remember that the LCD is the first initializing, see the error:

    #### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (3) ####
    #### Message: 
    #### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] ####
    #### Microsoft.SPOT.Hardware.SPI::.ctor [IP: 0022] ####
    #### SecretLabs.NETMF.Net.Wiznet5100::.ctor [IP: 0081] ####
    #### SecretLabs.NETMF.Net.Wiznet5100::.ctor [IP: 0007] ####
    #### dotNetMicroValidacao.lib.NetWork::callWebService [IP: 0008] ####
    #### dotNetMicroValidacao.lib.ID_12::SPort_DataReceived [IP: 0106] ####
    #### System.IO.Ports.SerialPort::DataEventHandler [IP: 0012] ####
A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll
ERRO callWebService
Exception was thrown: System.InvalidOperationException
Microsoft.SPOT.Hardware.Port::ReservePin
Microsoft.SPOT.Hardware.SPI::.ctor
SecretLabs.NETMF.Net.Wiznet5100::.ctor
SecretLabs.NETMF.Net.Wiznet5100::.ctor
dotNetMicroValidacao.lib.NetWork::callWebService
dotNetMicroValidacao.lib.ID_12::SPort_DataReceived
System.IO.Ports.SerialPort::DataEventHandler

Anyone ever had this problem, even with different hardware?
O coração tem razões que a própria razão desconhece.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 28 October 2011 - 07:04 AM

I noticed that both use SPI.SPI_module.SPI1 and Pins.GPIO_PIN_D10, this could be causing this?

Yep, the same SPI bus can be used by many devices, but the chip select pin can only be used once. Can you put one of the devices on another chip select pin?
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 Eduardo

Eduardo

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationSão Paulo, Brasil

Posted 28 October 2011 - 12:23 PM

Hello Stefan, initially both were in Pins.GPIO_PIN_D10 (standard in the examples for lcd and ethernet shield). I changed the lcd for Pins.GPIO_PIN_D6, then the above error occurred. Later I will change in arduino ethernet shield to see what happens.
O coração tem razões que a própria razão desconhece.

#6 Eduardo

Eduardo

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationSão Paulo, Brasil

Posted 28 October 2011 - 09:54 PM

I'm a little lost, in the LCD driver the following pins are used:

    public Nokia_5110()
        {
            this.configNokia_5110(true, Pins.GPIO_PIN_D10, Pins.GPIO_PIN_D9, Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D8);            
        }

        public void configNokia_5110(bool useBacklight, Cpu.Pin latch = Pins.GPIO_PIN_D3, Cpu.Pin backlight = Pins.GPIO_PIN_D9,
            Cpu.Pin reset = Pins.GPIO_PIN_D7, Cpu.Pin dataCommand = Pins.GPIO_PIN_D4)
        {
            ...

Then i tested the arduino ethernet shield in 5, 6 and 12:

SecretLabs.NETMF.Net.Wiznet5100 wiznet = new SecretLabs.NETMF.Net.Wiznet5100(SPI.SPI_module.SPI1, Pins.GPIO_PIN_D12);

But still giving error, anyone know what I should change?
O coração tem razões que a própria razão desconhece.

#7 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 01 November 2011 - 08:48 PM

Be sure to keep in mind that you have to change the physical pin as well, if your using a shield this could be difficult, you may have to cut the traces and solder in new connections.

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#8 Eduardo

Eduardo

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationSão Paulo, Brasil

Posted 02 November 2011 - 01:56 PM

Hello Arron Chapman, I thought it would not be necessary to ethernet shield, so I just changed the code. Anyway I tried different combinations with the lcd, changing cables and code but without success. Does the lcd and arduino ethernet shield can not work together at the same time? Is there a way to turn off the LCD when the shield is working and vice versa?
O coração tem razões que a própria razão desconhece.




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.