cancel
Showing results for 
Search instead for 
Did you mean: 

While problem

samiassaad
Associate II
Posted on March 14, 2011 at 19:53

While problem

13 REPLIES 13
Posted on May 17, 2011 at 14:27

if(SysTick_Config(SystemCoreClock / 360000) )   // 5ms interrupts

 

returns an error that cant load it ; any solution for 5ms interrupt? I am using the new library 3.4.

 

X = 200, You asked the value of X

if(SysTick_Config(SystemCoreClock / 200) )   // 5ms interrupts

or

if(SysTick_Config(360000) )   // 5ms interrupts

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
samiassaad
Associate II
Posted on May 17, 2011 at 14:27

Thank you

my problem is this 

if(SysTick_Config(SystemCoreClock / 1000) )   // 1ms interrupts

now I get every 1ms an interupt;

in the system tick handle I increment

main_delay++;

then in the main routine I check

while(main_delay<3000); this should wait 3 sec

but it wait about  10 sec .

what could be the problem ?

again thank you clive

Posted on May 17, 2011 at 14:27

Perhaps your clocks are not as you expect. Would suggest you toggle a GPIO in your SysTick IRQ, and measure that on a scope. Should see a 500 Hz signal (period 2ms, 1ms High, 1ms Low).

Check you input clocks. Check internal clocks and settings. Use MCO pin.

Make sure your project has the correct target, and that any model settings are correct.

ZIP up a complete project example, and post it as an attachment.

Personally I'd use the following construct

starttick = systicker;

while((systicker - starttick) < 3000);

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
samiassaad
Associate II
Posted on May 17, 2011 at 14:27

Thank you alot , please check the attachment.