TFTv2 library

jbcard
Posts: 22
Joined: Mon Feb 04, 2013 2:10 pm

TFTv2 library

Post by jbcard » Fri Nov 20, 2015 11:03 pm

I try to write the FTFv2 library of energia platform to fubarinoSD.
My problem is the instructions in original library.

Code: Select all

#define portOutputRegister(x) (regtype)portBASERegister(x)
#define cbi_macro(reg, mask) GPIOPinWrite(reg, mask, 0)
#define sbi_macro(reg, mask) GPIOPinWrite(reg, mask, mask)
 
error message :
ILI9341_energia_master\FastDigitalWrite.cpp:34:15: error: 'portBASERegister' was not declared in this scope
C:\mpide-0023-windows-20140821\.\hardware\pic32\libraries\ILI9341_energia_master\FastDigitalWrite.cpp:41:5: error: 'GPIOPinWrite' was not declared in this scope

Have you an equivalent for fubarino ?

jbcard

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: TFTv2 library

Post by majenko » Sat Nov 21, 2015 1:06 am

The energia library is specific to energia boards - it would take quite a bit of work to port it.

What exactly are you trying to do at the moment?
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

jbcard
Posts: 22
Joined: Mon Feb 04, 2013 2:10 pm

Re: TFTv2 library

Post by jbcard » Sat Nov 21, 2015 9:05 pm

TFTv2 uses fast writing routines with Fast DigitalWrite.ccp but with PIC is not really useful. I'll see how not to use it at first.
The TFTv2 library at https://github.com/Seeed-Studio/TFT_Tou ... 0c/TFTv2.h
done my response.

jbcard

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: TFTv2 library

Post by majenko » Sat Nov 21, 2015 9:46 pm

What screen are you working with? It may be supported by DisplayCore (http://displaycore.org) and that sometimes (depending on screen) can use the PMP connection for blisteringly fast IO to the displays - faster even that can be achieved with direct port manipulation.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

jbcard
Posts: 22
Joined: Mon Feb 04, 2013 2:10 pm

Re: TFTv2 library

Post by jbcard » Sat Nov 21, 2015 10:02 pm

The screen is QVGA 2.2 TFT SPI 240*320.

jbcard
Posts: 22
Joined: Mon Feb 04, 2013 2:10 pm

Re: TFTv2 library

Post by jbcard » Sat Nov 21, 2015 10:05 pm

With ILI9341 processor

User avatar
majenko
Site Admin
Posts: 2165
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: TFTv2 library

Post by majenko » Sat Nov 21, 2015 10:34 pm

If it's SPI then no amount of fast direct port IO is going to speed things up - it'll be slow no matter what.

I have ILI9340 support in DisplayCore, but not the ILI9341 yet.
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

jbcard
Posts: 22
Joined: Mon Feb 04, 2013 2:10 pm

Re: TFTv2 library

Post by jbcard » Sun Nov 22, 2015 7:10 pm

Ok majenko,

You have this text if you want.

http://www.wdflcd.com/xz/ILI9341_AN_V0.6_20110311.pdf

pito
Posts: 193
Joined: Sun May 22, 2011 9:37 pm

Re: TFTv2 library

Post by pito » Sun Nov 22, 2015 10:34 pm

Use the native SPI instead of "SPI bitbanging". Ili9340 is obsolete, 9341 is newer and almost identical. With SPI on SD you can go 20-30MHz provided ili supports it. WIll work fine for text and graphics, no video via SPI, however..

jbcard
Posts: 22
Joined: Mon Feb 04, 2013 2:10 pm

Re: TFTv2 library

Post by jbcard » Sun Nov 22, 2015 11:02 pm

On the code for Energia is wrote

Code: Select all

SPI.begin();
SPI.setDataMode(SPI_MODE0);
SPI.setClockDivider(2); 
I don't know "SPI bitbanging". Have you an example ?

Post Reply