Author Topic: SPI Timing Issue - NHD-0420D3Z-FL-GBW-V3  (Read 2031 times)

jfahlman

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
SPI Timing Issue - NHD-0420D3Z-FL-GBW-V3
« on: March 22, 2016, 12:38:46 PM »
Hello,

I am having a timing issue trying to send a full line (20 characters) to the display via SPI. I can write the characters fine however I must delay 100us between characters. I tried using the demo code below, but the delay_us(5) is too short. If I change to delay_us(100) it works but is too slow for my application:

case 2:                  // SPI
         spi_ss = 0;
         delay_cycles(5);
         for (ix = 0; ix < x; ix++) {
            SSPBUF = tx_packet[ix];
            while(!BF);
            temp = SSPBUF;
            delay_us(5);      // reduce effective clock rate
         }
         delay_cycles(5);
         spi_ss = 1;
         break;

The datasheet lists the execution time as 100us for the character write thus I was able to detemine that 100us was needed. Is this correct or is there something else I am doing wrong? Can the onboard PIC not buffer the 20 bytes transmitted, or I must indeed wait 100us for every byte transmitted?

Regards,
Jason

Saurabh_B

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 10
    • View Profile
Re: SPI Timing Issue - NHD-0420D3Z-FL-GBW-V3
« Reply #1 on: March 22, 2016, 05:18:31 PM »
Hi,

It will take 100 Ás (Max) to execute a write instruction. This means that you will have to wait 100Ás between character writes. The 5Ás is the wait to generate the longer clock pulse.

 

3 Volt to 3.3 Volt longterm reliability issue

Started by muragavinoBoard OLEDs

Replies: 1
Views: 2236
Last post November 11, 2014, 03:04:04 PM
by Michael_L
NHD-0420D3Z-NSW-BBW-V3 i2c display and Arduino missing characters

Started by 0miker0Board Character LCDs

Replies: 0
Views: 658
Last post July 06, 2017, 11:05:59 AM
by 0miker0
NHD-0420D3Z-NSW-BBW-V3 back-light flickers

Started by rickford66Board Character LCDs

Replies: 3
Views: 3455
Last post May 06, 2015, 08:34:09 AM
by fraryb
Changing the Slave Address with NHD-0420D3Z

Started by alkBoard Character LCDs

Replies: 2
Views: 2554
Last post January 13, 2015, 01:53:20 PM
by alk
Trouble with serial interface on NHD-0420D3Z-FL-GBW-V3

Started by chughesBoard Character LCDs

Replies: 4
Views: 2928
Last post September 29, 2015, 11:16:48 AM
by Paul_B