Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

FT800
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Mon Mar 02, 2015 7:08 pm    Post subject: Reply with quote

OK, problems resolved, Thanks ,
I try all demos
but also don't work with Xmega demo0
widged "points", on display I don't have any point
widged "cube" display only one line
widged "Text_VGA" ,"Bar_graph" don't work

Now this is not important for me, but maybe here are errors, or I don't understand it correctly

Tell me one thing yet, which software you use to converting jpg file into data lines (as in demo FT800_load_image), because LCD converter is to small images

Bob
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Mon Mar 02, 2015 10:41 pm    Post subject: Reply with quote

there are some issues for xmega. they have been resolved.
use a vport for the CS pins of the xmega and not a normal port pin. That should solve the problem.

Also, make syre vertex2ii looks like this :

'------------------------------------------------------------------------------------------------------------
Sub Vertex2ii(bystack x as Word , Byreg r18 As Word , Byreg r17 As Byte , Byreg r16 As Byte)
'------------------------------------------------------------------------------------------------------------
!ld r21,y+
!ld r20,y+
Cmd32 _vertex2ii(___WTMPB , r18 ,r17 ,r16)
' ^^^^^^
End Sub ' Vertex2II

_________________
Mark
Back to top
View user's profile Visit poster's website
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Mon Mar 02, 2015 11:08 pm    Post subject: Reply with quote

now "CUBE" works good, but "Points" still don't work
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Mon Mar 02, 2015 11:22 pm    Post subject: Reply with quote

and you did use a vport for the CS pin ?
_________________
Mark
Back to top
View user's profile Visit poster's website
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Tue Mar 03, 2015 10:03 am    Post subject: Reply with quote

No, don't understand how implement this Vport, CS is connected to port C.4
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5920
Location: Holland

blank.gif
PostPosted: Tue Mar 03, 2015 2:38 pm    Post subject: Reply with quote

have a look at config vport. and then use for example port0 for cs.
_________________
Mark
Back to top
View user's profile Visit poster's website
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Tue Mar 10, 2015 7:10 pm    Post subject: Reply with quote

Hi

I have one problem yet.
In my project I use cmdtoggle , I use some buttons which works ok, but button toggle schwitches when I press on display in various places not only on button toggle
and when I press toggle, then blink one time all texts on other buttons
I use in project gauge also near toggle, is possible that gauge is too close and generate problems ?

I use function Read_sfk = Read_keypad() for detect toggle switch (from demo keyboard)

I noticed that the sequence of placing the items on display is important,
when the toggle switch I gave at the end of the drawing on display ,then now other button is switched after pressing on display in every place...
but different buttons works incorretly if on display is more components

Bob
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Tue Mar 10, 2015 11:02 pm    Post subject: Reply with quote

Bob

Maybe you can make a small demo so we can see the problem?.

Just remember you need to do initial LCD Cal accurate otherwise
if you have many objects close together you may get false selections.

Use a small stylus and not something that is very thick.

_________________
Peter
Back to top
View user's profile
twenty13

Bascom Member



Joined: 05 Jul 2011
Posts: 12

australia.gif
PostPosted: Wed Mar 11, 2015 8:29 am    Post subject: Reply with quote

Hi,

I have a similar issue. The touch points are not coordinated with the buttons i have defined. But every time when I use "cmdcalibrate" I end up with a blank white screen. So, I can't really use the calibration routine. Also, is there a way to store the calibration constants and pre load them so that it is not necessary to execute the calibration routine every time at start up? Thanks in advance.
Back to top
View user's profile
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Wed Mar 11, 2015 9:13 am    Post subject: Reply with quote

I have enabled calibration after every programming (in file ft800.inc)
Const Lcdcal = 1
it enought ,or not ?

ps.
I use a small stylus
Back to top
View user's profile
twenty13

Bascom Member



Joined: 05 Jul 2011
Posts: 12

australia.gif
PostPosted: Wed Mar 11, 2015 9:28 am    Post subject: Reply with quote

Thanks Mototest2. I missed that one. Will give it a try when new board Gameduino2 arrives.
Back to top
View user's profile
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Wed Mar 11, 2015 9:34 am    Post subject: Reply with quote

here is code which make problems, I think calibration is good
I use 4,3" display 480x270px

Code:


$regfile = "m128can.dat"
$crystal = 16000000
$hwstack = 200
$swstack = 200
$framesize = 700
$notypecheck
Config Ft800 = Spi , Ftsave = 0 , Ftdebug = 0 , Ftcs = Portb.0 , Ftpd = Portb.7
Config Base = 0
Config Submode = New
Config Spihard = Hard, Interrupt = Off, Data_Order = Msb, Master = Yes, Polarity = Low, Phase = 0, Clockrate = 4, Noss = 1
Spsr = 1                                                    ' Makes SPI run at double speed
$include "FT800.inc"
$include "FT800_Functions.inc"

Dim Obroty As Word , Temperatura As Word , Advance As Byte , Pasek As Word , Procent As Word , Startt As Bit
Dim tagx As Byte
Dim opt As Byte
Dim Temp_tag As Byte                                        ' used in Read_Keys() Function
Dim Sk As Byte                                              ' used in Read_Keys() Function
Dim Read_sfk As Byte
Dim Touch_detect As Byte
Dim Flag As Byte

Declare Sub Screen1
Declare Function Read_keypad() As Byte
Declare Function Istouch() As Byte

Const Maxx = 1
Const Minn = 3
Const Midd = 2
Const Menu = 4
Const Badvance = 5
Const Res = 6
Const Start_stop = 7

 Key_detect Alias 0
Spiinit
If Ft800_init() = 1 Then End

Do

Read_sfk = Read_keypad()

 If Flag.key_detect > 0 Then
 Flag.key_detect = 0

 If Read_sfk = Badvance Then
   Toggle Advance
End If

 If Read_sfk = Start_stop Then
   Toggle Startt
End If

If Read_sfk = Res Then
Config Watchdog = 16
Start Watchdog
 Do
Loop
End If

End If

Call Screen1

Waitms 10

Loop


Function Read_Keypad() As Byte
'------------------------------------------------------------------------------------------------------------
   Local Read_tag   As Byte
   Read_tag = Rd8(Reg_Touch_Tag)
   If Istouch() = 0 Then Touch_detect = 0
   If Read_tag <> 0 Then   ' Allow if the Key is released
      If temp_tag <> Read_tag AND touch_detect = 0 Then
         Temp_tag = Read_tag                                ' Load the Read tag to temp variable
         Touch_detect = 1
      End If
   Else
      If Temp_tag <> 0 Then
         Flag.key_detect = 1
         Read_tag = Temp_tag
      End If
      Temp_tag = 0
   End If
   Read_Keypad = Read_tag
End Function                                                ' Read_Keypad
Function istouch() As Byte
'------------------------------------------------------------------------------------------------------------
   Local Retistouch As Word
   Retistouch = Rd16(reg_touch_raw_xy)
   Retistouch = Retistouch And &H8000
   Istouch = Retistouch
End Function


Sub Screen1                                          
          Clearscreen                                      
Clearcolorrgb &HA0 , &HA0 , &HA0                        
   Clear_b 1 , 1 , 1
'------------------------------buttons----------------------------------------
'CmdButton x, y, w, h ,font, options, text
Cmdfgcolor Black                                          
Cmdgradcolor White                                        
Tag Maxx                                                  
Cmdbutton 260 , 8 , 85 , 30 , 28 , 0 , "Max"
Cmdfgcolor Black                                          
Cmdgradcolor White
Tag Midd                                                    '
Cmdbutton 260 , 39 , 85 , 30 , 28 , 0 , "Mid"
Cmdfgcolor Black                                          
Cmdgradcolor White
Tag Minn
Cmdbutton 260 , 69 , 85 , 30 , 28 , 0 , "Min"
Cmdfgcolor Black                                          
Cmdgradcolor White
Tag Menu
Cmdbutton 360 , 8 , 114 , 32 , 28 , 0 , "Menu"
Cmdfgcolor Black                                            
Cmdgradcolor White
Tag Start_stop
Cmdbutton 360 , 177 , 114 , 58 , 28 , 0 , "Start/Stop"
'------------------------------------- dial gauge------------------------------
'
'CmdGauge x, y, r, options, major, minor, val, range
 Cmdbgcolor &H0066CC                                        
  Colorrgb &H00 , &H00 , &H00                              
Cmdgauge 130 , 130 , 125 , 0 , 10 , 5 , Obroty , 2000
Cmdfgcolor Blue                                            
Cmdgradcolor Black                                        
'
'------------------------------progress bar------------------------------------
 'CmdProgress x, y, w, h, options, val, range
   Colorrgb &H99 , &HCC , &HFF
   Cmdbgcolor &H606060
Cmdprogress 232 , 245 , 235 , 25 , 0 , Pasek , 999
Procent = Pasek / 10
If Procent > 35 Then Colorrgb &H00 , &H00 , &H00 Else Colorrgb &HFF , &HFF , &H00
  Cmdnumber 320 , 245 , 23 , 0 , Procent
 Cmdtext 350 , 245 , 23 , 0 , "%"                          
'-----------------------------------------LED----------------------------------
'CmdDial x, y, r ,options, val
If Startt = 0 Then
   Cmdfgcolor &HFF0000                                    
   'Cmdbgcolor &H000080
Cmddial 460 , 190 , 7 , 0 , &H8000
End If
If Startt = 255 Then
   Cmdfgcolor &H00FF00                                    
Cmddial 460 , 190 , 7 , 0 , &H8000
End If
'--------------------------------Temperature------------------------------------
 'CmdProgress x, y, w, h, options, val, range
   Colorrgb &HFF , &H00 , &H00                            
   Cmdbgcolor &H606060                                    
Cmdprogress 268 , 134 , 180 , 22 , 0 , Temperatura , 100
Colorrgb &HFF , &HFF , &HFF
Cmdtext 350 , 134 , 22 , 0 , "C'"                          
  Cmdnumber 320 , 134 , 22 , 0 , Temperatura

'-----------------------------------scale dial--------------------------------------------
Colorrgb &H00 , &H00 , &H
Cmdtext 63 , 204 , 21 , 0 , "0"
Cmdtext 10 , 154 , 21 , 0 , "200"
Cmdtext 8 , 105 , 21 , 0 , "400"
Cmdtext 25 , 60 , 21 , 0 , "600"
Cmdtext 60 , 30 , 21 , 0 , "800"
Cmdtext 110 , 10 , 22 , 0 , "1000"
Cmdtext 175 , 30 , 21 , 0 , "1200"
Cmdtext 210 , 60 , 21 , 0 , "1400"
Cmdtext 228 , 105 , 21 , 0 , "1600"
Cmdtext 225 , 154 , 21 , 0 , "1800"
Cmdtext 180 , 204 , 21 , 0 , "2000"
Cmdnumber 100 , 180 , 25 , 0 , Obroty

'---------------------------------------------reset----------------------
Tag Res                                                     '
Cmdgradcolor White                                          
'Cmdbgcolor White                                            
Cmdfgcolor Blue                                          
Colorrgb 255 , 255 , 255                                  
Cmdbutton 4 , 234 , 34 , 34 , 28 , 0 , "R"
'-------------------------------Advance----------------------toggle switch------------
If Advance = 0 Then
 Colorrgb &HFF , &HFF , &HFF                              
 Cmdbgcolor Red                                            
Cmdfgcolor White
Tag Badvance                                              
 Cmdtoggle 255 , 198 , 80 , 27 , 0 , 0 , "Off" + Gap + "On" '          0=off  198
 End If
 If Advance = 255 Then
 Colorrgb &HFF , &HFF , &HFF                              
 Cmdbgcolor Green                                        
Cmdfgcolor White
Tag Badvance
Cmdtoggle 255 , 198 , 80 , 27 , 0 , 65535 , "Off" + Gap + "On"       '65535=on
End If
Updatescreen
End Sub
 
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Wed Mar 11, 2015 10:24 am    Post subject: Reply with quote

twenty13

Note: (after you do Const Lcdcal = 1) if you ever want to force an LCD cal

1) Before you powerup/reset your LCD/board touch or hold the stylus anywhere on the LCD area
2) Now do the powerup/reset, and release the stylus
3) now you should be prompted for the LCD Cal.

As for the CmdCalibrate blank screen, sometimes if it won't boot properly it may requirea a cold boot
by turning the power off/on and not just a reset but regardless if in doubt post a small demo.

_________________
Peter
Back to top
View user's profile
mototest2

Bascom Member



Joined: 24 Dec 2006
Posts: 53

poland.gif
PostPosted: Wed Mar 11, 2015 10:35 am    Post subject: Reply with quote

Thank you for informations, calibration work good.
try my demo with gameduido you will see problem, all buttons work ok, but if you touch on dial gauge, then also work button start/stop.

I made this demo also with software visual TFT from Mikroelektronika, some months ago and I had identical problem,
I resolved it with command DrawScreen(@menu) (updatescreen in bascom) after creating every graphic element on display,
but in bascom is other construction creating graphic elements
Back to top
View user's profile
PeterM

Bascom Member



Joined: 09 Jun 2008
Posts: 118

australia.gif
PostPosted: Wed Mar 11, 2015 12:55 pm    Post subject: Reply with quote

mototest2

I was playing with your demo after I replied to twenty13

I did notice the Cmdtoggle On/Off was been affected by the Start/Stop button
BUT I then I got my fine point Stylus and did a new LCD Cal
it worked FINE, I could not make the Start/Stop button affect the On/Off.
I tested this using the Gameduino2 board.

Can you try the LCD cal again trying to tap in the center of the circle
as close to the centre as possible?. Personally I have never had an issue but maybe some
registers need adjusting.

Looking in the FT800 Programmers Guide, see page 60,61 and 62
Reg_Touch_RZThreshold, Reg_Touch_OverSample, Reg_Touch_Settle etc.

One small thing I noticed, when you select the Start/Stop button
is you drawn the LED using CmdDial, seems an overkill.
Below is your coded moded with PointSize if you want to try it.

Code:

If Startt = 0 Then
  Cmdfgcolor &HFF0000
ElseIf Startt = 255 Then
 Cmdfgcolor &H00FF00
End If

Begin_G  FTPOINTS
PointSize 5*16
VERTEX2II  460, 190,0,0
 

_________________
Peter
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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