Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Using SPI on 3.5 display with FTDI FT800 controller.
Goto page 1, 2, 3  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
lander72

Bascom Member



Joined: 29 Jul 2007
Posts: 25
Location: Fraser Valley BC

canada.gif
PostPosted: Sun Feb 02, 2014 2:16 am    Post subject: Using SPI on 3.5 display with FTDI FT800 controller. Reply with quote

Hello Forum,

I have an ATmega8 breadboard to a 3.5 inch display from Digikey made by FTDICHIP.com

The wake-up routine looks to be OK since the backlighting on the display turns on after the code is run.

The area I need help in is that I am unable to get the display to put anything on the screen.

I have used other devices with SPI but only 1 byte commands so even just a second opinion on format would help.

In my remarks I have notes from the Data Sheet and Programmers Guide.

I think this Display might be of interest to others using BASCOM. It looks to have interesting widgets that don't need a powerful chip.

Regards Larry

(BASCOM-AVR version : 2.0.7.6 , Latest : 2.0.7.7 )
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Sun Feb 02, 2014 2:34 pm    Post subject: Reply with quote

Larry

I am in the process of doing the same with Bascom but a little later on.

I have spent quite a bit of time porting over FT800_SampleApp_1.0.c to PowerBasic using FTDI's MPSSE
interface cable running SPI on the PC and comunicating to a FTDI 5" VM800 LCD. It's a long way around doing it like this
but I wanted to learn to do SPI on the PC and I thought is was easier to learn and debug code on the PC before going to a Micro.
(still learning how to drive it!)

There are a few very nice demos going around displaying the amazing things you can do with the FT800, search on the net for GameDuino2 to get a feel of the features (also FTDI have some demos).

I will try and have a play with your code and see if I can do anything.

_________________
Peter
Back to top
View user's profile
lander72

Bascom Member



Joined: 29 Jul 2007
Posts: 25
Location: Fraser Valley BC

canada.gif
PostPosted: Mon Feb 03, 2014 1:39 am    Post subject: Reply with quote

Thanks Peter for the reply and suggestions.

I have sent an E-mail to FTDICHIP asking for a list of Hex commands to use with spiout.

Regards Larry
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Mon Feb 03, 2014 6:20 am    Post subject: removed attachment Reply with quote

Larry

They are all in the FTDI's Software Examples.

Here is a file which has most of the stuff you need but its in PowerBasic, just
change some of the '%' to 'Const'.

It's a real pain to try and convert some of this C/C++ over to Bascom (though I dislike C/C++).

I am just havng a look at your example code now.

Note: Deleted attachment, if you require the FT800 inc file get it from the post further down
which is for Bascom.

_________________
Peter


Last edited by PeterM on Sun Feb 09, 2014 12:00 am; edited 1 time in total
Back to top
View user's profile
nicofer

Bascom Member



Joined: 01 May 2013
Posts: 90
Location: GRJ

southafrica.gif
PostPosted: Wed Feb 05, 2014 7:41 am    Post subject: TFT spi Reply with quote

Hi
I know it is not 100 % related to the topic but has anybody used this display ? Any feedback ?


http://www.buydisplay.com/default/5-inch-tft-lcd-module-800x480-display-w-controller-i2c-serial-spi.html


Cheers

Nico
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Sat Feb 08, 2014 1:35 pm    Post subject: Reply with quote

Larry

Please try the attached file, change your port pins and make Const Wqvga = 0 (FT800_Eve.inc)

Spent days just trying to get it to work, converted a few sample programs and even compared
SPI data with a Logic Analyser having all the data output identical. But guess what I did!, I told the logic analyser software
to ignore the CS pin because at the time it would not display any byte numbers, at the end all I had to do is
manually controll the CS line and make NOSS=1 so then it worked! ......grrrrrhhhh (dumb idiot I am).

Anyway, all the code does is print a coloured circle in the centre of the display and changes colour
from White to Red.

It's a start.... code needs more improvement, still more routines are needed to make it fully usable.

_________________
Peter
Back to top
View user's profile
lander72

Bascom Member



Joined: 29 Jul 2007
Posts: 25
Location: Fraser Valley BC

canada.gif
PostPosted: Mon Feb 10, 2014 2:33 am    Post subject: Reply with quote

Hi Peter,

Thanks for all the work. I am out of town until Feb/14/14 and am looking forward to trying your code.
I struggle the most with getting a new piece of hardware to work so getting a red dot will be great.

Regards Larry
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Tue Feb 18, 2014 2:54 am    Post subject: Reply with quote

Larry

If you want to wait a little longer (1week) I will post a better alternative library of routines/demo's.

I am wanting to do this for myself anyway.... but had heaps of issues where the problem was the way
I handled the Chip Select line. The CS tells the FT800 when a new command and parameter is sent and
not as a signal for each SPIOUT/IN use.

_________________
Peter
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Thu Feb 20, 2014 1:17 pm    Post subject: Reply with quote

Larry

Here is a replacement version to the last one I posted.
Still needs many of the Copro Commands to be added but
it's good enough to start playing with.
(I also added Text and Numbers Subs)

_________________
Peter
Back to top
View user's profile
lander72

Bascom Member



Joined: 29 Jul 2007
Posts: 25
Location: Fraser Valley BC

canada.gif
PostPosted: Fri Feb 21, 2014 9:13 am    Post subject: Reply with quote

Hi Peter,

Just had a quick look at your updated code and see you added a number of prints to help understand the steps in
communication with the FT800. I look forward to working with it over the weekend. Thank-you very much for sharing.

Regards Larryjavascript:emoticon('Razz')
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Fri Feb 21, 2014 1:08 pm    Post subject: Reply with quote

Larry

Try this one as the last one had a small bug when printing text.

Sorry the code hardly has any comments, I concentrated
on getting it work and forgot to make it informative.

Some good doco from FTDI (you may already seen them)
http://www.ftdichip.com/Support/Documents/AppNotes/AN_240%20FT800%20From%20the%20Ground%20Up.pdf
http://www.ftdichip.com/Support/Documents/ProgramGuides/FT800%20Programmers%20Guide.pdf
http://www.ftdichip.com/Support/Documents/AppNotes/AN_259%20FT800%20Example%20with%208-bit%20MCU.pdf

_________________
Peter
Back to top
View user's profile
lander72

Bascom Member



Joined: 29 Jul 2007
Posts: 25
Location: Fraser Valley BC

canada.gif
PostPosted: Tue Mar 04, 2014 1:17 pm    Post subject: Reply with quote

Hi Peter,

I setup the same ATmega328 and external Crystal in your last code without the bug and now have a working 3.2 inch display.
I can't thank you enough for sharing your code! I was going for a bare bones approach and now have the framework for a Rolls Royce.
I have shied away from using Include files thinking they were too complex until I saw how you used it so effectively.

Best Regards Larry

javascript:emoticon('javascript:emoticon('')Razz')
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Tue Mar 04, 2014 2:07 pm    Post subject: Reply with quote

Larry

BTW which FT800 board are you using ?

Regarding Includes sometimes you can leave them in the main file
while developing and move them to a seperate file once debugging
and testing is finished, no point bloating the main file, keep it tidy and functional.

_________________
Peter
Back to top
View user's profile
lander72

Bascom Member



Joined: 29 Jul 2007
Posts: 25
Location: Fraser Valley BC

canada.gif
PostPosted: Wed Mar 05, 2014 3:14 am    Post subject: Reply with quote

HI Peter,

I have the VM800B35A-BK that I ordered from Digi-key for about $75.00 Canadian.
Now I see why your asking, I said that I was using a 3.2 inch display. Sorry I got it
wrong, the display is 3.5 but 320 X 240 pixels.

Regards Larry
Back to top
View user's profile
Per Svensson

Bascom Member



Joined: 03 Oct 2004
Posts: 235
Location: Gothenburg, Sweden

sweden.gif
PostPosted: Wed Mar 12, 2014 12:02 pm    Post subject: Reply with quote

Peter,

I saw this thread and read the conversation. It is a very competent dispaly approach made by FTDI.
Looks very much like HP and Tektronix back in the old days when mini-computers live VAX had no graphic, and
had to write graphic commands over RS232 or HPIB to a terminal or plotter. Our relatively weak AVR family is perfectly suited for offloading
by a graphic engine.
When I opened your code and saw all the frontwork you have done I decided to purchase two4LCD- FT843 and give it a try.
You have really made a good job here so I take my hat off, and wish to give some back to the community by the attached code.
What I have done is to move the parts of your code to the include file and also move those variables and constants that I found possible to move.
Hopefully this could be the embryo to a FT800 library that we can build on?
Someone has to be the moderator and code owner, and my hope is that you would like to be responsible for future releases?

Besides from moving some code to FT800-Eve.inc I also optimized your low-level calls to the SPI-routines. It was very much a question of swapping bytes
prior to calling SPIIN and SPIOUT with multiple bytes. I think I managed to double the speed or a bit less... There might be some more to gain but not much.

Some code in the beginning of the BAS-file is of course adapted to my hardware so everybody has to change it to suit their platform.
I also createc two new subs. Newpage() and Endpage(). Essentially a bundle of the code you already had created.

Another thing is that I have used a slightly modified compiler where Mark has introduced LOCAL CONSTANTS. (I am the ginneypig). If you run into trouble
concerning constant references you will have to fix that to compile in the standard way. (I don't use the old style anymore).
For those of you having SLA there is a version "2077 LOCAL CONST" if you dare.
Local constants will hopefully be standard later on.. ? Works very much the same as local variables inside subs.
So don't blame Mark if the code does not compile. Blame me. Then fix it Wink

Thanks for your good work!

/Per
Back to top
View user's profile Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum