[TUTORIALS] V-TFT beginners example projects

General discussion on Visual TFT Software.
Post Reply
Author
Message
Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

[TUTORIALS] V-TFT beginners example projects

#1 Post by Megahurts » 11 Oct 2013 10:30

Hi all,

I have been working on a simple example V-TFT project for the beginners to examine and I have put tutorial comments in the code files
about how V-TFT works and where to put your user code safely and what each user code area can be used for.

The example project shows how I made a custom mechanical wheel looking digit display. It looks like a classic cars odometer.
For this example, I have it acting as a event counter display, but you can change that if you want.
event_counter_screen1.jpg
event_counter_screen1.jpg (9 KiB) Viewed 20118 times
This custom display 'gadget' is the only way I have thought of to add and share custom components for V-TFT so far.
You can copy the objects from its one screen (or use the project as starting template for your projects), to your project by importing the screen.

There is one main routine that handles updating the wheel digits and easy to copy to other projects.

As a tutorial, it also includes example of sharing the main loop time to call routine for screen RESET buttons visual effect that is driven
by main loop calls that are flag controlled.

The RESET (counter value), button also has required second click to confirm proceed with resetting counter to zero safety feature example to examine.
All driven by flag controlled main loop to user code routines calling control.

It is easy to see how this is done so you can use methods in your own work too.

I have a BONUS pdf manual done for it that has some tips and tricks and complete with comments listing of the main program and events files code.

I still have a few things to do to the V-TFT project files, but you can get the examples pdf manual now to have a look over.

This V-TFT project examples hardware and software configuration is:
' * Test configuration:
' MCU: P32MX460F512L
' Dev.Board: MikroMMB_for_PIC32_hw_rev_1.10
' http://www.mikroe.com/mikromedia/pic32/
' Oscillator: 80000000 Hz
' SW: mikroBasic PRO for PIC32
' http://www.mikroe.com/mikrobasic/pic32/
V-TFT_Tutorial_4_Event_Counter_example.zip
(229.48 KiB) Downloaded 960 times
(sorry, but the pictures had to be reduced in quality a lot to get file size down so I could upload it here, when I put finished package on
Libstock it should be at full quality then)
Link to current tutorial PDF manuals and to Project Examples Libstock pages [added for first time viewers]

Updated Tutorial PDF: http://www.libstock.com/blog_docs/get/5 ... ter-tu.pdf

Libstock Example V-TFT Projects: http://www.libstock.com/projects/view/8 ... nt-counter

9/9/2014: New Advanced V-TFT Pointers Topic Tutorial project and 20 page PDF manual added to Libstock.
Example project is V-TFT for PIC32 mmB in mBASIC and can be gotten from here:

http://www.libstock.com/projects/view/1 ... t-tutorial

It includes all project source files, screen images, project screen export file and (older) 18 page PDF tutorial manual in the zip download.

You can get the newest PDF version of the manual at this link directly:
http://www.libstock.com/blog_docs/get/6 ... tft-st.pdf

Newest PDF version (1.01) has this project Program Flowcharts page:
Color_Flowcharts.jpg
Color_Flowcharts.jpg (369.29 KiB) Viewed 16600 times
Robert.
Last edited by Megahurts on 09 Sep 2014 11:02, edited 4 times in total.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

lejeff
Posts: 218
Joined: 04 Dec 2011 16:10
Location: France

Re: V-TFT beginners tutorial example project

#2 Post by lejeff » 11 Oct 2013 12:50

Great job, helpful comments

I really appreciate the way how you've managed the reset button/function, nice trick
I'm currently working on on multiscreen project with several peripherals and end user HW interfaces.

Do you have upload the full V-TFT project on libstck ?

MaGiK
Posts: 897
Joined: 19 Apr 2013 10:00

Re: V-TFT beginners tutorial example project

#3 Post by MaGiK » 11 Oct 2013 16:11

This is what I've been waiting for Robert!
Keep up the amazing work :D
Best Regards
My hobby is collecting MikroElektronika products.
Gotta catch them all!

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: V-TFT beginners tutorial example project

#4 Post by Megahurts » 11 Oct 2013 19:41

Thanks Guys,

I really hope this effort helps everyone with their introduction to V-TFT.
I had to shorten edit the PDF document though, to get its file size small enough to upload here.
There was a bunch of stuff I wanted to share with you all, but I was seeing double at the end of the editing so I just made sure the file was small enough to
upload and still contained the most important information.
I should get another cup of coffee and re-read what I did I guess. :lol:
So rest assured, I will continue the development of collecting useful information and putting out PDf documents (as a series I guess).
lejeff wrote:Great job, helpful comments

I really appreciate the way how you've managed the reset button/function, nice trick
I'm currently working on on multiscreen project with several peripherals and end user HW interfaces.

Do you have upload the full V-TFT project on libstck ?
Thanks lejeff, and sorry, no, I have not gotten it uploaded there yet.
I am fighting a weird problem with the events file and V-TFT.
V-TFT for some reason does not like the commenting I did in that file and every time I load the project into V-TFT, it causes that files size to be x4 times bigger
by making 4 copies of almost everything repeat in the file.
I don't want to give that problem to anyone else to deal with, so as soon as I get it solved, I'll post it there and post a notice here that it is available.
Glad you could still "see" what goes on with the reset button without the actual files to load in V-TFT by just looking at my code/comments.

I also apologize to those who may have a hard time getting thru all of those comment lines.
In my head, it is cool simple pictures, but before it gets to my fingers on the keyboard, I think the military training intercepts it and you see the results. :roll:

I will try to make better 'pictures' in the future, Robert.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

MicroMark
Posts: 181
Joined: 11 Feb 2011 17:22

Re: [TUTORIAL] V-TFT beginners example project

#5 Post by MicroMark » 11 Oct 2013 20:32

Great work Robert. :D
Thank you for sharing!

Toley
Posts: 922
Joined: 03 Sep 2008 16:17

Re: [TUTORIAL] V-TFT beginners example project

#6 Post by Toley » 11 Oct 2013 22:46

Very nice I'm sure it will be very usefull for a lot of peoples. Just a little remark, you should have added in the description compiler/language/CPU/Hardware the project is compiled for.
Serge T.
Learning is an endeless process but it must start somewhere!

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: [TUTORIAL] V-TFT beginners example project

#7 Post by Megahurts » 11 Oct 2013 23:47

Toley wrote:Very nice I'm sure it will be very usefull for a lot of peoples. Just a little remark, you should have added in the description compiler/language/CPU/Hardware the project is compiled for.
I am guessing you are referring to this threads first post?
If so, yes, you are right and I forgot :oops: to include that information in that post and I have fixed it, and thanks for pointing it out. :)

:!: :wink: That information is in the PDF document also.

Robert. B^)
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

Toley
Posts: 922
Joined: 03 Sep 2008 16:17

Re: [TUTORIAL] V-TFT beginners example project

#8 Post by Toley » 12 Oct 2013 00:17

I am guessing you are referring to this threads first post?
Yes, it's still not too late to edit it :wink:
Serge T.
Learning is an endeless process but it must start somewhere!

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

[TUTORIAL] V-TFT Flowcharts: Using The Main Loop

#9 Post by Megahurts » 12 Oct 2013 10:08

Hi,

{Edited for better thread usage}

Here are the flowcharts from the pdf manual about sharing the V-TFT main loop for your own Tasks.
flowchart-1.jpg
flowchart-1.jpg (151.34 KiB) Viewed 19400 times
flowchart-2.jpg
flowchart-2.jpg (203.55 KiB) Viewed 19400 times
flowchart-3.jpg
flowchart-3.jpg (160.26 KiB) Viewed 19400 times
Probably the most common problem anyone has is a break somewhere in one of those routine loops (a routine called never ends).
If debugging is needing to be done, tracing to see if the loop flow gets stopped somewhere due to stuck in a logic trap,
(or as Spock would say; "That is illogical."), for finding out why your app locks up.

There are other ways to implement users task management too, but these should help you at getting started using V-TFT.
Last edited by Megahurts on 17 Nov 2013 09:25, edited 3 times in total.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: [TUTORIAL] V-TFT beginners example project

#10 Post by filip » 14 Oct 2013 13:29

Hi,

@Megahurts,
I am fighting a weird problem with the events file and V-TFT.
V-TFT for some reason does not like the commenting I did in that file and every time I load the project into V-TFT, it causes that files size to be x4 times bigger
by making 4 copies of almost everything repeat in the file.
Please, can you tell me how to reproduce this issue ?

Regards,
Filip.

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: [TUTORIAL] V-TFT beginners example project

#11 Post by Megahurts » 15 Oct 2013 01:09

Hi Filip,

Thanks for the interest on this.

Truthfully, I have no idea what I did to cause it, other than adding hundreds of comment lines to the projects event file.
I thought I had gotten past it, by doing the code editing in the compiler to remove the stuff that was repeated, and on first loading it back
into V-TFT, it seemed fine. But after I did some changes to the screens objects, the problem reappeared. If I edited the code in V-TFT to remove
the repeating stuff, as soon as I hit the save button, it all came back again.

I think somehow one or more of the comment lines is causing V-TFT to not see the original comment lines it makes to mark out the user code areas
so it tries to "fix" the layout and preserve user code but ends up copying what ever is messing it up and tries again and again and again and again
until it thinks it has succeeded and stops.

It may have to do with the fact I used the words "User Code" a LOT in the comments I have in the file???
It would depend on how V-TFT parses the looking for the user code comments it placed in the file in the first place.

You might have to have my project files to even see the results or find what is the problem line(s).
Project is too large to upload here, so where would you like it sent if you want to have a crack at it?

For the rest of you waiting for the completed project, sorry.
I will see this through and I have made some changes to the operation of the counters display routine that aCkO informed me would be a problem if left like it was.

I am also still working on the PDF manual that will only be available with the completed project as it will be around 4 times (or more) larger than the one I posted before,
and be more informative about the projects objects used, slightly different screen design (better I think), and will use screen captures to show things
I could not explain with text alone.

A sneak peak of the new screen design for you all:
event_counter_screen1_v2.jpg
event_counter_screen1_v2.jpg (28.84 KiB) Viewed 19949 times
So please hang in there while I get it composed and hopefully the bug issue resolved, Robert.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: [TUTORIAL] V-TFT beginners example project

#12 Post by filip » 15 Oct 2013 13:09

Hi,
You might have to have my project files to even see the results or find what is the problem line(s).
Project is too large to upload here, so where would you like it sent if you want to have a crack at it?
You can send it to my e-mail, filip att mikroe dot com, with the explanation on how to reproduce this issue.

Regards,
Filip.

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: [TUTORIAL] V-TFT beginners example project

#13 Post by Megahurts » 16 Oct 2013 10:04

Thanks Filip,

But we (aCkO actually), got it solved.
I had in the comments this text; " ' Event Handlers", as part of the tutorial descriptions on V-TFT comments it uses and makes.

Not allowed. V-TFT still seen it and used it as a marker and makes it copy it and the right one many times.
Changed the text so it is not like V-TFT's now.
All good now.

Regards.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: [TUTORIAL] V-TFT beginners example project

#14 Post by Megahurts » 17 Oct 2013 12:44

Tutorial update:

I had to change the HW profile to a dsPIC33EP MMB so I could do test runs and make sure everything works as intended.
(PIC32 MMB display controller quit working)

After fixing a couple minor logic errors (mine), and V-TFT object grouping BUG aCkO found with my project, and adjusting the blink rate constant value
for the RESET button confirmation trick, for how fast the application runs on the dsPIC33EP MMB, I think it is now good to go as an example project.
I also could not stop myself from doing more comments and editing existing ones so maybe more helpful than before.

I am still making the expanded PDF tutorial manual though. Making a lot of changes in layout because adding a lot of material and images.

Sometime later today I will post the project with source files on LibStock so it at least can be gotten to examine and try.
The PDF manual will have to be added at a later date, want to get it as complete as possible this time.

Thanks for the interest and patience on this, Robert.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

Megahurts
Posts: 900
Joined: 01 Oct 2009 22:48
Location: Rocky Mountains, USA.

Re: [TUTORIAL] V-TFT beginners example project

#15 Post by Megahurts » 17 Oct 2013 21:22

http://www.libstock.com/projects/view/8 ... e-tutorial

Tutorial Project source files for PIC32 and dsPIC33EP MMB's available for download on LibStock now.
Zip package contains copy of PDF manual I already posted here included for now. Still working on updated PDF manual.
There are a few differences between the manuals code listings and the examples source code. The source code comments is up to date and
contains more detailed tutorial information. Commented example code for alternate counter display updating technique with descriptions and
instructions for use.
Advanced level users project solution challenges.

Robert.
HW: easyPIC5|PICFlash2|easyBT|smartGSM|easyGSM|PICPLC16|mmWorkStation|FT800 Eve|PIC Clicker/2|
MMBs:PIC18F,PIC33EP,PIC32|CLICKs:DAC,ADC,GPS L10,Thermo,8x8B LED,Stepper,W/B OLED,9DOF,GPS3,tRF,Hall I|

SW: mP for PIC|mB for PIC-dsPIC-PIC32|Visual-TFT|

Post Reply

Return to “Visual TFT General”