Does anyone have problem with FT800 / Gameduino? [RESOLVED]

General questions about Firewing...

Does anyone have problem with FT800 / Gameduino? [RESOLVED]

Postby Coccoliso » Wed Sep 09, 2015 10:54 am

Hi,
I found a set of widgets that crashes the command list.
Removing the comment from any of the lines in the example the next instruction (the CMD_TEXT) is not executed and is not executed even the test on the tag.

Code: Select all
clock = 80
#option _gccOptimise = Os
#option FT_MODEL = GAMEDUINO      ' enable for Gameduino 2
imports Ft800

Sub Main()
   Ft.SelfCalibrate()
   dim i as byte
   while true
      ft.Clear()
      tagmask(0)     
      CMD_SCROLLBAR(12, 26, 16, 160, 0, 120, 60, 480)
      CMD_GAUGE(353, 46, 36, 0, 4, 8, 40, 100)
      CMD_CLOCK(437, 46, 36, 0, 13, 51, 17, 0)
      CMD_NUMBER(442, 150, 28, 0, 42)
      '  CMD_PROGRESS(115, 57, 180, 12, 0, 20, 100)
      '  CMD_SLIDER(112, 114, 80, 8, 0, 30, 100)
      '  CMD_DIAL(429, 221, 36, 0, 6144)
      '  CMD_SPINNER(346, 221, 0, 0)
      '  CMD_TOGGLE(220, 168, 40, 27, 0, 0, "on" & cchar(255) & "off")
      ft.cmd_text(240, 136, 31, OPT_CENTER, "Hello world")
     
      i = Ft.GetTag() 
      Ft.cmd_text(15, 240, 27, 0, "Selected Tag : " + cstr(i))       
      Ft.Swap()       
   end while
End Sub


I tried it on Gameduino and EVE and the result is the same.
The only thing I noticed is that in the source of cmd_dial is missing the 2 postincrement ( but does not solve it by putting it ).
Has anyone found something similar and/or solved?
Last edited by Coccoliso on Tue Jul 04, 2017 11:15 am, edited 1 time in total.
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Does anyone have this problem with FT800 / Gameduino?

Postby Jerry Messina » Sat Sep 12, 2015 10:21 am

Did you ever have any luck with this?

I uncommented the code lines, looked at the compiler output and it looks ok on the surface.

I even ran it in the simulator and all the code is there/"working". I don't know what it would do on real hdw.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: Does anyone have this problem with FT800 / Gameduino?

Postby Coccoliso » Sun Sep 13, 2015 5:29 am

Hi Jerry.
If I remove the comment to one of the command lines the cmd_text is not executed.
Strange.
Than the original library have enabled the sound with the two lines that I found in a post.

Other test..
now I use the original FW FT800.bas library and the result is the same.
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Does anyone have this problem with FT800 / Gameduino?

Postby Jerry Messina » Sun Sep 13, 2015 9:56 am

I'm just running the code in MPSIM, and for me the calls to cmd_text ARE getting executed.

I wonder if maybe they're just not doing the correct thing because of one of the previous calls? I wouldn't see that since I'm not running with an FT800.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: Does anyone have this problem with FT800 / Gameduino?

Postby Coccoliso » Sun Jan 29, 2017 4:48 pm

Hi at all,

was an issue that I raised and that led me to change needs to go around ..
but today I had a little time to try again led to solution of the enigma.
In these subs he loses command buffer alignment
- cmd_progress
- cmd_slider
- cmd_dial
- cmd_track
and any subsequent instruction in the buffer is ignored until the next cycle.

Code: Select all
'********************************************************************************
'* Name    :                                                                    *
'* Purpose :                                                                    *
'********************************************************************************
public sub cmd_progress(x as short, y as short, w as short, h as short, options as ushort, val as ushort, range as ushort)
   cmd(FT_CMD_PROGRESS)
   wr16(RAM_CMD+cmd_offset, x)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, y)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, w)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, h)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, options)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, val)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, range)
   cmd_increment2()   
   wr16(RAM_CMD+cmd_offset, 0)               // 29/1/2017 
   cmd_increment2()                          // 29/1/2017
end sub

'********************************************************************************
'* Name    :                                                                    *
'* Purpose :                                                                    *
'********************************************************************************
public sub cmd_slider(x as short, y as short, w as ushort, h as ushort, options as ushort, val as ushort, range as ushort)
   cmd(FT_CMD_SLIDER)
   wr16(RAM_CMD+cmd_offset, x)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, y)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, w)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, h)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, options)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, val)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, range)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, 0)         // 29/1/2017
   cmd_increment2()                    // 29/1/2017
end sub

'********************************************************************************
'* Name    :                                                                    *
'* Purpose :                                                                    *
'********************************************************************************
public sub cmd_dial(x as short, y as short, r as short, options as ushort, val as ushort)
   cmd(FT_CMD_DIAL)
   wr16(RAM_CMD+cmd_offset, x)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, y)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, r)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, options)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, val)
   cmd_increment2()                    // 29/1/2017
   wr16(RAM_CMD+cmd_offset, 0)         // 29/1/2017
   cmd_increment2()                    // 29/1/2017
end sub

'********************************************************************************
'* Name    :                                                                    *
'* Purpose :                                                                    *
'********************************************************************************
public sub cmd_track(x as short, y as short, w as ushort, h as ushort, tag as byte)
   cmd(FT_CMD_TRACK)
   wr16(RAM_CMD+cmd_offset, x)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, y)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, w)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, h)
   cmd_increment2()
   wr16(RAM_CMD+cmd_offset, tag)
   cmd_increment2()     
   wr16(RAM_CMD+cmd_offset, 0)      // 29/1/2017
   cmd_increment2()                 // 29/1/2017
end sub




changing the sub as above now I can use more objects and also the tracking works.
Still remains a problem with cmd_spinner
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am

Re: Does anyone have this problem with FT800 / Gameduino?

Postby Freddy4711 » Sat Jul 01, 2017 9:31 pm

Hi,
I am controlling the FT800 from an AVR controller in assembler and faced the same problem today. The command for the progress bar and the slider screws up the whole command list. Numbers written to the screen (cmd_number) or a gauge written earlier started to run crazy after cmd_progress. It took me a whole day of searching in my code and finally found this message here. I added a dummy word (0) to the parameters of cmd_progress and suddenly it works. Now I also know the reason: As the FT800 is a 32-bit machine all commands and parameter lists must be aligned to an address that is a multiple of four. The description in the FT800 command reference for cmd_progress and cmd_slider end with the "Range" parameter at offset +16. As "Range" is two bytes long the parameter list will end after 18 bytes. You either must add two dummy bytes of zero, or the range paramter must be defined as DD (double word/ 32 bit)). It is the same problem with the text command. Whenever a string length is not a multiple of 4 it must be padded with zeroes as necessary. It would be a nice idea for the authors of the command reference to add a hint to all commands that must be extended by dummy bytes to work properly.
Freddy4711
 
Posts: 1
Joined: Sat Jul 01, 2017 8:58 pm

Re: Does anyone have problem with FT800 / Gameduino? [RESOLV

Postby Coccoliso » Sun Jul 02, 2017 7:04 am

Hi at all,
Freddy4711 that's exactly what I tried to explain in my previous post, the problem arises when you mix multiple commands on the same page and one of them is not aligned correctly because some commands ( like cmd_progress, cmd_slider, cmd_dial, cmd_track and cmd_toggle) did not have the right length and when called they blocked the stack commands up to next redraw.
In my previous post I just put some pieces that are still commented with a date..

However if you are interested in the full version of the module FT800.BAS I use .. can dw my current running version here :

Ft800.zip
FT800
(12.23 KiB) Downloaded 988 times


That correct and makes it work these commands:

- cmd_progress
- cmd_slider
- cmd_dial
- cmd_track
- cmd_toggle

Add some features like:

- turnon
- turnoff

.. and other calibration functions which I do not remember now :(


For my current use this is enough, if there are other problems let me know that we try to put some other stuff ;)

Then if I remember, there is a problem in loading the bytes of the bitmaps that this module should have corrected .. in the version I converted for Swordfish I'm sure I have corrected but for Firewing I do not remember if I inserted it :roll:
However, it is always the same problem of aligning the command so it should not be difficult to verify it
User avatar
Coccoliso
 
Posts: 177
Joined: Sat Sep 27, 2014 10:02 am


Return to Questions

Who is online

Users browsing this forum: No registered users and 0 guests

cron

x