Weird tft lcd works when WR connected to ground, pic18f46k22 - Page 1
Forum section: electronics / general

author: comanchetr
author_rank: Newbie
timestamp: March 06, 2016, 04:04:15 pm
content: Hi all , I'm an electronics enthusiast and this my first post. Let me explain the situation and I’m really surprised it is the first time I experience this kind of phenomenon. I’m trying to use a tft lcd module to fill the screen with a color at every one second. It uses ssd2119 lcd controller. I’m trying to communicate it via 8080 16 bit protocol so it is really straightforward. Also my software is straightforward and initialization and other things works well I’m pretty sure that. As you know, 8080 parallel protocol requires rising edge for WR signal to transfer data.My setup;1) Breadboard (brand new –not wearied)2) 20 cm long jumper cables (brand new –not wearied)3) Pic18f46k224) 3.3 volt power supply (I use Arduino uno’s 3.3 volt power output pin but also I used different power supply such as standalone ones)5) 3.5 inch 320x240 tft lcd module with ssd2119 controllerD0-D7-> PORTDD7-D15 -> PORTCCS -> PORTB0DC -> PORTB1WR -> PORTB2RD -> PORTB3My software is straightforward just like in the timing diagram I tried delayed and non-delayed data write, command write and changes nothing. If you anyway want the code, I can post it but believe me it is irrelevant.Now my question is, ok most of the time it doesn’t work but it rarely works.Now the interesting part, if I connect WR pin to ground on breadboard it always works without any problem!!! Well this is interesting I thought ok maybe signal pattern reflects ground but then why it doesn’t work when it is connected to PORTB2(in software this sends WR rising edge) or why it even works when connected to ground because other pins are also changing and lots of things going on different signals etc but it works perfectly. I can accept that it doesn't work because breadboard and jumper cables introduce noise etc but when wr is connected to ground it works and it is really weird. Can somebody explain this?

author: dannyf
author_rank: Super Contributor
timestamp: March 06, 2016, 04:42:39 pm
content: Maybe you are just writing to the LCD? Or your code isn't aas robust as you thought?

author: elgonzo
author_rank: Unknown
timestamp: March 06, 2016, 07:15:12 pm
content: That the LCD controller accepts data when WR is tied to ground could possibly indicate that it works in 6800 mode, but that would also require the E input of the LCD module to receive a clock signal; hmm. Anyway, check the protocol selection pins... perhaps your LCD is configured to use 6800 protocol and for whatever reason it works in your project when WR is tied to GND due to some other coincidences... like you are strobing RD pin and WR pin together (RD pin is E input in 6800 mode)...

author: comanchetr
author_rank: Newbie
timestamp: March 07, 2016, 02:35:28 pm
content: dannyf, I don't think the software is faulty because I checked lots of times and also that doesn't explain why it works when WR -> gnd.elgonzo, that's is exactly what I think and because of that, I checked the configuration connections lots of time and also as you said it reqires E pin to be switched and in my software only switching pin is WR so obviously, there is something about either pic mcu or ssd2119. It may be in 6800 and somehow catches rising edge signal from other pins which are not normally switched but affected by noise.

author: comanchetr
author_rank: Newbie
timestamp: March 07, 2016, 03:22:44 pm
content: Well, there may be another possibility. The lcd module manufacturer somehow changed the pin names or something. Because I swapped CS and WR pin and it works again. My reasoning is, ok when WR is connected to ground it works then ummm that means may be it is not WR but it is CS and also it explains why it still works.SSD2119 datasheet suggests that when you write data or command to lcd, first select the chip (CS-> 0) then WR-> 0 then set the data then WR-> 1 (this is rising edge) and deselect chip (CS->1) . However my pcb is wrong and what I actually did is (unknowingly), first WR->0 then CS->0 (up to this point it can still work) , set the data then CS->1, then WR->1 (I DESELECT LCD BEFORE SENDING RISING EDGE!!). That's why it didn't work most of the time sometimes it worked may be because impedance or smtgh caused it sent rising edge before deselecting etc..Why it did work when WR is connected to gnd? Because , it is indeed CS and although the SSD2119 datasheets suggest that when writing data or command select and deselect the lcd, LCD can be always selected because there is one in my setup and also before writing data my real WR pin always is high so there won't be any wrong data write. Anyway , in short my software was sending select and deselect signal but since the pin is not CS but it is WR it sent rising edge.Why it now works? Because, I corrected the timing by swapping. Therefore, now I'm not deselecting lcd before sending rising edge.Probably issue is this. Be carefull before buying something from ebay