Think i have found the Base Timing Bug ...
Posted: Fri May 09, 2014 4:49 pm
PIC24FJ256GB106
32000000clk
20MHz/Div5
hi
i have make a simple Project with LED and Delay
all is the same - only delay i change ...
( Millisec only 0...2000 )
250ms, 500ms, 1000ms, 1250 ms, 1500ms, 2000ms
and same code but in sec
1s, 2s, 3s
2 sec delay
i get a value of 30 in Real Time 60 sec .. this is right
2000ms delay
i get a value of 15 in Real Time 60 sec.. this is wrong // must be 30
same in
1sec delay
i get a value of 60 in Real Time 60 sec.. this is right
1000ms delay
i get a value of 30 in Real Time 60 sec .. this is wrong // must be 60
..
750ms delay
i get a value of 40 in Real Time 60 sec ... this is wrong // must be 80
500ms delay
is the same Delay like 1s . i get a value of 60 in Real Time 60 sec .. this is wrong // must be 120
whats happend?
..
I think i find the "little bug" that in Uart, USB, SPI, SD, Delay.. in ms ..
..this a calculate mistake in s / ms ?
can u please check it - i am sure - this is going wrong
..
TIP:
-----
The
#define MX_CLKS_PER_INST 2
or
#define MX_CLKS_PER_INST 1
do not change the value in ms delay
( same value*s )
but
change in s delay
example
1s delay with #define MX_CLKS_PER_INST 2 .. the Value is 60 in a Real Time 60 sec... thats right
1s delay with #define MX_CLKS_PER_INST 1 .. the Value is 30 in a Real Time 60 sec... thats changed the value
..
1000ms delay with #define MX_CLKS_PER_INST 2 .. the Value is 30 in a Real Time 60 sec ...
1000ms delay with #define MX_CLKS_PER_INST 1 .. same Value 30 in a Real Time 60 sec ...
Best wishes.
LG
Rudi
32000000clk
20MHz/Div5
hi
i have make a simple Project with LED and Delay
all is the same - only delay i change ...
( Millisec only 0...2000 )
250ms, 500ms, 1000ms, 1250 ms, 1500ms, 2000ms
and same code but in sec
1s, 2s, 3s
2 sec delay
i get a value of 30 in Real Time 60 sec .. this is right
2000ms delay
i get a value of 15 in Real Time 60 sec.. this is wrong // must be 30
same in
1sec delay
i get a value of 60 in Real Time 60 sec.. this is right
1000ms delay
i get a value of 30 in Real Time 60 sec .. this is wrong // must be 60
..
750ms delay
i get a value of 40 in Real Time 60 sec ... this is wrong // must be 80
500ms delay
is the same Delay like 1s . i get a value of 60 in Real Time 60 sec .. this is wrong // must be 120
whats happend?
..
I think i find the "little bug" that in Uart, USB, SPI, SD, Delay.. in ms ..
..this a calculate mistake in s / ms ?
can u please check it - i am sure - this is going wrong
..
TIP:
-----
The
#define MX_CLKS_PER_INST 2
or
#define MX_CLKS_PER_INST 1
do not change the value in ms delay
( same value*s )
but
change in s delay
example
1s delay with #define MX_CLKS_PER_INST 2 .. the Value is 60 in a Real Time 60 sec... thats right
1s delay with #define MX_CLKS_PER_INST 1 .. the Value is 30 in a Real Time 60 sec... thats changed the value
..
1000ms delay with #define MX_CLKS_PER_INST 2 .. the Value is 30 in a Real Time 60 sec ...
1000ms delay with #define MX_CLKS_PER_INST 1 .. same Value 30 in a Real Time 60 sec ...
Best wishes.
LG
Rudi