Delays not working on same on MIAC as in simulation

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Markro
Posts: 20
Joined: Sun Sep 23, 2007 12:41 am

Delays not working on same on MIAC as in simulation

Post by Markro »

Hi,

Using v4 FC and really simple program to print a message to the display then wait delay period, then clear, then wait delay period and print message.... etc, etc, etc for 3 times.

They delay uses a variable which is set on entering the macro.

When I change the assigned value of variable (type INT) and then run simulation changes take effect in simulation.

When I compile and flash to MIAC then although the message flashes the chages seem to have no effect on the flash rate, it is fairly quick ( maybe 250ms flashing on screen ) and have tried upto 3000ms in the delay with no percievable effect when in MIAC.

Only noticeable difference was when I changed to dealy to 10,000ms at this point 1 has 1 brief flicker and that was it nothing else noticed ( which makes me think the program ran ultra fast that time ) as INT has range circa +/- 32000 do not see why that is a problem.

There is no possibility to configure chip timing in flowcode, but I assume that is because it is a finished product and not expected to change.

Thanks

Mark

Markro
Posts: 20
Joined: Sun Sep 23, 2007 12:41 am

Re: Delays not working on same on MIAC as in simulation

Post by Markro »

Mmmm, I changed the setting for the delay to seconds and then reduced the variable value appropriately and not seems to work about right..... .????

Is there some kind of odd logic that does not allow for 3000ms but allows for 3s, which are the same.

No clues in help as to any logic.

regards,

Mark

Markro
Posts: 20
Joined: Sun Sep 23, 2007 12:41 am

Re: Delays not working on same on MIAC as in simulation

Post by Markro »

Think I found the answer ?

looked in the header file and delay_ms is passed a char parameter which would mean max 250ms delays, which was about the flash rate I guess, so me passing a Int with value 750, I guess either lost the additional above 255 or overflowed a few times and ended up on 250ms anyway.

Probably would have been good to document limitation, although having looked more and trawled the sourceboost forums - it appears it is a limitation of sourceboost as their delay_ms which FC calls is limited to being passed a char too.

will try and find the manual page 69 that is referred to in the forums, not found a manual yet with copy of sourceboost - or at least not one with page numbers and references to delay_ms in.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Delays not working on same on MIAC as in simulation

Post by medelec35 »

Hello Markro. This is a know problem and i believe is a sourceboost issue. Luckily there is a simple solution. see http://www.matrixmultimedia.com/mmforum ... =29&t=6792.
Martin

Markro
Posts: 20
Joined: Sun Sep 23, 2007 12:41 am

Re: Delays not working on same on MIAC as in simulation

Post by Markro »

Found manual ! ( and page 69 )

Thanks Medelec35, did not see that one when I seached for 'delay', must be losing it.

Still thinking about it FC could have i) documented in FC help (knowing my track record, probably is written down somewhere in FC help) OR ii) Better still handled it in FC version of delay_ms(), by accepting a an uint or containing some more elaborate logic... maybe a little harder unless you have an unsigned int type, think FC only has signed int.... so more elaborate logic would be needed ?

Hey-ho at least I learned something, so I can go an sleep in peace.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Delays not working on same on MIAC as in simulation

Post by medelec35 »

Your welcome. For the record I don't think your loosing it! There are so many references to the 'Delay' keyword, it a mammoth task searching through them all. The only reason i found it easily is because i personally posted in that thread, so my memory played a big part!
At least your sleeping pattern has improved :P
Martin

Post Reply