chThdSleepUntil() ??

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderators: utzig, tfAteba

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chThdSleepUntil() ??

Postby tfAteba » Tue Feb 09, 2016 5:47 pm

I saw that Giovanni gave you also the same link in another topic. (http://chibios.org/dokuwiki/doku.php?id=chibios:kb:timing)

So try to read thing carrefully and make some tests.

For me the anwer to your problem is there.

cheers, Theo.

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chThdSleepUntil() ??

Postby tfAteba » Tue Feb 09, 2016 5:58 pm

If you already try it and still have an error, I think that some thing in your code introduce that.

This your thread have the High priority compared to the other threads?

Try also to use the debugger to see what going on.

Giavanni give me this link in the morning: http://www.chibios.org/dokuwiki/doku.php?id=chibios:articles:debug_guide

Note also that I can't realy help further, I don't have your code.

If another person have ideas He will be welcom.

Cheers, Theo.

RTOSman
Posts: 29
Joined: Mon Feb 01, 2016 6:11 pm

Re: chThdSleepUntil() ??

Postby RTOSman » Tue Feb 09, 2016 6:38 pm

Thanks :) could you make a test in your side that you execute a function every an inteval of 10 MS ?

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chThdSleepUntil() ??

Postby tfAteba » Tue Feb 09, 2016 10:27 pm

Hi,

Yes will :) .

Theo

RTOSman
Posts: 29
Joined: Mon Feb 01, 2016 6:11 pm

Re: chThdSleepUntil() ??

Postby RTOSman » Wed Feb 10, 2016 1:16 am

Hi again :)
Tell me the funcy=tion chThdSleepUntil() stert counting frm the zero every time we call it ? or it start once we calle it and continu to count ?

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chThdSleepUntil() ??

Postby tfAteba » Wed Feb 10, 2016 6:49 am

Hi :) ,

Did you read the reference manual?

The function is describe like this: chThdSleepUntil() function Suspends the invoking thread until the system time arrives to the specified value.

So for me when you call it, your argument is the deadline for your thread to be executed.

How do you mesure the time to see that you have 40ms of errors after some running time?

cheers,

Theo.

RTOSman
Posts: 29
Joined: Mon Feb 01, 2016 6:11 pm

Re: chThdSleepUntil() ??

Postby RTOSman » Wed Feb 10, 2016 3:01 pm

Yes i know but i don't now if the function restart the value or it keep the last value ? after her execution!!!

RTOSman
Posts: 29
Joined: Mon Feb 01, 2016 6:11 pm

Re: chThdSleepUntil() ??

Postby RTOSman » Thu Feb 11, 2016 9:54 am

I changed the program, i did a chtsleemmillis()

Code: Select all

void mainThread() {


   chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO+1, Thread1, NULL);
   chThdCreateStatic(waThread2, sizeof(waThread2), NORMALPRIO, Thread2, NULL);
   
   
}
[code]
static THD_FUNCTION(Thread1, arg) {
[code]start= millis();
for (b = 0; b <100;b++)
   {
      geting_sample();
      chThdSleepMilliseconds(10);
      fin = millis();
   }
}
[/code]

[code]static THD_FUNCTION(Thread2, arg) {
   
while (1)  {

   Serial.print(sys);
      Serial.print((" "));
      Serial.print(b);
      Serial.print(("*"));
      Serial.println(fin);
}
}
[/code]


the resulte

500 0*0
500 0*0
500 0*0
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 1*510
500 2*521
500 2*521
500 2*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*531
500 3*541
500 4*541
500 4*541
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 5*551
500 6*562
500 6*562
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 7*572
500 8*582
500 8*582
500 8*582
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 9*592
500 10*603
500 10*603
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 11*613
500 12*623
500 12*623
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 13*633
500 14*644
500 14*644
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 15*654
500 16*664
500 16*664
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 17*674
500 18*685
500 18*685
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 19*695
500 20*705
500 20*705
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 21*715
500 22*726
500 22*726
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 23*736
500 24*746
500 24*746
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 25*756
500 26*766
500 26*766
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 27*777
500 28*787
500 28*787
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 29*797
500 30*807
500 30*807
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 31*818
500 32*828
500 32*828
500 32*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 33*838
500 34*848
500 34*848
500 34*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 35*859
500 36*869
500 36*869
500 36*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 37*879
500 38*889
500 38*889
500 38*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 39*900
500 40*910
500 40*910
500 40*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 41*920
500 42*930
500 42*930
500 42*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*941
500 43*951
500 44*951
500 44*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*961
500 45*971
500 46*971
500 46*971
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*982
500 47*992
500 48*992
500 48*992
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 49*1002
500 50*1012
500 50*1012
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 51*1022
500 52*1033
500 52*1033
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 53*1043
500 54*1053
500 54*1053
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1063
500 55*1074
500 56*1074
500 56*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1084
500 57*1094
500 58*1094
500 58*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 59*1104
500 60*1115
500 60*1115
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 61*1125
500 62*1135
500 62*1135
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 63*1145
500 64*1156
500 64*1156
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 65*1166
500 66*1176
500 66*1176
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 67*1186
500 68*1197
500 68*1197
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1207
500 69*1217
500 70*1217
500 70*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 71*1227
500 72*1238
500 72*1238
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 73*1248
500 74*1258
500 74*1258
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 75*1268
500 76*1278
500 76*1278
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 77*1289
500 78*1299
500 78*1299
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 79*1309
500 80*1319
500 80*1319
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1330
500 81*1340
500 82*1340
500 82*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1350
500 83*1360
500 84*1360
500 84*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 85*1371
500 86*1381
500 86*1381
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 87*1391
500 88*1401
500 88*1401
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 89*1412
500 90*1422
500 90*1422
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 91*1432
500 92*1442
500 92*1442
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 93*1453
500 94*1463
500 94*1463
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1473
500 95*1483
500 96*1483
500 96*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 97*1494
500 98*1504
500 98*1504
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 99*1514
500 100*1524[code]


i did did sys-start= i had 1024 MS so i have 24 ms errors . i want to delete the 24, i want 1000 MS exactely how we do that ??

User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: chThdSleepUntil() ??

Postby tfAteba » Thu Feb 11, 2016 7:59 pm

Hi,

Sorry I was too busy today.

I will tray to reproduce what you want and share but only if I have the time.

Just for information, I found some functions which can help to measure time easily.

Read the RT Reference manual to see how to use them. Here are the functions: chTMStartMeasurementX() and chTMStopMeasurementX()

Theo

RTOSman
Posts: 29
Joined: Mon Feb 01, 2016 6:11 pm

Re: chThdSleepUntil() ??

Postby RTOSman » Thu Feb 11, 2016 9:10 pm

Thanks i will take a look :)
me i want to get a sample every 10 MS not after not befor :) i think chibios not really performed or me who can't to program that


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 29 guests