Help With Initializing SSD1963 4.3inch 480x272 pixel LCD. Simple interface GUI
Igor_Rast
Posts: 357
After spending allot of time trying to get this thing to work jumping in on other treads . Thought it was time to start my own tread.
As maybe you aleady catched it , I was having some trouble initializing the display , Started out with the schematics and code from Dr_A and Average Joe . They did some pretty awesome work with some LCD modules . and i got the best help possible someone could ask , Thanks again Dr_A and Average Joe. But I still havent got it to work ,
Broke down the schematic to an absolute minimun , Connecting the 8 data lines for a 8 bit bus , the other 8 data lines from the LCD are pulled high with a 10k resistor . and there are some control lines . connected directly to the prop pins .
Just wanting to get the white noise on the display for a start .
First I thouth the SSD1963 controller must be broken , But now I have a new one that does exactly the same , So its got to be something else .
Pretty sure Im just not seeing it , So any help at all is realy apriciated .
the spin code used now looks like below
and the c example that came from the lcd
[code]#include <reg51.h>
#include <intrins.h>
#include <font\font.h>
#include <sys\sys.h>
#include <lcd\lcd.h>
/* http://ttmcu.taobao.com
As maybe you aleady catched it , I was having some trouble initializing the display , Started out with the schematics and code from Dr_A and Average Joe . They did some pretty awesome work with some LCD modules . and i got the best help possible someone could ask , Thanks again Dr_A and Average Joe. But I still havent got it to work ,
Broke down the schematic to an absolute minimun , Connecting the 8 data lines for a 8 bit bus , the other 8 data lines from the LCD are pulled high with a 10k resistor . and there are some control lines . connected directly to the prop pins .
Just wanting to get the white noise on the display for a start .
First I thouth the SSD1963 controller must be broken , But now I have a new one that does exactly the same , So its got to be something else .
Pretty sure Im just not seeing it , So any help at all is realy apriciated .
the spin code used now looks like below
_clkmode = xtal1 + pll16x ' use crystal x 16 _xinfreq = 5_000_000 ' 5Mhz crystal _1ms = 1_000_000 / 1_000 ' Divisor for 1 ms CON CS_PIN = 10 WR_PIN = 11 RS_PIN = 12 REST_PIN = 13 PUB Main |i outa[CS_PIN]~~ outa[WR_PIN]~~ 'exclusive for SRAM WR Pin .. LCD Shares Clock_pin with Counters outa[RS_PIN]~~ outa[REST_PIN]~~ outa[7..0]~~ dira[CS_PIN]~~ dira[WR_PIN]~~ dira[RS_PIN]~~ dira[REST_PIN]~~ dira[7..0]~~ pause1ms(50) Start_SSD1963 PUB LCD_RS_High outa[RS_PIN]~~ PUB LCD_CS_High outa[CS_PIN]~~ PUB LCD_RESET_High outa[REST_PIN]~~ PUB LCD_WR_High outa[WR_PIN]~~ PUB LCD_RS_Low outa[RS_PIN]~ PUB LCD_CS_Low outa[CS_PIN]~ PUB LCD_RESET_Low outa[REST_PIN]~ PUB LCD_WR_Low outa[WR_PIN]~ PUB Bus8bit(data) outa[7..0] := data PUB Lcd_Write_Com(adresslong) LCD_RS_Low LCD_write_bus(adresslong) PUB Lcd_Write_Data(adresslong) LCD_RS_High LCD_write_bus(adresslong) ' send out the data PUB Displaycmd(c,d) ' instruction in one method Lcd_Write_Com(c) ' send out a word Lcd_Write_Data(d) PUB LCD_write_bus(lcdbyte) bus8bit(lcdbyte) LCD_WR_Low LCD_WR_High PUB pause1ms(period) | clkcycles '' Pause execution for period (in units of 1 ms). clkcycles := ((clkfreq / _1ms * period) - 4296) #> 381 ' Calculate 1 ms time unit waitcnt(clkcycles + cnt) ' Wait for designated time '' DISPLAY SETTINGS DAT VDP long 271 HDP long 479 HT long 531 HPS long 43 LPS long 8 VT long 288 VPS long 12 FPS long 4 HPW long 10 VPW long 10 PUB Start_SSD1963 LCD_Reset_High pause1ms(5) LCD_Reset_Low pause1ms(5) LCD_Reset_High LCD_CS_High LCD_WR_High pause1ms(5) LCD_CS_Low Lcd_Write_Com ($00E2) '($00E2) ' //PLL multiplier, set PLL clock to 120M Lcd_Write_Data($002D) '($0023) ' //N=0x36 for 6.5M, 0x23 for 10M crystal ' $21?? Lcd_Write_Data($0002) '($0002) ' Lcd_Write_Data($0004) '($0054) ' dummy byte? Lcd_Write_Com ($00E0) '($00E0) ' // PLL enable Lcd_Write_Data($0001) '($0001) ' set pll pause1ms(1) Lcd_Write_Com ($00E0) '($00E0) ' pll ' Lcd_Write_Data($0003) '($0003) pause1ms(5) Lcd_Write_Com ($0001) '($0001) ' // software reset pause1ms(5) Lcd_Write_Com ($00E6) ' //PLL setting for PCLK, depends on resolution Lcd_Write_Data($0003) ' Lcd_Write_Data($00ff) ' Lcd_Write_Data($00ff) ' Lcd_Write_Com ($00B0) ' //LCD SPECIFICATION Lcd_Write_Data($0000) ' Lcd_Write_Data($0000) ' Lcd_Write_Data((HDP>>8)&$00FF) ' //Set HDP 'hps?? Lcd_Write_Data(HDP&$00FF) Lcd_Write_Data((VDP>>8)&$00FF) ' //Set VDP 'vps?? Lcd_Write_Data(VDP&$00FF) Lcd_Write_Data($0000) Lcd_Write_Com ($00B4) ' //HSYNC Lcd_Write_Data((HT>>8)&$00FF) ' //Set HT Lcd_Write_Data(HT&$00FF) Lcd_Write_Data((HPS>>8)&$00FF) ' //Set HPS Lcd_Write_Data(HPS&$00FF) Lcd_Write_Data(HPW) ' //Set HPW Lcd_Write_Data((LPS>>8)&$00FF) ' //Set HPS Lcd_Write_Data(LPS&$00FF) ' Lcd_Write_Data($0000) ' Lcd_Write_Com ($00B6) ' //VSYNC Lcd_Write_Data((VT>>8)&$00FF) ' //Set VT Lcd_Write_Data(VT&$00FF) Lcd_Write_Data((VPS>>8)&$00FF) ' //Set VPS Lcd_Write_Data(VPS&$00FF) Lcd_Write_Data(VPW) ' //Set VPW Lcd_Write_Data((FPS>>8)&$00FF) ' //Set FPS Lcd_Write_Data(FPS&$00FF) ' Lcd_Write_Com ($00BA) ' Lcd_Write_Data($0005) ' //GPIO[3:0] out 1 Lcd_Write_Com ($00B8) ' Lcd_Write_Data($0007) ' //GPIO3=input, GPIO[2:0]=output Lcd_Write_Data($0001) ' //GPIO0 normal Lcd_Write_Com ($0036) ' //rotation Lcd_Write_Data($0021) ' 3 is 180 Lcd_Write_Com ($00F0) ' //pixel data interface Lcd_Write_Data($0003) ' 16 bit / 565 pause1ms(5) Lcd_Write_Com ($0029) ' //display on Lcd_Write_Com ($00d0) ' //dynamic backlight Lcd_Write_Data($000d) Lcd_Write_Com($002c) LCD_RS_High
and the c example that came from the lcd
[code]#include <reg51.h>
#include <intrins.h>
#include <font\font.h>
#include <sys\sys.h>
#include <lcd\lcd.h>
/* http://ttmcu.taobao.com
Comments
Sorry I have not had a chance to reply. Very busy as of late. Maybe high byte needs pull-downs instead of pull-ups? I would try this first. If I get a chance, I'll try to take a look at your code. No promises though.
A side note, I've been revising the Touchburger and will be using different memory chips :http://www.digikey.com/product-detail/en/IS62WV51216BLL-55TLI/706-1048-ND/1555421 These might be of interest to you as well. Glue logic will be replaced with CPLD. More info when testing complete!
Good luck!
I have tryied pulling the hi bytes , Up and down , both with the same non working result .
Beeing verry bussy also , I have yet to jump into reading the datasheets again to try to find more things wrong ,.
The new memory doesnt seem to bad , but what are the advantages over having 2x a byte SRAM .
Think ill see that when you let some more info on that
the CPLD, Never heard of that before till now , taking its going to replace the counters etc , so less glue logic is always a good idea
did find some nice explination about CPLD here
but I think ill have to see that and schematics before I could understand it , in the range of an fpga device , sounds logic to mee
Ill try following your posts. Busy day today . probably tomorrow ill give it a new shot to get the screen to ini..
Your the best Average Joe , Thanks . :thumb:
OK, I was shaking the screen a bit . Now it looks like i Do have the Inni . Yuppiejeeee
Dammm I have to runn no more time for now , Ill get back to it ASAP .
a shot of it
Next op . Drawing something on it
The advantage of using the new memory is two-fold. Should simplify logic and replaces 2 chips with one.
Gotta run, post schematic and code!
powerd with 3.3 volt (at the moment, sd card needs 5v)
on the lcd module I removed the R4 resistor , and I bridged J1 and J3 to make it work ,.
From the LCD connect D0-D7 to P0-P7 of the propeler
D8-D15 are pulled low with a 10k Resistor
chose any 4 more pins for CS_PIN , WR_PIN , RS_PIN, REST_PIN to controll the lcd .
And now you have the simplest connection of the lcd module to the propeller . Verry slow interface *** a result ,
But I did get it to INNI . That was the main problem before .
the settings are set now for a 8bit color pixel , and a 8 bit bus .
so need to change those back before trying to make it work with a 16 bit bus,
The fix to what was wrong before was that I was only toggeling WR to get the data in , forgetting CS
EDIT: On second thouth , I think Ill just select the lcd first by pulling CS low , and toggle only WR . it was like that in the schatic also so sould work out fine
Ill be moving back to the SRAM pretty soon to get it running faster . still some things not realy happening like I want .
trying to figure out why ,.
e.g. trying to get a full screen of 1 color causes the display to start to show fuzzy image , see vid 2
did get the screen filled up with blocks without it getting fuzzy (vid1) , ?something there ?
and average joe comming up with a brilliant solution to minimize the logic ic needed to run the SRAM.
Hopefully he is willing to share pretty soon.
in the mean time ill be building back the schematic I had before to see if it will work now . If I can find the time
wish me luck
TIP: Disconnect the Serial programmer after loading in a new program may be a verry helpfull thing , *** the LCD modules get just enoug current from the usb to keep the memory running even if the board is turned off.
Hoping to get it working with the Touchburger code , so I dont have to reinvent the weel for getting a image from sd card etc. will take its time off course
Full Code
I really recommend using the new memory chip. You would still need the '245s, but might be able to simplify the rest of the gating.
The CPLD design will need a 1.8v rail. Not sure if this is a deal breaker for you. I will have JTAG programmer in the morning so verifying design soon. Then I can share what I've learned.
For my purposes, P18 = disp/WR ---> OR dispENbit *latch ---> disp/CS.
Thinking about using P19 for /RS.
P20 will only be used as clock for Group1-Load.
Count-enable in Group2, /RAM-CS...
Group2, Group4 are latchbits? 1,3,5,6,7,8,9, dispRESET are from 138...
I may absorb more function control into the CPLD, just want to get it working before I start introducing more unknowns. Here's an early iteration:
The board should look something like this :
Cost is about the same, way smaller board. External power-supply.
I think the 8-bit interface would benefit from the CPLD and memory chip as well. Some things to think about!
Ok the toggeling of both lines may help the issue. I think I have to build the schematic back up to try it out .
Just not sure what I sould do about the logics ic yet. The Memory I will order one of those to keep the parts the same *** you , Verry handy
1.8V not a that big of a deal ,
Mind giving me a part number on the CPLD. Ill try ordering them , and reading the data to cath up
what kind of code does the CPLD run on, any develpment software that are needed for it , or will simple ide do the job ?
It does make for a pretty slick design indeed . Looking forward to seeing that work
http://www.rayslogic.com/Propeller/Products/DviGraphics/DVI.htm
Maybe you could modify the settings to use a 7" display....