ETA for N18 display module driver?

Problem solved :slight_smile: it was a stupid problem, of course!

Awesome - although I just realized I canā€™t use the Music module and the N18 both on the Cobra IIā€¦ Guess Iā€™ll have to use a touch screen insteadā€¦

;-p

Ok, but what should I do to make it works? :slight_smile:

The codeshare that was previously linked has the most current code, as well as a revised sample, and a note about use with the Cerb-family of boards.

@ Steven - Works!!! Thanks a lot!!!

Works great on Hydra and Spider. Cerberus is a no go - I get a ā€œsnowy screenā€ when I run it in debug or in release mode. Get an Out of Memory exception when in debug, but figure it was because of the debugger not having enough room to cram in on top of the rest of the code. See pic below.

Canā€™t confirm on any of my Cobra IIā€™s as I canā€™t get any of them to take new code nowā€¦ still working on that.

-Steve

As far as I understand your driver provides maximum FPS=16.5. Is there any way to make it more than 16.5?

Thank you for the driver :slight_smile: It is working on my Hydra (running Microframework 4.1) when I use SimpleGraphics, however my Hydra reboots when I try using WPFWindow.

Is using WPFWindow supported or have I missed something (my appologies if I have - I am a noob)?


using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace N18Test
{
    public partial class Program
    {
        GTM.GHIElectronics.Display_N18 display_N18 = null;
        Window mainWindow = null;
        Canvas layout = null;
        Border background = null;
        Rectangle block = null;

        void ProgramStarted()
        {
            display_N18 = new GTM.GHIElectronics.Display_N18(3);

            //Fez Hydra reboots when executing the next line.
            mainWindow = display_N18.WPFWindow;
            
            //Create a Canvas object.
            layout = new Canvas();

            //Add a gray background.
            background = new Border();
            background.Background = new SolidColorBrush(Colors.Gray);
            background.Width = 128;
            background.Height = 160;
            layout.Children.Add(background);
            Canvas.SetLeft(background, 0);
            Canvas.SetTop(background, 0);

            //Add a green square.
            block = new Rectangle(20, 20);
            block.Fill = new SolidColorBrush(Colors.Green);
            layout.Children.Add(block);
            Canvas.SetLeft(block, 5);
            Canvas.SetTop(block, 5);

            mainWindow.Child = layout;
        }
    }
}

WPF should work but we no longer support 4.1 FYI.

OK - Iā€™ve retried with my Cobra II running Framework 4.2.

It works when I use SimpleGraphics but when I use WPF I get a blank screen - here is the code Iā€™m testing:


using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Shapes;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace CobraTest1
{
    public partial class Program
    {
        GTM.GHIElectronics.Display_N18 mDisplayN18 = null;
        Window mMainWindow = null;
        Canvas mCanvas = null;
        Border mBackground = null;
        Rectangle mBlock = null;
        Font mBaseFont = null;
        Text mText = null;

        void ProgramStarted()
        {
            mDisplayN18 = new GTM.GHIElectronics.Display_N18(6);
            mDisplayN18.Initialize(4000);
            mMainWindow = mDisplayN18.WPFWindow;
            mCanvas = new Canvas();
            mMainWindow.Child = mCanvas;

            //Add a gray background.
            mBackground = new Border();
            mBackground.Background = new SolidColorBrush(Colors.Gray);
            mBackground.Width = 128;
            mBackground.Height = 160;
            mCanvas.Children.Add(mBackground);
            Canvas.SetLeft(mBackground, 0);
            Canvas.SetTop(mBackground, 0);

            //Add a green square.
            mBlock = new Rectangle(20, 20);
            mBlock.Fill = new SolidColorBrush(Colors.Green);
            mCanvas.Children.Add(mBlock);
            Canvas.SetLeft(mBlock, 54);
            Canvas.SetTop(mBlock, 70);

            //Add Hello World text.
            mBaseFont = Resources.GetFont(Resources.FontResources.NinaB);
            mText = new Text(mBaseFont, "Hello World");
            mText.ForeColor = GT.Color.White;
            mCanvas.Children.Add(mText);
            Canvas.SetTop(mText, 10);
            Canvas.SetRight(mText, 10);
        }
    }
}

1 Like

Iā€™ve got my N18 LCD working with my Cerbuino Bee: I can turn it on an look at randomly coloured pixels (and itā€™s not a 3D image :slight_smile: ), but the graphic primitive functions from the DisplayModule class crash and burn and throw an ā€œOut of Memoryā€ exception at me.

Oddā€¦ The STMicro 32F40x Processor family have up to 192 KB of RAM - not much compared to the average workstation (or even a smartphone) - but it should be enough to allow the creation of a VRAM buffer (about 40Kb) plus all the working storage required by the Micro Framework. Perhaps the latter is a real memory hogā€¦ or maybe Iā€™m missing a few things about building effective C# apps.

Any pointers on RAM usage optimization under .net/ C#? Iā€™m a C++ guy and not knowing what the GC is up to makes me nervous ;-).

Go go Gadgeteer go!

Yves

welcome to forum!

please start a new thread for you problem. also, include the smallest code sample that has ā€œdisplaysā€ the problem.

This should help wiki.tinyclr.com/index.php?title=OLED_Display_Module#Using_the_display_in_a_low_memory_situation

Welcome to the community.

@ Gazza - I am having the same problem with this display. I tried your code example and have been trying other examples but I keep getting a black screen

@ jschneck - Please start a new thread with details about your setup and code.