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 - milhead

Pages: [1]
« on: April 30, 2014, 10:15:00 PM »

While messing around to get my display to work I encountered the exact same problem.  Check your SPI protocol and make sure that it us operating in SPI Mode 3, CPOL=1, and CPHA=1.   (  Also make sure that all transfers are a single byte (while !CS is low).

I am reliably writing to my display (same as yours) and while fooling with my SPI transfer code saw the exact same failures that you saw.

I'm running my transfer clock at 85Khz but am careful to allow the processing time for each command as outlined in the data sheet.


Character LCDs / OK, Have it working....
« on: April 30, 2014, 09:44:11 AM »
I got it working.. 

The PIC software does 'not' have a multi-byte transfer capability and requires the
clock be high prior to initiating the clock within a chip select as well as Sampling
on the clock rising edge...  Until I adjusted my master as shown below I had a variety of

In SPI specification terms

   MSB First
   8 Bits per transfer ( No Multi-byte transfers )
   Enable Line is active Low...
   SPI Mode 3 (See
        SPI:CPOL=1  (Clock Polarity, High When Inactive)
        SPI:CPHA=1 (Clock Phase, Data is valid on clock trailing edge)

I'm sure the author of the PIC code knew this stuff but was dropped before the somewhat brief protocol discussion in the external reference. 

Obey the required delay after the various commands as shown in the spec..

I hope this saves somebody some time....


Character LCDs / Re: NHD-0216K3Z-FL-GBW-V3 via SPI Help Requested
« on: April 29, 2014, 06:11:24 PM »
Hi Michael

I've changed my code slightly to send the exact same commands with at least the same delays I still get no effect on the display.

In the example code it sets the Black light Brightness to 15 but the documentation says that it's
defined between 1-8.  Do you know what the correct range is?

Code: [Select]
// ...snippet from Newhaven example code....
// Set Backlight Level
tx_packet[1] = 0x53;
tx_packet[2] = 15; // backlight 1 - 15

In my case the back-light is on full (compared to my other parallel Newhaven displays).

Do you know what SPI 'mode' the display requires?

Would it be possible to see a logic analyzer trace of a successful display initialization? 
There are so many SPI variants combined with the emulation of an SPI slave by the
PIC controller.  Seeing a working one would allow me to quickly setup my master to
communicate the same way.

I've tried to back out the SPI pin interactions from the example code without success....

Any help would be appreciated!


Character LCDs / NHD-0216K3Z-FL-GBW-V3 via SPI Help Requested
« on: April 28, 2014, 12:06:17 AM »
Hello Folks;

I'm using a NHD-0216K3Z-FL-GBW-V3 via SPI and I cannot
get a single character to display...

My clock frequency is around 78Khz, The following
display, show my setting
Display-On (0xfe,0x41),
Set-Contrast (0xfe, 0c52, 0x19), then
Clear-Screen (0xfe, 0x51).. Then
the text for 'Hello'

I cannot get any logical commands to work, LCD back-light etc..

I have soldered a wire across R2 to select SPI...

Does someone have an example of commands needed to initialize the display or am I missing something else...

I have the exact same result with two displays, I suspect
there is something that I am not doing;

Any help would be appreciated!


[attachment deleted by admin]

Pages: [1]