PDA

View Full Version : Newbie SPI question



Scampy
- 6th June 2015, 01:11
Before I part with cash to get an SPI TFT display, I would like some advice on how the SPI works, and is it similar to using LCDout or i2cwrite commands ?

For example can I send something like shiftout address, command, X, Y ["hello world"] ??

Whilst I know is graphical, but basically I'm only requiring the ability to display text to the screen

richard
- 6th June 2015, 02:10
can you post a link to the display under consideration, the 2 or 3 that I'm using have no on board cga rom at all

Scampy
- 6th June 2015, 02:43
Just a cheap one on e-bay.... http://www.ebay.co.uk/itm/271799941176?_trksid=p2060353.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT

I'm guessing that these TFT's need some form of on-board character set similar to normal LCDs, and this one won't have that ?

I have come across a larger display in the US that supports i2c, and seems to have font chip options, so for displaying text http://www.buydisplay.com/default/4-3-tft-lcd-display-module-controller-board-w-serial-spi-i2c-mcu - lot more expensive, but around the same price as a normal mono 128 x 64 GLCD and i2c piggyback module (see previous thread http://www.picbasic.co.uk/forum/showthread.php?t=20033 ) - and I have more space and colour to play with

I've played with i2c and I'm hoping that the latter display module would simply accept a normal i2cwrite - pin - pin - address- command or position, ["text"] format ?

richard
- 6th June 2015, 05:24
malcom
about 3 years ago I got one of these
http://www.ebay.com.au/itm/SainSmart-Mega-2560-R3-3-2-TFT-Touch-LCD-SD-Reader-TFT-Shield-For-Arduino-/230981596112?pt=LH_DefaultDomain_15&hash=item35c79373d0
it worked first time ,its easy to use and superfast (compared to pic18) heaps of fonts , touch screen . and its still going perfectly , when I think of the struggles I have had getting glcd's to even function with pbp and compare it against this stuff I now say why even bother .really this stuff leaves pics and pbp for dead .
still maybe as a forum we could come up with something like our own mono 64x128 glcd (or a colour 240x320 if we're keen) with a couple of fonts and a hardware spi I/f (2way spi transfers are handy for fancy graphic functions like blinking) I know its been done and commercially available but it could be fun as a standalone device or a "include " for members . it certainly seems pbp development is stalled if not abandoned and will not provide any sort of functionality for contemporary display technology

richard
- 6th June 2015, 07:13
I bought one of these
http://www.ebay.com.au/itm/191534577067?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT $6au
plus the one you were looking at $7au

they're on the slow boat from china (2-3 weeks) I'm going to have a go

Scampy
- 6th June 2015, 11:50
Yeah, I stumbled across lots of Arduino shields, but really wanted to steer away from loads of boards to piggyback on the screen just to display the text I need. Besides, whilst there are loads of options for arduino's and from Mikroelektronica etc to make things simple, it means there is one (or more) less to develop a solution under picBasic Pro, and without that sort of support, PBP will soon be left further behind it's competitors than what it already is.

It would be really good to see how you get on with those screens... and if a TFT "library" for SPI TFT's screens can be developed, even better

HenrikOlsson
- 6th June 2015, 18:46
It's not a "library" or "driver" for "SPI TFT screens" that is needed. It's a "library" or "driver" for the controller used on the particular screen. And guess what....there are MANY different types of controllers and MANY different screen sizes....

Arduino has support for a lot of stuff because the community has developed stuff for it - some good, some not as good (as with most things). The point I'm trying to make is that don't blame PBP for what its users (the community) aren't capable of doing.

I've tried to make some simple graphics display driver at least twice (for two different controllers) and given up half way thru, it's MY fault, not PBP.

/Henrik.

Scampy
- 7th June 2015, 01:18
Henrik,

I'm not blaming anyone, and I understand the minefield that is out there in the domain with lots of different controllers for lots of different screens, and even some controllers are different and have three or more variations... so I quite agree with the task at hand should someone try and venture down that route. But you have also backed up my point. The Arduino community develop "stuff" for technology as it comes out and then the more it gets used the better or improved versions if library files appear. MikroElektronika, whilst being a commercial organisation try to keep abreast of technology and constantly update the range of products with associated library files and software to aid the use of the hardware. I don't know what it is in the PBP camp, but for me at least it feels that it's now lagging behind. Even this forum is slow compared to a few years back. I know a lot of the old school folk like yourself have either moved on, or passed on (RIP DT :( ), and you guys give us less knowledgeable folk excellent support, but the developers of PBP seem to be lagging behind.

I've not had the opportunity to see what new commands (if any) are available in PBP3, but are there commands for Ethernet, Wi-Fi, TFT screens, etc that would make coding for these devices, (which lets face it have been around for years now) a lot easier. I mean the principles and protocols for things like ethernet are the same regardless of what platform you are using... so it shouldn't (IMO) bee that difficult.

I love PBP. its syntax is very easy to understand, debugging a line of code to work out what's missing in the statement is simple, the manual is a good reference, and there are folk like you who are willing to offer assistance (both on and off board) to resolve issues or develop include files to help others in the future. I don't want to jump ship and just because other platforms have a library to do a set function, or work with a bit of hardware I want to use. But equally I don't like being stuck in the dark ages having to use serial comms, and basic LCD's because that's all that PBP has to offer.

Sorry for the rant, and it's a tad off topic, and hope that you don't take offence over my PBO "bashing" !!

richard
- 7th June 2015, 02:40
I agree with malcom , but its seems the only way forward for now is to help ourselves.
a simple start with one or both of the previously mentioned devices (spi versions only ) on a pic18 with a chr(32 to 90 ) ( space to Z) 8x8 font (in program memory) using hardware spi and a simple background/foreground colour scheme . I think this is achievable especially with a few participants involved .
I'm in anyone else ?

Gusse
- 7th June 2015, 10:20
Have you checked LCD Wiki pages (http://www.picbasic.co.uk/forum/content.php?r=73-LCD)?
There are most of the stuff you need available. Only thing you need to do is modify LCD controller specific parts to match your LCD display (e.g LCD init, std commands, etc...).

If there are Arduino C-codes available for your LCD controllers, then it is even easier to port code to PBP. C and PBP are very similar, only systax is different.
Other method is to read programmers manual and figure out all necessary part of the code from there (hard way).

I could be interested to port my LCD projects to some newer LCD (from monochrome Nokia 3310 LCD, which is still very usable).

LCD module requirements:
- some commonly used LCD (code available in Arduino platform, etc...)
- touch screen functionality (or same LCD controller in modules w and w/o touch screen support).
- SPI (LCD) /I2C (touch) interface
- ~2-3" size

Code could be developed/shared in GitHub to track history and bugs if multiple persons are involved.
I could start participating later on autumn, due to fact that summer is very short here -> I have other activities than coding and debugging ;)