Jump to content
Sign in to follow this  
wally

Sys_sleep Help

Recommended Posts

Hello,

 

I'm starting in developing an application using Novo.

 

I'm calling the SysTimerUpdate() every 1ms, so my timebase is 1ms.

 

Can I perform something like Sys_Sleep(1000) or must I use a sequence of sleep like:

 

Sys_Sleep(255);
Sys_Sleep(255);
Sys_Sleep(255);
Sys_Sleep(255);

 

?

 

I know that Sys_Sleep has an argumento of the type TICK_COUNT, but I was not able to understand if it is 8 or 16 bit long for PIC18 family.

 

Thank you.

Share this post


Link to post
Share on other sites

Wally,

 

Hello,

 

I'm starting in developing an application using Novo.

 

I'm calling the SysTimerUpdate() every 1ms, so my timebase is 1ms.

 

Can I perform something like Sys_Sleep(1000) or must I use a sequence of sleep like:

 

Sys_Sleep(255);
Sys_Sleep(255);
Sys_Sleep(255);
Sys_Sleep(255);

 

?

 

I know that Sys_Sleep has an argumento of the type TICK_COUNT, but I was not able to understand if it is 8 or 16 bit long for PIC18 family.

 

Thank you.

 

You can build the Novo library to use a 16 Bit timer, then you will be able to code:

Sys_Sleep( 1000 );

Have a look in novocfg_pic18t6e4ts2.h - this uses a timer size of two bytes. So you could use the supplied library novolib_pic18t6e4ts2.lib if you want 6 task, 4 events, timer size 2 bytes.

 

Alternatively you can change the time base you use, eg

call SysTimerUpdate every 100ms instead of every 1ms, then you could use:

Sys_Sleep( 10 );

 

Regards

Dave

Share this post


Link to post
Share on other sites

Thanks Dave.

 

What about the load of a 16 bit timebase? Is this a big load in respect of an 8 bit one?

 

Thank you.

Share this post


Link to post
Share on other sites

Wally,

Thanks Dave.

 

What about the load of a 16 bit timebase? Is this a big load in respect of an 8 bit one?

 

Thank you.

The load is not that much greater. It can be significant on a PIC16 with only small amounts of RAM as each task will use extra bytes.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...