Updated project 8 -Domino with 128X128 OLED display using SPI

I am having a problem converting an older VS2008 project designed for the discontinued USBizi DevSys board written in .NETFM version 2 to work with .NETFM version 4 and the FEZ Domino board. The project is found at:

(link removed)

The program.cs was modified thusly ( commented lines are original, and the line following is new):

  • Pins connections:
  • USBizi DevSys (H2Connector)_Domino (my guess) _______OLED Board
  • 1 VCC___________________ 3.3V(out) on UEXT ________1 VCC
  • 2 GND___________________GND on UEXT_____________2 GND
  • 3 E36____________________D0 (com in)______________23 RES
  • 4 E37____________________D1 (com out)_____________22 D/C
  • 8 SPI-MOSI0______________ Di11 (SPI1 MOSI)__________19 D1
  • 9 SPI-SCK0_______________Di13 (SPI SCK)____________18 D0
  • 10 SPI-SSEL0_____________Di5 (PWM)________________21 CS

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
//using GHIElectronics.Hardware;
using GHIElectronics.NETMF.FEZ;
using System.Threading;

//        static SPI.Configuration conf = new SPI.Configuration(GHIElectronics.Hardware.USBizi.Pins.E43x, false, 0, 0, false, false, 4000, SPI.SPI_module.SPI1);
        static SPI.Configuration conf = new SPI.Configuration((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.Di5, false, 0, 0, false, false, 4000, SPI.SPI_module.SPI1);
        static SPI SPI_port = new SPI(conf);
//        static OutputPort RST = new OutputPort(GHIElectronics.Hardware.USBizi.Pins.E36x, true);
        static OutputPort RST = new OutputPort((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.Di0, true);

//        static OutputPort DC = new OutputPort(GHIElectronics.Hardware.USBizi.Pins.E37x, true);
        static OutputPort DC = new OutputPort((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.Di1, true);

All compiles fine and loads.

In addition, the sparkfun OLED carrier board was jumpered on JP1 and JP2 to enable the voltage boost circuit.
BS1 and BS2 were left alone (unjumpered) - this could be a problem!

I modified your post to make the code readable. please use the C# code tags in future.

Did you look at what these are for in the display datasheet? :wink:
http://www.sparkfun.com/datasheets/LCD/SSD1339_1.pdf
It is on page 15

These are the pins that select if the interface is parallel or serial (SPI). You must connect these pins appropriately to select SPI.

Once you have those, let us know if it doesn’t work then we can look more.

According to the table there on page 15, only one configuration is given for Serial communication, and that is unjumpered, which is what I had. I hate it when I asked for verification of the code and I get an unnecessary delay like this.

[quote]According to the table there on page 15, only one configuration is given for Serial communication, and that is unjumpered, which is what I had.
[/quote]
Maybe I didn’t read it right. Where do you see that the pins are serial by default? It says 0 is serial so you need to connect the pins to GND. There is no mention is the whole document saying those pins are defaulted to serial?!

Hate?! We are doing all this help to get you started because we like helping users, but it is not a requirement by any means :slight_smile: It is not fair that I had spent sometime looking up the datasheet for you and told you what page to look at and we get this response!
Not only that, I modified your post to make the code more readable and I checked it for you too!!! So, why are you hating my friend? :slight_smile:

If our answers here are not satisfying or fast enough then, though our paid consulting service, we can work with you one-on-one and even do the whole project for you if you like.

The sparkfun people provided a datasheet that showed the BS configs, which I tried to no avail. I asked you guys to check the updated pinout for the Domino board and the updated code. Would you PLEASE do that.

Like I said in last post, I have checked them the first time you posted. I was trying to help further but if this is all you need to know…yes the pins are connected correctly.

Now, did you try what I suggested? You must connect the 2 BS pins to select serial before you proceed to try anything else.

Like I said in my last post, I tied BS jumpers to GND, That is the serial setting. And nothing showed up on the display. Is there another project that uses SPI I can look at? I keep thinking that some of the pins acting as SPI pins are not initialized or something, because they obviously have different default uses. It seems that the USBizi DevSys board had more pins available by default for SPI.

You do not need other projects…I am trying to step you through it so just keep on posting here.
Also, the old DevSys board didn’t have anything special over FEZ. They both use the exact same USBizi chipset.

Now that we have made sure the connections are right, we can check the software further. First, lower your SPI clock to 1Mhz (you are using 4Mhz now)
The code will be

static SPI.Configuration conf = new SPI.Configuration((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.Di5, false, 0, 0, false, false, 1000, SPI.SPI_module.SPI1);

This will probably not fix it but try it out…

Next is to fix the CS (SSEL) settings. Try this and this will probably fix it (the clock edge is incorrect in example project)

SPI.Configuration conf = new SPI.Configuration((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.Di5, false, 0, 0, false, true, 1000, SPI.SPI_module.SPI1);

That was it - looks great. Thank you very much.

Now, that it worked, you need to put the clock back to 4Mhz.

I told you we will make it work ;)…the key is in debugging the issue in steps :slight_smile: