I leave the library to use ST7789 TFT display, I have translated one that is in C language. But unfortunately I have not been able to get it to work yet. I leave the files in case someone with more experience with these displays can review it.
Hi I,
Yes, RASET confused me, in the CODE it's PASET, no RASET?
I have Call SPI_sendcmd(ST77XX_RASET) //Row addr set ? ] commented out, I can't remember if I changed it to get it to compile?
C
Hi I,
I just used your CODE within mine, and much of this didn't compile?
---------------------------------------------
If x >= width Then
x=x0
y = y + size
If(y>=height)Break;//
LCD_ShowChar(x,y,*P,size,1);
x+=size/2;
P++;
Wend
-------------------------
C
Hi I,
Yes, well done.
I'll just keep trying, and look for the differences, or use my OSC and SPI set up.
I'll also recheck my wiring. I could add a digital anayliser to see what the SPI is doing.
C.
Mine just has a wire to 3V as there is a current limit resistor on mine... To be safe
the circuit on mine has a 1k into a NPN with a 3R9 to ground.. so a 3v supply will turn it on.
If your screen is white, then its working or you wouldn't see anything.. If it was initializing the screen would have a random mess all over the screen until you clear it.
Mine just has a wire to 3V as there is a current limit resistor on mine... To be safe
the circuit on mine has a 1k into a NPN with a 3R9 to ground.. so a 3v supply will turn it on.
If your screen is white, then its working or you wouldn't see anything.. If it was initializing the screen would have a random mess all over the screen until you clear it.
Hi I,
Mine has a 3.3v rack, that I switch on, and it goes white, then it goes messy as you say. This is with my set up, but I'm trying your OSC at the moment.
I always have trouble with SDO and SDI! Is the TFT_SDI MOSI or MISO (Master Out Save In)?
EDIT: I think I've figured out SDO on the screen TFT_SDO = MISO
C
One other thing... may be important. Some of these initialize wrong so you may need to try rotation.
the MADCTL does this.... MY up'ends the rows.. MV up'ends the columns MV exchanges them.
ML up'ends the vertical refresh, MH up'ends the Horizontal refresh .. Up'ends is my way of saying it draws the pixels backwards..
_________________________________________ | MY | MX | MV | ML | BGR | MH | X | X | // 0x36
I set mine to 0x8 as the colors are inverted
Swap the 0x8 in my code to 0x48..
if it don't work swap it back... Funnily enough the code I pinched had 0x48 in the init.
One other thing... may be important. Some of these initialize wrong so you may need to try rotation.
the MADCTL does this.... MY up'ends the rows.. MV up'ends the columns MV exchanges them.
ML up'ends the vertical refresh, MH up'ends the Horizontal refresh .. Up'ends is my way of saying it draws the pixels backwards..
_________________________________________ | MY | MX | MV | ML | BGR | MH | X | X | // 0x36
I set mine to 0x8 as the colors are inverted
Swap the 0x8 in my code to 0x48..
if it don't work swap it back... Funnily enough the code I pinched had 0x48 in the init.
Hi I,
Thanks.
I have added a digital analyser, and it's showing the CLK is not equal 'ticks'. This is happening even with any of my old 'other' programs too. I'll have to sort this out first.
C
Sorry about my absence, but I was in Edinburgh last week.. Mini hiliday.
I need to email Vlad as there doesn't seem to be a "large table" function.
I remember now, this is where I fell last time! I need to store the character set in ROM, but messing with lookup or CONST is a bad way forward.. I could lob an ASM table lookup into the code, but that doesn't help you.
Sorry about my absence, but I was in Edinburgh last week.. Mini hiliday.
I need to email Vlad as there doesn't seem to be a "large table" function.
I remember now, this is where I fell last time! I need to store the character set in ROM, but messing with lookup or CONST is a bad way forward.. I could lob an ASM table lookup into the code, but that doesn't help you.
Hi D,
I think you are referring to Ian, as my lack of ability, means I can't keep up.
I am only able to use programs when they are working or just need a little coaxing.
When you are both happy with your system will you post all of it in one post please?
I can see that you're both making interesting CODE, thanks.
C
Hi C.. We haven't got oodles of resources... That is why I'm concerned that a font set will take up too much space.
an 8 x 8 font has 127 characters. 1 k of memory.. BUT!! its so small on a TFT LCD you'll only just be able to read it.. So a double size height 16 x 16 takes 4k of code space.. Again a small font but readable.
The fonts I use on a 128 x128 screen are 8x8... 12 x 16 and 24 x 33 so forget the 8x8 unless you have 20:20 vision. 24 x 33 will be 12.5k + the 4k for the nearly readable..
Now factor in the lookup tables 25 bytes per lookup .. that another 4k per font.. 24k for just two fonts..
Now we could just resize fonts but at 24x24 they will look like 8bit graphics.
If I could create a large table it minimizes the code space..
First I will create a font using lookups and print something on screen.