Starting Point System : Forum

You are not logged in.

#1 2015-04-17 18:31:17

jt
New member

Interrrupts, I presume....

Now that I've installed firmware4.4beta.frw, the combination of

pwm <n> counter
let <Variable> = ?

works great!  Thank you.

I have now used this to time how long it takes to complete a prescribed sequence of simple commands within the background event process. I have been surprised at the variation in time. It appears that the background event must be getting interrupted to service some other activity. This is bad, as it makes the relative timing of this sequence of commands unpredictable. Is there a way to turn off interrupts while within the background event?

Example of times taken (see lines in bold):

received : 1877

received : 1895

received : 1862

received : 1864

received : 1878

received : 1879

received : 1872

received : 1872

received : 1856

received : 1882

received : 1866

received : 1889

received : 1875

received : 1882

received : 1866

received : 1876

received : 1878

received : 1879

received : 1877

received : 1882

received : 1876

received : 1873

received : 1869

received : 63671

received : 1866

received : 1870

received : 1880

received : 1886

received : 1872

received : 1896

received : 1865

received : 1872

received : 1917

received : 1881

received : 1870

received : 1878

received : 1864

received : 1904

received : 1871

received : 1857

received : 2075

received : 1878

received : 1869

received : 63669

received : 1885

received : 1867

received : 1867

received : 1871

received : 1873

received : 1881

received : 1875

received : 1874

received : 1878

received : 1892

received : 1860

received : 1859

received : 1865

received : 1869

received : 1863

received : 1865

received : 1877

received : 1861

received : 1900

received : 1864

received : 2080

received : 1871

received : 1866

received : 1860

received : 1876

received : 1866

received : 1870

received : 1889

received : 1896

received : 1860

received : 1874

received : 1873

received : 1882

received : 1877

received : 1868

received : 1889

received : 1878

received : 1887

received : 1861

received : 1871

received : 1866

received : 1871

received : 63633

received : 1874

received : 1866

received : 1887

received : 1872

received : 1861

received : 1850

received : 63682

received : 1863

received : 1869

received : 1863

received : 1881

received : 1862

received : 1866

received : 1871

received : 1879

received : 1932

received : 1865

received : 1866

received : 1876

received : 1881

received : 1873

received : 1869

received : 1860

received : 2083

received : 1884

received : 1888

received : 63648

Offline

 

#2 2015-04-22 20:30:10

SPS Support Team
Moderator

Re: Interrrupts, I presume....

As the jumps generate values suspiciously close to 65536, it would hint to a wraparound of the counter. This would be normal if the pwm period was close to 2000, and the script was sometimes a bit delayed just at the edge of the wraparound.
Maybe you can share your code so that we can exactly reproduce the behaviour you're seeing, and provide advice ?
Best regards,

Offline

 

#3 2015-04-23 05:01:04

jt
New member

Re: Interrrupts, I presume....

Yes, this is a wrap-around problem. I confused the fact that the "int" is 64 bits with the fact that the counter is only 16 bits.

Offline

 

#4 2015-04-27 19:00:52

SPS Support Team
Moderator

Re: Interrrupts, I presume....

Yes, the counter is 16 bits.
And the variables declared as "int" are 32 bits.

Offline

 

Board footer

Powered by FluxBB

Home