CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

wdt in PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
z3ngew



Joined: 20 Apr 2013
Posts: 50

View user's profile Send private message

wdt in PIC
PostPosted: Thu May 16, 2013 3:05 pm     Reply with quote

Hello everyone,
Can watch dog timer which is implemented in the pic hardware be used as a regular timer, and if yes, please provide code snippet if possible?

Thanks in advance,
z3ngew
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Thu May 16, 2013 3:10 pm     Reply with quote

why not just use a regular timer? 0,1,2,3,... depending on pic..
_________________
CCS PCM 5.078 & CCS PCH 5.093
z3ngew



Joined: 20 Apr 2013
Posts: 50

View user's profile Send private message

PostPosted: Thu May 16, 2013 3:18 pm     Reply with quote

well, i am planning to use the other timers to make an interrupt multitasking system that will enable me to operate more that one RC servo motor at the same time, but not with the same behavior, so i was wondering if wdt can be used like regular timer, it would be helpful for me,

thanks, Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 16, 2013 3:25 pm     Reply with quote

Watchdog timer capabilities vary widely, depending on the PIC. Always
post your PIC.
z3ngew



Joined: 20 Apr 2013
Posts: 50

View user's profile Send private message

PostPosted: Thu May 16, 2013 3:30 pm     Reply with quote

I'm using PIC18F452
newguy



Joined: 24 Jun 2004
Posts: 1911

View user's profile Send private message

PostPosted: Thu May 16, 2013 3:31 pm     Reply with quote

The biggest problem with the watchdog is that it isn't a precise timing source.

The second is that a watchdog expiry causes a processor reset. Relying on that is very poor coding practice.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu May 16, 2013 4:52 pm     Reply with quote

Quote:

more that one RC servo motor


rc pulse position servos right ??

Unless you are doing something that requires sub usec control
one timer, a 16 mhz crystal and some clever code ought to do the trick.

have you searched HERE using

RC servo

as the search term ???
temtronic



Joined: 01 Jul 2010
Posts: 9269
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu May 16, 2013 5:24 pm     Reply with quote

Even the 'ancient' 16C84 can handle 8 'rc servos' and a serial interface at 9600 baud.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group