I believe I may be able to help you. First, I would need to know more about the actual implementation. Parallel data interface? 8/16 bit? External memory. Propeller board? I have a few boards from the GUI thread still available if you don't already have a hardware implementation.
Also, could you tell more about what you intend to display?
I am using the propeller chip on my own board and the quickstart. The problem that I am having is to port over the c code from newhaven. I am looking for simple examples sans assembly code so I can just get started and simply change the color on the display. Once I get that done I am sure I can work my way from there.
Simplified draw, sets up area of display to draw to
PUB Draw(x1, y1, x2, y2) ' sets the pixel to x1,y1 and then fills the next (x2-x1)*(y2-y1) pixels
ifnot orientation ' landscape mode so swap x and y
result :=x1 ' swap x1 and y1x1 := y1y1 := result
result := x2 ' swap x2 and y2x2 :=y2y2 := result
Lcd_Write_Com($002A)
Lcd_Write_Data(x1>>8)
Lcd_Write_Data(x1&$ff)
Lcd_Write_Data(x2>>8)
Lcd_Write_Data(x2&$ff)
Lcd_Write_Com($002B)
Lcd_Write_Data(y1>>8)
Lcd_Write_Data(y1&$ff)
Lcd_Write_Data(y2>>8)
Lcd_Write_Data(y2&$ff)
Lcd_Write_Com($002c)
LCD_RS_High
This will output a pixel to the display
PUB Pixel(pixelcolor) ' send out a pixel'' it is more efficent to send one Draw command then lots of pixels than sending individual pixels'' but of course, you can send draw x,y,x,y where x and y are the same and then send one pixel
Lcd_Write_Fast_Data(pixelcolor) ' need to set RS high at beginning of this group (ie call Draw first)
PRI Lcd_Write_Fast_Data(LCDlong) ' write RS elsewhere then skip the RS above as this is a latch output and takes longer
LCD_Writ_Bus(LCDlong)
This will print the PropFont to the display
PUBPropfont_out(ascii) | address,pixels
Draw(curx,cury,curx+15,cury+31) ' location to start drawing
address := $8000 + (ascii >> 1) << 7' get rom addressrepeat32' 32 rows per character, split in two parts
pixels := long[address] ' get rom font data
pixels := pixels >> (ascii & 1) ' shift for odd charactersrepeat16' 16 columnsif pixels & 1
Pixel(%00000111_11100000) ' foreground color RRRRRGGG_GGGBBBBBelse
Pixel(%00000000_00000000) ' background color
pixels := pixels >> 2' alternate pixels interleaved so shift 2
address += 4
curx +=16if curx > screenWidth ' new line should be curx + 16 to align for next char.
Propfontcrlf
There's a bunch of stuff missing. Hopefully this will get you started! This is for 16-bit mode. If you are using 8-bit mode the initialization changes and I don't have a working 8-bit implementation at the moment.
I need to have a look at this project again. (I think some of that code might be stuff I wrote and it is hardware dependent). Fundamentally there are not enough pins on a propeller to drive these displays properly, and if you want the speed it is worth adding external ram chips (30ms to update a screen, vs about 30 seconds). I have an idea for a two propeller / two ram chip solution where the second propeller mainly does the address counting on the ram chips. I'll fire up Eagle in the next few days and see if I can get a schematic drawn.
This is Dr A's code. The hardware dependence should all lie in the second code block. Except for PRI LCD_Writ_Bus(LCDLong). That second code block should be all that needs to be changed
I have used some of the code from
Averag Joe I found it from an older post. All I get are funky lines. I have commented out the circles and squares so as to start with just
one thing. Just get funky lines. I will post the arduino code that Newhaven sent me. It makes sense but somehow still not working.
Thanks for the help will let y'all know.
Without seeing the code you are using, I can't begin to guess what the problem is. BUT YOU HAVE LINES ON SCREEN!!! That means the display is at least initialized. Please post the code you are using! So step 1 is complete (initializing the display). Step 2 is getting pixels. To draw a full screen of solid color.
draw(x,y) ' full screenRepeat
pixel($0)
Depending on several factors * 8 bit mode / 16 bit mode) you may need to change initialization settings. Without schematic, code, I would just be taking shots in the dark. It could be as simple as a bad PASM driver and we would end up chasing our tails for days...
I am having problems initiating this code. I get pixels to the left and black to the right. Have tried many combinations but not working well. I can change color and width but not get full screen. Solomon application note contradicts their manual. Nothing new.
made some progress. getting full screen but still not painting consistently. Used some akula code, thanks to him , and reviewed ray's logic but not painting well
Are you using it as a C library? Or did you convert it? Can I take a look at it? I'm trying to get a SSD1963 driver together in SPIN and could see how it works.
Toward the bottom of this pager are a bunch of examples.
One is for 4.3" screen and one is for 5" screen with same resolution that pilot wants to do...
These are both with 8080 8-bit connection to Prop.
Also, they use 24-bit connection between SSD and LCD.
You may have to tweak some of the timings, depending on your LCD.
Also, you need to change Prop pin setting to match your setup.
I've been away for a while but I was able to fire up my board a couple days ago and get things sort-of running. As soon as I sort out some issues, hopefully I can help you track down some of yours. I have issues with initialization myself, as well as some improvements that need to be made. Since it seems like there are a few people using these displays with various hardware, I suggest we come up with some sort of low-level interface standards where a simple driver change can allow different hardware / display combos. Then, all higher level code can interface with a standard API that likely includes an SD object..
I'm not really a C guy, although I've been forced to brush up on my essential skills. I'd like to explore running touch.spin through the interactive C tool. Going to download in a few.
Still got 15 bare touchburger boards if anyone wants one. It's all through hole and fairly easy to source. I'll make it yours for the cost of shipping! Not trying to hijack your thread but I've been away for awhile. Kudos for sticking with it! Hopefully I can help out, I'm digesting the info you posted. Have my board live with a couple different displays (and even a PI+ official 7" touchscreen) and even have a few arduinos laying around to play with and blog up at some point. I'm focusing my development on 7" displays but it uses the same controller. So probably a couple register changes between the display... Now, if only the manual was correct. If you get stuck, look at the c code for the arduino. I found a misdocumented register but can remember exactly what.
Comments
Also, could you tell more about what you intend to display?
*MODS*
Could you more to P1 forum please?
'' DISPLAY SETTINGS DAT VDP long 479 HDP long 799 HT long 928 HPS long 46 LPS long 15 VT long 525 VPS long 16 FPS long 8 HPW long 48 VPW long 16 PRI Start_SSD1963 DisplayEnable ' enable one or both displays LCD_Reset_High pause1ms(5) LCD_Reset_Low pause1ms(5) LCD_Reset_High LCD_CS_High LCD_WR_High pause1ms(5) Lcd_Write_Com ($00E2) ' //PLL multiplier, set PLL clock to 120M Lcd_Write_Data($0023) ' //N=0x36 for 6.5M, 0x23 for 10M crystal ' $21?? Lcd_Write_Data($0002) ' Lcd_Write_Data($0054) ' dummy byte? Lcd_Write_Com ($00E0) ' // PLL enable Lcd_Write_Data($0001) ' set pll ' pause1ms(1) ' Lcd_Write_Com ($00E0) ' pll ' Lcd_Write_Data($0003) ' lock pause1ms(5) Lcd_Write_Com ($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 PRI Displaycmd(c,d) ' instruction in one method Lcd_Write_Com(c) ' send out a word Lcd_Write_Data(d) PRI Lcd_Write_Com(LCDlong) LCD_RS_low ' can do rs first then cs - better for latch board LCD_Writ_Bus(LCDlong) PRI Lcd_Write_Data(LCDlong) LCD_RS_High ' can do rs first then cs LCD_Writ_Bus(LCDlong) PRI LCD_Writ_Bus(LCDLong) 'LCDLong &= %00000000_00000000_11111111_11111111 ' mask to a word. Not needed if care taken always to send a word value OUTA &= %11111111_11111111_00000000_00000000 ' set P0-P15 to zero ready to OR OUTA |= LCDLong ' merge with the word to output LCD_WR_CS_Low ' send out the data LCD_WR_CS_High
This will all need to change depending on the pin configuration
PRI LCD_WR_CS_Low OUTA &= %11111111_11110011_11111111_11111111 ' p18 low PRI LCD_WR_CS_High OUTA |= %00000000_00001100_00000000_00000000 ' p18 high PRI LCD_CS_Low OUTA &= %11111111_11110111_11111111_11111111 ' p19 low PRI LCD_WR_Low OUTA &= %11111111_11111011_11111111_11111111 ' p18 low PRI LCD_WR_High OUTA |= %00000000_00000100_00000000_00000000 ' p18 high PRI LCD_CS_High OUTA |= %00000000_00001000_00000000_00000000 ' p19 high PRI LCD_RESET_Low ' reset low RAM.Latch_ResetLow PRI LCD_RESET_High RAM.Latch_ResetHigh PRI LCD_RS_Low ' for historical reasons this subroutine calls another RAM.Latch_RS_Low PRI LCD_RS_High RAM.Latch_RS_High
Simplified draw, sets up area of display to draw toPUB Draw(x1, y1, x2, y2) ' sets the pixel to x1,y1 and then fills the next (x2-x1)*(y2-y1) pixels ifnot orientation ' landscape mode so swap x and y result :=x1 ' swap x1 and y1 x1 := y1 y1 := result result := x2 ' swap x2 and y2 x2 :=y2 y2 := result Lcd_Write_Com($002A) Lcd_Write_Data(x1>>8) Lcd_Write_Data(x1&$ff) Lcd_Write_Data(x2>>8) Lcd_Write_Data(x2&$ff) Lcd_Write_Com($002B) Lcd_Write_Data(y1>>8) Lcd_Write_Data(y1&$ff) Lcd_Write_Data(y2>>8) Lcd_Write_Data(y2&$ff) Lcd_Write_Com($002c) LCD_RS_High
This will output a pixel to the displayPUB Pixel(pixelcolor) ' send out a pixel '' it is more efficent to send one Draw command then lots of pixels than sending individual pixels '' but of course, you can send draw x,y,x,y where x and y are the same and then send one pixel Lcd_Write_Fast_Data(pixelcolor) ' need to set RS high at beginning of this group (ie call Draw first) PRI Lcd_Write_Fast_Data(LCDlong) ' write RS elsewhere then skip the RS above as this is a latch output and takes longer LCD_Writ_Bus(LCDlong)
This will print the PropFont to the display
PUB Propfont_out(ascii) | address,pixels Draw(curx,cury,curx+15,cury+31) ' location to start drawing address := $8000 + (ascii >> 1) << 7 ' get rom address repeat 32 ' 32 rows per character, split in two parts pixels := long[address] ' get rom font data pixels := pixels >> (ascii & 1) ' shift for odd characters repeat 16 ' 16 columns if pixels & 1 Pixel(%00000111_11100000) ' foreground color RRRRRGGG_GGGBBBBB else Pixel(%00000000_00000000) ' background color pixels := pixels >> 2 ' alternate pixels interleaved so shift 2 address += 4 curx +=16 if curx > screenWidth ' new line should be curx + 16 to align for next char. Propfontcrlf
There's a bunch of stuff missing. Hopefully this will get you started! This is for 16-bit mode. If you are using 8-bit mode the initialization changes and I don't have a working 8-bit implementation at the moment.
Averag Joe I found it from an older post. All I get are funky lines. I have commented out the circles and squares so as to start with just
one thing. Just get funky lines. I will post the arduino code that Newhaven sent me. It makes sense but somehow still not working.
Thanks for the help will let y'all know.
It's been a long time but, I remember I would have issues with this if /CS and /WR weren't toggled at the same time. Sounds like a timing issue...
Do you have access to a Logic Analyzer?
draw(x,y) ' full screen Repeat pixel($0)
Depending on several factors * 8 bit mode / 16 bit mode) you may need to change initialization settings. Without schematic, code, I would just be taking shots in the dark. It could be as simple as a bad PASM driver and we would end up chasing our tails for days...
Work seven days a week.
Will get back thanks for the help.
Thanks
I have some nice code for 4.3" now...
Rayman thats exactly the size I am hoping to try out as well. 4.3" SSD1963, 8080 parallel.
http://www.rayslogic.com/Propeller/Products/DviGraphics/DVI.htm
Toward the bottom of this pager are a bunch of examples.
One is for 4.3" screen and one is for 5" screen with same resolution that pilot wants to do...
These are both with 8080 8-bit connection to Prop.
Also, they use 24-bit connection between SSD and LCD.
You may have to tweak some of the timings, depending on your LCD.
Also, you need to change Prop pin setting to match your setup.
I'm not really a C guy, although I've been forced to brush up on my essential skills. I'd like to explore running touch.spin through the interactive C tool. Going to download in a few.
Still got 15 bare touchburger boards if anyone wants one. It's all through hole and fairly easy to source. I'll make it yours for the cost of shipping! Not trying to hijack your thread but I've been away for awhile. Kudos for sticking with it! Hopefully I can help out, I'm digesting the info you posted. Have my board live with a couple different displays (and even a PI+ official 7" touchscreen) and even have a few arduinos laying around to play with and blog up at some point. I'm focusing my development on 7" displays but it uses the same controller. So probably a couple register changes between the display... Now, if only the manual was correct. If you get stuck, look at the c code for the arduino. I found a misdocumented register but can remember exactly what.
(I'm sure I'll be editing this later)
J