Page 1 of 1

usec delay error using INT variable

Posted: Sat Feb 20, 2010 9:50 pm
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Sun Feb 21, 2010 12:06 am
by medelec35
This should help you, since you can select a delay of uS or mS
http://www.matrixmultimedia.com/mmforum ... =29&t=6792
or
http://www.matrixmultimedia.com/mmforum ... =26&t=6967
again change from seconds to uS.

Re: usec delay error using INT variable

Posted: Sun Feb 21, 2010 9:55 am
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Sun Feb 21, 2010 2:21 pm
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Sun Feb 21, 2010 2:37 pm
by medelec35
Sorry, I did not realise you used the example posted. I thought I was offering a solution.
Can you see if this is exactly the same please. If it is I will look a bit deeper into what the problem is.
PortB 0 = input. Port B1=output.
It will start off with a delay of 257 uS, and increase by pressing and releasing switch on port B1, or decrease by pressing and releasing switch on port B0

Since this is only a delay test, you will find that off time is slightly longer than on time i.e 344uS V 322uS, this is only due to switch detection test effectively placed after the call for off delay time.

If you want to post your flowcode, I can have a look to see where the problem is.

Re: usec delay error using INT variable

Posted: Sun Feb 21, 2010 10:18 pm
by medelec35
I have removed the delay flowcode, and made this one more accurate with a compensation formula. I hope Ben or Steve can come up with a better formula because one is definitely required for better accuracy (or even a different method). I have also change the flowcode slightly so on and off times are equal, but you can still used two port B inputs (B0 and B1) to decrease or increase time respectively.

Re: usec delay error using INT variable

Posted: Mon Feb 22, 2010 9:46 am
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Mon Feb 22, 2010 1:18 pm
by medelec35
Jan, I did not have the same problem as you, for on time of 257uS. I have left default time of 1000uS since was testing a range of times. You could try downloading this latest file I have posted, and set the time for 257uS.
If it works for you, then there could be a problem with your flowchart, perhaps there is a slight programming error? At least with flowchart posted, it is truly variable and the rest can be adated for your requirements.

Re: usec delay error using INT variable

Posted: Mon Feb 22, 2010 3:50 pm
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Mon Feb 22, 2010 4:59 pm
by medelec35
Jan Lichtenbelt wrote:Dear medelec,

You wrote: "You could try downloading this latest file I have posted". Which file and where can I find it?
by medelec35 on Sun Feb 21, 2010 10:18 pm
Called: large int uS delay1.fcf
about four posts up from this post.

Re: usec delay error using INT variable

Posted: Tue Feb 23, 2010 1:17 pm
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Tue Feb 23, 2010 1:18 pm
by Jan Lichtenbelt
3. At last I made my own programm which works well, see attachment "large int uS delay version JL.fxf" .

Re: usec delay error using INT variable

Posted: Wed Feb 24, 2010 6:58 am
by medelec35
Sorry Jan I misread the most important part :oops:
Jan Lichtenbelt wrote:The total on and off time is 1000 usec.
So the one I created had even on/off times.
Glad you have got it working. I shall have to read more carefully in the future.

Re: usec delay error using INT variable

Posted: Wed Feb 24, 2010 8:14 pm
by Jan Lichtenbelt
Deleted

Re: usec delay error using INT variable

Posted: Thu Feb 25, 2010 10:56 am
by Benj
Thats a bit harsh Jan, Medelec doesn't work for Matrix and certainly doesn't have to give out his free time to help people. As you seem to be asking a lot of questions I would apologise or he may choose not to help you again in future.

Also why "must" we do something? We provide this level of support because we like the product and want to see it evolve and get better. Also being an educational company we do not like to see customers struggling. Please make no mistake there is no "must" about it.

Post up the program that you think should be working and I will look into it for you.

Re: usec delay error using INT variable

Posted: Thu Feb 25, 2010 6:51 pm
by Jan Lichtenbelt
Dear Medelec,

Thanks a lot for your help.

But I think personal discussions should be out of this Forum and should not be archived by Google and therefor I removed my contribution.

Kind regards,

Jan