Digole
Digital Solutions
iDigole Buyer ProtectioniDigole Buyer
Protection
My shopping cart
0 Items:
Secure Checkout
Top Rated Plus
Visit Our Live Auctions
99.9% Customer's Satisfaction
 
Forum : Digole Serial Display :

 Search Forum.. 
 Creat New Topic   Reply 

Problem with SPI on DS128128CTFT-37

 I am having a problem getting SPI working on the 1.44" Color LCD. I have the panel jumpered properly, but it doesn't seem to be taking commands. I have a DS9664COLED-20 and I can hook it up to the same microcontroller and it works fine with SPI, with the same exact wiring. I am running the same code on both displays, but the LCD one doesn't work, the OLED one does. Do you need to do something addtional to the LCD display to get SPI to work? I don't have the SDO pin connected to anything currently, as the OLED display doesn't have that pin on it's panel.

 

 

 

 

RE:Problem with SPI on DS128128CTFT-37

 How did you connect the SS pin?

RE:Problem with SPI on DS128128CTFT-37

 I pull SS low during initialization and keep it low (as I don't have any other SPI devices I am using on the AVR).

 

RE:Problem with SPI on DS128128CTFT-37

 In the newer version of firmware (V3.0 and later), the SPI port was initiated in the beginning of start in order to avoid missing data from master controller, so the SS pin need to keep high before master controller is ready, you better to add a RC reset circuit on the SS pin: the suggestion is: 4.7K R between SS and GND, 2.2uf cap between SS and VCC.

RE:Problem with SPI on DS128128CTFT-37

 Actually what I do is when I initialize the software SPI pins, I bring SS high, until I am ready to send my first command, then I bring it low and leave it low. Are you saying it needs to be high even earlier and I do need to change the circuit design because of the firmware changes?

RE:Problem with SPI on DS128128CTFT-37

 If you already pull SS high when power up, the only possible thing can affect it is the SPI mode, the SPI mode on the module is:

Idle: CLK low

Data sample: CLK low to high edge, please check this in your software.

RE:Problem with SPI on DS128128CTFT-37

 But like I said, this works just fine on the OLED Digole display, just seems to be a problem on the LCD panel. The OLED is running 2.8 firmware and the LCD 3.1. Is there a difference in these firmwares that is undocumented? I am using the same SPI code on both displays. This is how I send a byte through the SPI:

// send 8-bits of data

uint8_t bit = 8;

// iterate through all the bits of the data

do

{

// send the high-bit over the serial peripheral interface

fast_digital_write(m_mosiPin, data & (1 << 7));

// toggle the clock line high then low

fast_digital_write(m_sckPin, PIN_HIGH);

// shift the next data bit to the most-significant-bit position

data <<= 1;

fast_digital_write(m_sckPin, PIN_LOW);

}

while(--bit);

 

RE:Problem with SPI on DS128128CTFT-37

 Yes, in V2.8, the serial port was initiated at the end of initiation, but moved to beginning in V3.1.

The problem you have looks like the SPI mode on the display module done initiation faster, and noise signal added on CLK pin, so, you need pull the SS pin high when power on, then pull to low after whole system setting done, try to adjust the RC on the SS pin and see if that work for you. 

Here is the reset circuit we tested which work with Arduino Uno, the R2 will keep the CLK pin in low when host controller put this pin floating, R5 and C3 will keep SS pin disable in about 200ms when power up

You can change the R5C3 value to lower if your host controller initiated faster than Arduino Uno, and want the module receive the data and commands ASAP.

RE:Problem with SPI on DS128128CTFT-37

 I've tried the original suggestion with the 4.7K and 2.2uF on the SS pin, and also adding the pull-up on the CLK, but no difference. I guess I could try the new values you've posted to keep the SS pin high for longer, as I'm assuming this is the issue. The first thing that is done in my sketch is to initialize the SPI pins, and the first pin initialized is SS, so I can't do anything earlier in software.

RE:Problem with SPI on DS128128CTFT-37

 The resistor on SS pin should connect to ground, not pull-up, also change the RC value to larger to tolerate with your system, it should work.

Copyright Digole Digital Solutions, 2008-2017. All rights reserved.
Powered by Victor Sun