Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - daryllwin

Pages: [1]
1
OLEDs / Re: Having trouble with the NHD-0420DZW-AB5
« on: October 02, 2014, 10:13:37 AM »
Thanks for the quick reply.

I'll try using it with the Liquid Crystal library when I get the chance.

2
OLEDs / Re: SPI padding for NHD-0420DZW display
« on: October 02, 2014, 05:15:37 AM »
Out of curiosity, is the Arduino limited to 8-bits? Or can it do 10-bit commands?

I ask because I'm having trouble trying to use the SPI interface between the Uno and the same display.

3
OLEDs / Re: Having trouble with the NHD-0420DZW-AB5
« on: October 02, 2014, 04:53:35 AM »
Just an update.

I added a line of code setting the CS pin to HIGH at the beginning, and this has gotten rid of most of the gibberish.

I still cannot, however, write anything to the screen after the initialization procedure.

Can anyone help with this please. Thanks.

4
OLEDs / Having trouble with the NHD-0420DZW-AB5
« on: October 01, 2014, 10:41:54 PM »
Hi All

I'm having quite a bit of trouble with the display mentioned in the title and getting it to work with an Arduino UNO.

I've connected the display in serial mode, and my code is as shown below. I've also redid the jumpers behind as described in the datasheet.

Code: [Select]
/*
 Circuit:
 CS: pin 10
 MOSI: pin 11
 MISO: pin 12
 SCK: pin 13
 */

// the sensor communicates using SPI, so include the library:
#include <SPI.h>

const byte COMMAND = 0b11111100;     // read command
const byte DATA = 0b00000010;   // write command
const byte ON = 0b0000001111;  //turn display on

const int chipSelectPin = 10;

void setup() {
  Serial.begin(9600);
  SPI.begin();
  pinMode(chipSelectPin, OUTPUT);
  delay(100);
  digitalWrite(chipSelectPin, LOW);
  delay(100);
  SPI.transfer(0b0000111000);
  delay(100);
  SPI.transfer(0b0000001000);
  delay(100);
  SPI.transfer(0b0000000001);
  delay(100);
  SPI.transfer(0b0000000110);
  delay(100);
  SPI.transfer(0b0000000010);
  delay(100);
  SPI.transfer(0b0000001111);
  digitalWrite(chipSelectPin, HIGH);
  delay(100);
}

void loop() {
  digitalWrite(chipSelectPin, LOW);
  delay(100);
  SPI.transfer(0b1000011111);
  delay(1000);
  digitalWrite(chipSelectPin, HIGH);
}

Most of the time, the display shows gibberish. There are occasions (1 out of 5 roughly) where the display initializes properly, and a blinking cursor is shown at the first character.

However, even when it initializes correctly, the cursor never moves, which I'm guessing means that the display isn't receiving any data from the Arduino.

This kind of baffles me because it must have received the initialization commands for it to show the blinking cursor right?

Pages: [1]