Spi and Displays
Just a thought here on SPI displays
Not sure how to put this elegantly but it seems to me that the display driver can be made to resemble a VGA monitor in its working principle. The VGA dot clock at about 25 mhz. is kind of like the serial clock and with the wrap around effect, it appears you can send the color bits row by row as you would send the pixels to a monitor.
The display I have is 320 x 480 so that would mean 153_600 pixels. With 16 bits per pixel that would mean a screen map of 307.2 KB. It appears to be more than what the Prop has on the die.
I don't suppose I can use a shorter color word as the old monochrome monitors did.
Just a thought at this point, but maybe someone has something constructive to add. I have been looking at Clauso's driver for his smaller LCD and will see if I can convert it to the size I have. I haven't got very far into it, just went over the low-level drivers, but it appears that he is moving the row and column address to draw a line.
Comments
https://forums.parallax.com/discussion/172370/lcd-graphics-text-driver-for-cheap-spi-lcds-with-optional-touch-screen-support/p1
https://parallax.com/320x240-lcd-driver-for-ili9341-controller-and-xpt2046-touch-screen/
https://forums.parallax.com/discussion/173062/p2-quick-byte-320-240-lcd-driver-for-ili9341-controller-and-xpt2046-touch-screen#latest
https://forums.parallax.com/discussion/172924/multiport-serial-lcd-text-drivers-with-common-format-i-o-object-similar-to-jm-fullduplexserial/p1?new=1
@ManAtWork fixed some timing errors but not sure which thread those fixes were posted.
Mr. Cluso99
I tried using your code for the ILI9163C and it didn't work the first time around. It appears that I have a very similar chip. I checked the datasheet for the ST7796S which is what I have on my 480*320 display.
It appears all of the command registers are similar, with the exception of:
LCD_GAMMA_SET
LCD_COLOR_SPACE
I checked to make sure that all the register addresses match, and it appears they do, and going with the defaults works sometimes, so at this point trying to get it show me sign.
I also tried the downloading the code for Arduino and couldn't get that working either, but I have never used Arduino prior to yesterday.
I don't know if you had to work out some serious bugs here, but this thing seems to have a mind of its own.
After the lcdInit
clearScreen appears to start and I see white lines slowly coming in except they are from bottom to top right to left if looking at the screen in landscape orientation.
Tried to make some adjustments in the MADCTR register MY,MX,MV but that has no effect.
So after sweeping for a little more than half screen, the entire screen finally goes white.
Then I have your setWindow(xs,ys,xe,ye)
followed with fillWindow(RGB) | i,n
but not sure what is going on since the colors don't seem to display, as when I change the color in clearScreen I only get black or white showing. Sounds maybe like some kind of color correction needs to be made.
Does this sound like your dream job?
@NickMikhay
My 480x320 4.0" has an ST7796S so it should be good to go.
I presume you checked both the demo and driver use the same settings.
Just in case the code has something to do with driving the display out of spec ( @ManAtWork found some timing issues ), try slowing the _clkfreq to 20_000_000 (20MHz) in the Demo code.
The latest driver version is on github, but it's for the P2.
https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/ili9341
Does anyone know what this means, I am not sure how to interpret?
`CON
''
'' =0 =1 =2 =3`
Yes. Those are enumerated constants.
is a short form of:
thanks
Looking at the SPI for Prop1 Code
CON
_clkmode = xtal1 + pll4x 'Standard clock mode * crystal frequency = 20 MHz
_xinfreq = 5_000_000
PUB start(_ClockDelay, _ClockState)
ClockState := _ClockState
ClockDelay := ((clkfreq / 100000 * _ClockDelay) - 4296) #> 381
It appears as though the ClockDelay variable is dependent on the clkfreq, however when I change the multiplier in CON block, I end up with the same clock frequency on the output line.
@NickMikhay
Sorry, I didn't realise I was on the P1 section.
So you can compare the P1 1.44" code with the P2 4.0" code and change the spin code accordingly. You will need to keep the P1 pasm code untouched, except maybe the resolution parts.