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

Help me out with SPI Please.


  • Please log in to reply
10 replies to this topic

#1 david98xp

david98xp

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 03 February 2015 - 12:18 AM

I have this thread on GHI and am trying to get my netduino 2 working with my glcd(st7565).

Almost all info you need is there.

 

Help me fix fabien's driver so something will come up on my lcd. There is also a onedrive link you can check out.

 

https://www.ghielect...id=18209&page=4



#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 03 February 2015 - 06:31 AM

The Netduino 2 Plus had some issues related to the SPI, and should have been fixed with the latest firmware.

That was sure for the Netduino Plus 2: not sure about the simpler Netduino 2.

 

Those issues were mostly related to the worse SPI hardware logic in the ST chip, than the older Atmel.


Biggest fault of Netduino? It runs by electricity.

#3 herbsti72

herbsti72

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationVienna, Austria

Posted 03 February 2015 - 01:36 PM

Hi David,

 

a few days ago I got ST7565 (Adafruit) working with my Netduino 2 Plus (see attachment).

I use the "AdaFruit ST7565 Negative LCD display" driver available in Netduino Helpers Library and it worked fine out of the box.

 

How is your ST7565 wired with Netduino?

At least you need to wire following pins (the bold ones you need to set on AdaFruit7565 constructor) :

GND:  GND
VDD:  3.3v

SID:  D11 (SPI MOSI)
SCLK: D13 (SPI CLK)
A0:   D7 (Data / Command)
/RST: D4
/CS:  D10 (or D8)

 

These pins are just for background light and are optional (so you can leave it unplugged for first tests):

B-:   LED Blue
G-:   LED Green
A+:   LED anode
R-:   LED Red

 

How to use AdaFruit7565 class in your code:

 

For creating instance of AdaFruit7565 class you need to take care to set correct pins (marked above red!) in constructor!

Here is some sample you can use in program.cs:

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using netduino.helpers.Hardware;
 
namespace AdaFruit7565Test {
    public class Program {
 
        // you need to reflect pin configuration in AdaFruit7565 constructor
        public static AdaFruit7565 lcd =
           new AdaFruit7565(Pins.GPIO_PIN_D7, Pins.GPIO_PIN_D4, Pins.GPIO_PIN_D10, speedKHz: 21000);
 
        public static void Main() {
 
            lcd.Initialize();     // init display - important!
            lcd.SetContrast(AdaFruit7565.ContrastMedium);
            lcd.DrawString(0, 1, "Test");
            lcd.Refresh();        // refresh screen and shows text
            Thread.Sleep(5000);   // wait 5 seconds before set powersavemode
            lcd.ClearScreen();
            lcd.DrawString(0, 1, "Test 2");
            lcd.Refresh();        // refresh screen
            Thread.Sleep(5000);   // wait 5 seconds before set powersavemode
            lcd.PowerSaveMode();  // set display to powersave mode
 
        }
    }
}

What happens if you try above code?

 

br,
Johannes

 

 

Attached Files



#4 david98xp

david98xp

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 04 February 2015 - 04:46 AM

Thanks but it didin't work. Even when I tried setting it to SPI module 2(according to the N2 schematics). I'm surprised it worked out of the box. Maybe it was designed only for the PLUS. I don't know what else I must do to get the lcd working on this hardware.



#5 herbsti72

herbsti72

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationVienna, Austria

Posted 04 February 2015 - 09:48 AM

Which firmware have you installed on your Neduino 2?



#6 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 04 February 2015 - 10:06 AM

I don't know what else I must do to get the lcd working on this hardware.

 

Could you post a photo of the actual wiring?



#7 david98xp

david98xp

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 04 February 2015 - 08:44 PM

I'm running 4.2. Here are the photos of wiring and the "result".

 

Link:https://onedrive.live.com/redir?resid=95EDA52E6601F7B0!18018&authkey=!ALH6P7svj1YQ3WA&ithint=folder%2c photos in the root.

 

How do you upload anyway :P



#8 herbsti72

herbsti72

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationVienna, Austria

Posted 04 February 2015 - 10:34 PM

At first I would upgrade to 4.3.1 so maybe there is a fix for SPI in newer version of MF.

Or is there some reason why you stuck on 4.2?

 

Second - on your pictures I cannot identify your wiring ;)

 

I have attached my wiring so you could compare it to yours... hope it helps :-)

Attached Files



#9 herbsti72

herbsti72

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationVienna, Austria

Posted 04 February 2015 - 10:38 PM

How do you upload anyway :P

 

I need to use Firefox - IE 10 doesnt work very well with this forum ;-)

Right below of the edit box there is a "more reply options" button - if you click on this you are able to attach pictures and other documents to your post.



#10 david98xp

david98xp

    Advanced Member

  • Members
  • PipPipPip
  • 57 posts

Posted 27 March 2015 - 02:56 AM

Ok Nerbsti72

I have 4.31 with VS2012 now. The blink test works but this still gives me a white backlight of death. I looked at schematics and also tried setting it to SPI module 2.

I'm surprised it worked out of the box for you..



#11 herbsti72

herbsti72

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationVienna, Austria

Posted 29 March 2015 - 09:57 AM

Hi,

sad to hear that it is still not working. :(

Last weekend I attached another Adadfruit LCD on my N2+ and it worked.

 

Maybe you have some wrong wiring?

Or something went wrong during soldering (cold solder joints)?

 






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.