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 support@ccsinfo.com

Newbe: delay_ms, #USE delay

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



Joined: 14 Apr 2004
Posts: 2

View user's profile Send private message

Newbe: delay_ms, #USE delay
PostPosted: Wed Apr 14, 2004 4:09 am     Reply with quote

I have been having some trouble trying to get the delay_ms function to work on a 16F84A. When using MPLAB to step through the source the code loads the delay then jumps to the #use delay statement and stays there.

Is there a problem with using the delay_ms function? are there extra switches or librarys needed by the compiler? I also noticed that if I use a simple FOR loop the code does not appear to create a delay.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Wed Apr 14, 2004 6:29 am     Reply with quote

Remember, delay_ms() is just a series of instructions like any other function. In MPLAB, it may look it gets stuck on the #use delay statement, but if you switch to the assembly listing (program memory) window you can actually step through the instructions that create the delay and watch them execute.
TimberWolf



Joined: 14 Apr 2004
Posts: 2

View user's profile Send private message

PostPosted: Wed Apr 14, 2004 8:42 am     Reply with quote

Its ok Ive discovered the problem. Iam using the MPLAB development environment. When I compile the CCS code the MPLAB switches to the CCS environment so that I can compile the code. When I exit the CCS environment and return to MPLAB the processor switches for WDT, Clock etc have changed or been reset.

The net effect is that as soon as I start to simulate or run the code the WD timesout and scuppers the execution of the code. I don't need the WD for my current application so I did not include any service routines. Razz [/quote]
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