Author Topic: SPI Timing Issue - NHD-0420D3Z-FL-GBW-V3  (Read 2970 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: 379
  • 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: 3195
Last post November 11, 2014, 03:04:04 PM
by Michael_L
NHD-0216CW-AY3 8-bit Parallel 8080, Text on Display Issue

Started by forteyBoard OLEDs

Replies: 14
Views: 10990
Last post March 09, 2015, 02:23:51 PM
by Retheesh_M
Issue with reading busy flag in 4 bit mode.

Started by SwemarvBoard Character LCDs

Replies: 6
Views: 7219
Last post September 26, 2015, 10:12:49 AM
by acain829
Arduino FTDI_FT801 Library Documentation Issue

Started by stumpr84Board TFTs

Replies: 0
Views: 1110
Last post January 12, 2018, 01:46:50 PM
by stumpr84
NHD-0216AW-SB3 - issue with writing characters to screen

Started by kokomojoeBoard OLEDs

Replies: 0
Views: 88
Last post September 09, 2018, 07:29:49 PM
by kokomojoe